/** * * @param writer * @param propertyInfo * @param value * @throws XMLStreamException * @throws EdmException * @throws EntityProviderException */ private void appendProperty(final XMLStreamWriter writer, final EntityComplexPropertyInfo propertyInfo, final Object value) throws XMLStreamException, EdmException, EntityProviderException { if (value == null) { writer.writeAttribute(Edm.NAMESPACE_M_2007_08, FormatXml.ATOM_NULL, FormatXml.ATOM_VALUE_TRUE); } else { writer.writeAttribute(Edm.NAMESPACE_M_2007_08, FormatXml.ATOM_TYPE, getFqnTypeName(propertyInfo)); List<EntityPropertyInfo> propertyInfos = propertyInfo.getPropertyInfos(); for (EntityPropertyInfo childPropertyInfo : propertyInfos) { if ( value instanceof Map && !((Map<?,?>)value).containsKey(childPropertyInfo.getName())|| (value instanceof Entity && (((Entity)value).getProperty(childPropertyInfo.getName()))==null)) { continue; } Object childValue = extractChildValue(value, childPropertyInfo.getName()); append(writer, childPropertyInfo.getName(), childPropertyInfo, childValue); } } }