# Embedded Object support

Embedded objects are CIM instances or classes embedded in a property, parameter or return value

## Creation of Embedded Object Java CIM elements from application

If the CIM object is a valued element, its value has to be a CIMClass or CIMInstance instance and its type has to be CIMDataType.CLASS_T or CIMDataType.OBJECT_T correspondingly. Array types and values are allowed for CIMProperty and CIMParameter.

In case of valued elements the application doesn't have to add the EmbeddedObject qualifier directly since that's placed into the outgoing XML stream automatically.

If the CIM object is not valued or contains a null value the application has to set the type to CIMDataType.STRING_T and has to add the EmbeddedObject qualifier directly.

## Extracting received Embedded Objects from the application

In the application embedded objects appear in CIMValuedElements with CIMDataType.CLASS_T or CIMDataType.OBJECT_T types and with CIMClass and CIMInstance values correspondingly. Similar array constructs can appear too.

## In CIM elements

Embedded objects are supported with the following CIM-XML elements:

- PROPERTY
- PROPERTY.ARRAY
- PARAMVALUE
- RETURNVALUE
- PARAMETER
- PARAMETER.ARRAY
- METHOD

From javax.cim perspective these are the following classes:
CIMProperty, CIMClassProperty, CIMArgument, CIMParameter, CIMMethod (RETURNVALUE is mapped into java.lang.Object which can be CIMClass or CIMInstance in case of Embedded Object return value).

## Embedded Object encoding in outgoing XML streams (requests)

All embedded object CIM-XML elements which can have Qualifiers are encoded by adding the EmbeddedObject qualifier. The rest of the elements are encoded by the EmbeddedObject="object" XML attribute.

Elements encoded by EmbeddedObject qualifier:

- PROPERTY
- PROPERTY.ARRAY
- PARAMETER
- PARAMETER.ARRAY
- METHOD

Elements encoded by EmbeddedObject attribute:

- PARAMVALUE

Building of RETURNVALUE is not implemented (it's the CIMOM's task).

## Embedded Object recognition in CIM-XML responses

Embedded Object can be recognized by EmbeddedObject qualifier or EmbeddedObject attribute.

Embedded Object elements recognized by EmbeddedObject attribute:

- PROPERTY
- PROPERTY.ARRAY
- PARAMVALUE
- RETURNVALUE

Embedded Object elements recognized by EmbeddedObject qualifier:

- PROPERTY
- PROPERTY.ARRAY
- PARAMETER
- PARAMETER.ARRAY
- METHOD