Java Code Examples for org.apache.olingo.commons.api.data.Property#getName()

The following examples show how to use org.apache.olingo.commons.api.data.Property#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ODataJsonSerializer.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void writePrimitiveCollection(final EdmPrimitiveType type, final Property property,
    final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
    final Boolean isUnicode, final JsonGenerator json)
    throws IOException, SerializerException {
  json.writeStartArray();
  for (Object value : property.asCollection()) {
    switch (property.getValueType()) {
    case COLLECTION_PRIMITIVE:
    case COLLECTION_ENUM:
    case COLLECTION_GEOSPATIAL:
      try {
        writePrimitiveValue(property.getName(), type, value, isNullable,
            maxLength, precision, scale, isUnicode, json);
      } catch (EdmPrimitiveTypeException e) {
        throw new SerializerException("Wrong value for property!", e,
            SerializerException.MessageKeys.WRONG_PROPERTY_VALUE,
            property.getName(), property.getValue().toString());
      }
      break;
    default:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    }
  }
  json.writeEndArray();
}
 
Example 2
Source File: ODataJsonSerializer.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void writePrimitive(final EdmPrimitiveType type, final Property property,
    final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
    final Boolean isUnicode, final JsonGenerator json)
    throws EdmPrimitiveTypeException, IOException, SerializerException {
  if (property.isPrimitive()) {
    writePrimitiveValue(property.getName(), type, property.asPrimitive(),
        isNullable, maxLength, precision, scale, isUnicode, json);
  } else if (property.isGeospatial()) {
    writeGeoValue(property.getName(), type, property.asGeospatial(), isNullable, json, null);
  } else if (property.isEnum()) {
    writePrimitiveValue(property.getName(), type, property.asEnum(),
        isNullable, maxLength, precision, scale, isUnicode, json);
  } else {
    throw new SerializerException("Inconsistent property type!",
        SerializerException.MessageKeys.INCONSISTENT_PROPERTY_TYPE, property.getName());
  }
}
 
Example 3
Source File: EdmAssistedJsonSerializer.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void complexValue(final JsonGenerator json, final EdmComplexType valueType, final String typeName,
    final ComplexValue value) throws IOException, SerializerException {
  json.writeStartObject();

  if (typeName != null && isODataMetadataFull) {
    json.writeStringField(Constants.JSON_TYPE, typeName);
  }

  for (final Property property : value.getValue()) {
    final String name = property.getName();
    final EdmProperty edmProperty = valueType == null || valueType.getStructuralProperty(name) == null ? null
        : valueType.getStructuralProperty(name);
    valuable(json, property, name, edmProperty == null ? null : edmProperty.getType(), edmProperty);
  }
  links(value, null, json);

  json.writeEndObject();
}
 
Example 4
Source File: JsonDeltaSerializerWithNavigations.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void writeComplexCollection(final ServiceMetadata metadata, final EdmComplexType type,
    final Property property,
    final Set<List<String>> selectedPaths, final JsonGenerator json)
    throws IOException, SerializerException {
  json.writeStartArray();
  for (Object value : property.asCollection()) {
    switch (property.getValueType()) {
    case COLLECTION_COMPLEX:
      json.writeStartObject();
      if (isODataMetadataFull) {
        json.writeStringField(Constants.JSON_TYPE, "#" +
            type.getFullQualifiedName().getFullQualifiedNameAsString());
      }
      writeComplexValue(metadata, type, ((ComplexValue) value).getValue(), selectedPaths, json);
      json.writeEndObject();
      break;
    default:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    }
  }
  json.writeEndArray();
}
 
Example 5
Source File: JsonDeltaSerializerWithNavigations.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void writePrimitive(final EdmPrimitiveType type, final Property property,
    final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
    final Boolean isUnicode, final JsonGenerator json)
    throws EdmPrimitiveTypeException, IOException, SerializerException {
  if (property.isPrimitive()) {
    writePrimitiveValue(property.getName(), type, property.asPrimitive(),
        isNullable, maxLength, precision, scale, isUnicode, json);
  } else if (property.isGeospatial()) {
    throw new SerializerException("Property type not yet supported!",
        SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
  } else if (property.isEnum()) {
    writePrimitiveValue(property.getName(), type, property.asEnum(),
        isNullable, maxLength, precision, scale, isUnicode, json);
  } else {
    throw new SerializerException("Inconsistent property type!",
        SerializerException.MessageKeys.INCONSISTENT_PROPERTY_TYPE, property.getName());
  }
}
 
Example 6
Source File: ODataBinderImpl.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
@Override
public ClientProperty getODataProperty(final ResWrap<Property> resource) {
  final Property payload = resource.getPayload();
  final EdmTypeInfo typeInfo = buildTypeInfo(ContextURLParser.parse(resource.getContextURL()),
      resource.getMetadataETag(), payload.getName(), payload.getType());

  final ClientProperty property = new ClientPropertyImpl(payload.getName(),
      getODataValue(typeInfo == null ? null : typeInfo.getFullQualifiedName(),
          payload, resource.getContextURL(), resource.getMetadataETag()));
  odataAnnotations(payload, property);
  
  for (Operation op : resource.getPayload().getOperations()) {
    ClientOperation operation = new ClientOperation();
    operation.setTarget(op.getTarget());
    operation.setTitle(op.getTitle());
    operation.setMetadataAnchor(op.getMetadataAnchor());
    property.getOperations().add(operation);
  }     
  return property;
}
 
Example 7
Source File: JsonDeltaSerializer.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void writeComplexCollection(final ServiceMetadata metadata, final EdmComplexType type,
    final Property property,
    final Set<List<String>> selectedPaths, final JsonGenerator json)
    throws IOException, SerializerException {
  json.writeStartArray();
  for (Object value : property.asCollection()) {
    switch (property.getValueType()) {
    case COLLECTION_COMPLEX:
      json.writeStartObject();
      if (isODataMetadataFull) {
        json.writeStringField(Constants.JSON_TYPE, "#" +
            type.getFullQualifiedName().getFullQualifiedNameAsString());
      }
      writeComplexValue(metadata, type, ((ComplexValue) value).getValue(), selectedPaths, json);
      json.writeEndObject();
      break;
    default:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    }
  }
  json.writeEndArray();
}
 
Example 8
Source File: JsonDeltaSerializer.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void writePrimitive(final EdmPrimitiveType type, final Property property,
    final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
    final Boolean isUnicode, final JsonGenerator json)
    throws EdmPrimitiveTypeException, IOException, SerializerException {
  if (property.isPrimitive()) {
    writePrimitiveValue(property.getName(), type, property.asPrimitive(),
        isNullable, maxLength, precision, scale, isUnicode, json);
  } else if (property.isGeospatial()) {
    throw new SerializerException("Property type not yet supported!",
        SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
  } else if (property.isEnum()) {
    writePrimitiveValue(property.getName(), type, property.asEnum(),
        isNullable, maxLength, precision, scale, isUnicode, json);
  } else {
    throw new SerializerException("Inconsistent property type!",
        SerializerException.MessageKeys.INCONSISTENT_PROPERTY_TYPE, property.getName());
  }
}
 
Example 9
Source File: ODataXmlSerializer.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void writePrimitiveCollection(final EdmPrimitiveType type, final Property property,
    final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
    final Boolean isUnicode, final String xml10InvalidCharReplacement,
    final XMLStreamWriter writer) throws XMLStreamException, EdmPrimitiveTypeException, SerializerException {
  for (Object value : property.asCollection()) {
    writer.writeStartElement(METADATA, Constants.ELEM_ELEMENT, NS_METADATA);
    switch (property.getValueType()) {
    case COLLECTION_PRIMITIVE:
    case COLLECTION_ENUM:
      writePrimitiveValue(type, value, isNullable, maxLength, precision,
          scale, isUnicode, xml10InvalidCharReplacement, writer);
      break;
    case COLLECTION_GEOSPATIAL:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    default:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    }
    writer.writeEndElement();
  }
}
 
Example 10
Source File: ODataXmlSerializer.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
private void writePrimitive(final EdmPrimitiveType type, final Property property,
    final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
    final Boolean isUnicode, final String xml10InvalidCharReplacement, final XMLStreamWriter writer)
    throws EdmPrimitiveTypeException, XMLStreamException, SerializerException {
  if (property.isPrimitive()) {
    if (type != EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.String)) {
      writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_TYPE,
          type.getKind() == EdmTypeKind.DEFINITION ?
              "#" + type.getFullQualifiedName().getFullQualifiedNameAsString() :
              type.getName());
    }
    writePrimitiveValue(type, property.asPrimitive(),
        isNullable, maxLength, precision, scale, isUnicode, xml10InvalidCharReplacement, writer);
  } else if (property.isGeospatial()) {
    throw new SerializerException("Property type not yet supported!",
        SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
  } else if (property.isEnum()) {
    writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_TYPE,
        "#" + type.getFullQualifiedName().getFullQualifiedNameAsString());
    writePrimitiveValue(type, property.asEnum(),
        isNullable, maxLength, precision, scale, isUnicode, xml10InvalidCharReplacement, writer);
  } else {
    throw new SerializerException("Inconsistent property type!",
        SerializerException.MessageKeys.INCONSISTENT_PROPERTY_TYPE, property.getName());
  }
}
 
Example 11
Source File: Storage.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
private void updateProduct(EdmEntityType edmEntityType, List<UriParameter> keyParams, Entity entity,
    HttpMethod httpMethod) throws ODataApplicationException {

  Entity productEntity = getProduct(edmEntityType, keyParams);
  if (productEntity == null) {
    throw new ODataApplicationException("Entity not found", HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ENGLISH);
  }

  // loop over all properties and replace the values with the values of the given payload
  // Note: ignoring ComplexType, as we don't have it in our odata model
  List<Property> existingProperties = productEntity.getProperties();
  for (Property existingProp : existingProperties) {
    String propName = existingProp.getName();

    // ignore the key properties, they aren't updateable
    if (isKey(edmEntityType, propName)) {
      continue;
    }

    Property updateProperty = entity.getProperty(propName);
    // the request payload might not consider ALL properties, so it can be null
    if (updateProperty == null) {
      // if a property has NOT been added to the request payload
      // depending on the HttpMethod, our behavior is different
      if (httpMethod.equals(HttpMethod.PATCH)) {
        // as of the OData spec, in case of PATCH, the existing property is not touched
        continue; // do nothing
      } else if (httpMethod.equals(HttpMethod.PUT)) {
        // as of the OData spec, in case of PUT, the existing property is set to null (or to default value)
        existingProp.setValue(existingProp.getValueType(), null);
        continue;
      }
    }

    // change the value of the properties
    existingProp.setValue(existingProp.getValueType(), updateProperty.getValue());
  }
}
 
Example 12
Source File: Storage.java    From syndesis with Apache License 2.0 5 votes vote down vote up
private void updateProduct(EdmEntityType edmEntityType, List<UriParameter> keyParams, Entity entity, HttpMethod httpMethod)
    throws ODataApplicationException {
    Entity productEntity = getProduct(edmEntityType, keyParams);
    if (productEntity == null) {
        throw new ODataApplicationException("Entity not found", HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ENGLISH);
    }

    // loop over all properties and replace the values with the values of the given payload
    // Note: ignoring ComplexType, as we don't have it in our odata model
    List<Property> existingProperties = productEntity.getProperties();
    for (Property existingProp : existingProperties) {
        String propName = existingProp.getName();

        // ignore the key properties, they aren't updateable
        if (isKey(edmEntityType, propName)) {
            continue;
        }

        Property updateProperty = entity.getProperty(propName);
        // the request payload might not consider ALL properties, so it can be null
        if (updateProperty == null) {
            // if a property has NOT been added to the request payload
            // depending on the HttpMethod, our behavior is different
            if (httpMethod.equals(HttpMethod.PATCH)) {
                // as of the OData spec, in case of PATCH, the existing property is not touched
                continue; // do nothing
            } else if (httpMethod.equals(HttpMethod.PUT)) {
                // as of the OData spec, in case of PUT, the existing property is set to null (or to default value)
                existingProp.setValue(existingProp.getValueType(), null);
                continue;
            }
        }

        // change the value of the properties
        existingProp.setValue(existingProp.getValueType(), updateProperty.getValue());
    }
}
 
Example 13
Source File: Storage.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
private void updateProduct(EdmEntityType edmEntityType, List<UriParameter> keyParams, Entity entity,
    HttpMethod httpMethod) throws ODataApplicationException {

  Entity productEntity = getProduct(edmEntityType, keyParams);
  if (productEntity == null) {
    throw new ODataApplicationException("Entity not found", HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ENGLISH);
  }

  // loop over all properties and replace the values with the values of the given payload
  // Note: ignoring ComplexType, as we don't have it in our odata model
  List<Property> existingProperties = productEntity.getProperties();
  for (Property existingProp : existingProperties) {
    String propName = existingProp.getName();

    // ignore the key properties, they aren't updateable
    if (isKey(edmEntityType, propName)) {
      continue;
    }

    Property updateProperty = entity.getProperty(propName);
    // the request payload might not consider ALL properties, so it can be null
    if (updateProperty == null) {
      // if a property has NOT been added to the request payload
      // depending on the HttpMethod, our behavior is different
      if (httpMethod.equals(HttpMethod.PATCH)) {
        // as of the OData spec, in case of PATCH, the existing property is not touched
        continue; // do nothing
      } else if (httpMethod.equals(HttpMethod.PUT)) {
        // as of the OData spec, in case of PUT, the existing property is set to null (or to default value)
        existingProp.setValue(existingProp.getValueType(), null);
        continue;
      }
    }

    // change the value of the properties
    existingProp.setValue(existingProp.getValueType(), updateProperty.getValue());
  }
}
 
Example 14
Source File: ODataBinderImpl.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
protected ClientProperty getODataProperty(final EdmType type, final Property resource) {
  final EdmTypeInfo typeInfo = buildTypeInfo(type == null ? null : type.getFullQualifiedName(), resource.getType());

  final ClientProperty property = new ClientPropertyImpl(resource.getName(),
      getODataValue(typeInfo == null ? null : typeInfo.getFullQualifiedName(),
          resource, null, null));
  odataAnnotations(resource, property);

  return property;
}
 
Example 15
Source File: ODataXmlSerializer.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
private void writeComplexCollection(final ServiceMetadata metadata,
    final EdmComplexType type, final Property property, final Set<List<String>> selectedPaths,
    final String xml10InvalidCharReplacement, final XMLStreamWriter writer, 
    Set<List<String>> expandedPaths, Linked linked, ExpandOption expand)
    throws XMLStreamException, SerializerException {
  EdmComplexType complexType = type;
  Set<List<String>> expandedPaths1 = expandedPaths != null && !expandedPaths.isEmpty() ? 
      expandedPaths : ExpandSelectHelper.getExpandedItemsPath(expand);
  for (Object value : property.asCollection()) {
    expandedPaths = expandedPaths1;
    writer.writeStartElement(METADATA, Constants.ELEM_ELEMENT, NS_METADATA);
    String typeName = ((ComplexValue)value).getTypeName();
    String propertyType = typeName != null ? typeName :property.getType();
    if (derivedComplexType(type, propertyType ) != null) {
      writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_TYPE, propertyType);
    }
    if(typeName!=null && !propertyType.equals(type.getFullQualifiedName().getFullQualifiedNameAsString())){
      complexType = (EdmComplexType) (metadata.getEdm().getComplexType(new FullQualifiedName(propertyType)));
    }else{
      complexType = type;
    }
    switch (property.getValueType()) {
    case COLLECTION_COMPLEX:
      expandedPaths = expandedPaths == null || expandedPaths.isEmpty() ? null :
        ExpandSelectHelper.getReducedExpandItemsPaths(expandedPaths, property.getName());
      writeComplexValue(metadata, complexType,
          ((ComplexValue) value).getValue(), selectedPaths,
          xml10InvalidCharReplacement, writer, expandedPaths, (ComplexValue) value, expand, property.getName());
      break;
    default:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    }
    writer.writeEndElement();
  }
}
 
Example 16
Source File: JsonDeltaSerializer.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
private void writePrimitiveCollection(final EdmPrimitiveType type, final Property property,
    final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
    final Boolean isUnicode, final JsonGenerator json)
    throws IOException, SerializerException {
  json.writeStartArray();
  for (Object value : property.asCollection()) {
    switch (property.getValueType()) {
    case COLLECTION_PRIMITIVE:
    case COLLECTION_ENUM:
      try {
        writePrimitiveValue(property.getName(), type, value, isNullable,
            maxLength, precision, scale, isUnicode, json);
      } catch (EdmPrimitiveTypeException e) {
        throw new SerializerException("Wrong value for property!", e,
            SerializerException.MessageKeys.WRONG_PROPERTY_VALUE,
            property.getName(), property.getValue().toString());
      }
      break;
    case COLLECTION_GEOSPATIAL:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    default:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    }
  }
  json.writeEndArray();
}
 
Example 17
Source File: JsonDeltaSerializerWithNavigations.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
private void writePrimitiveCollection(final EdmPrimitiveType type, final Property property,
    final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
    final Boolean isUnicode, final JsonGenerator json)
    throws IOException, SerializerException {
  json.writeStartArray();
  for (Object value : property.asCollection()) {
    switch (property.getValueType()) {
    case COLLECTION_PRIMITIVE:
    case COLLECTION_ENUM:
      try {
        writePrimitiveValue(property.getName(), type, value, isNullable,
            maxLength, precision, scale, isUnicode, json);
      } catch (EdmPrimitiveTypeException e) {
        throw new SerializerException("Wrong value for property!", e,
            SerializerException.MessageKeys.WRONG_PROPERTY_VALUE,
            property.getName(), property.getValue().toString());
      }
      break;
    case COLLECTION_GEOSPATIAL:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    default:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    }
  }
  json.writeEndArray();
}
 
Example 18
Source File: EdmAssistedJsonSerializer.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
protected void doSerialize(final EdmEntityType entityType, final Entity entity,
    final String contextURLString, final String metadataETag, JsonGenerator json)
    throws IOException, SerializerException {

  json.writeStartObject();

  final String typeName = entity.getType() == null ? null : new EdmTypeInfo.Builder().setTypeExpression(entity
      .getType()).build().external();
  metadata(contextURLString, metadataETag, entity.getETag(), typeName, entity.getId(), true, json);

  for (final Annotation annotation : entity.getAnnotations()) {
    valuable(json, annotation, '@' + annotation.getTerm(), null, null);
  }

  for (final Property property : entity.getProperties()) {
    final String name = property.getName();
    final EdmProperty edmProperty = entityType == null || entityType.getStructuralProperty(name) == null ? null
        : entityType.getStructuralProperty(name);
    valuable(json, property, name, edmProperty == null ? null : edmProperty.getType(), edmProperty);
  }

  if (!isODataMetadataNone &&
      entity.getEditLink() != null && entity.getEditLink().getHref() != null) {
    json.writeStringField(Constants.JSON_EDIT_LINK, entity.getEditLink().getHref());

    if (entity.isMediaEntity()) {
      json.writeStringField(Constants.JSON_MEDIA_READ_LINK, entity.getEditLink().getHref() + "/$value");
    }
  }

  links(entity, entityType, json);

  json.writeEndObject();
}
 
Example 19
Source File: ODataJsonSerializer.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
private void writeComplexCollection(final ServiceMetadata metadata, final EdmComplexType type,
    final Property property,
    final Set<List<String>> selectedPaths, final JsonGenerator json, 
    Set<List<String>> expandedPaths, Linked linked, ExpandOption expand)
    throws IOException, SerializerException {
  json.writeStartArray();
  EdmComplexType derivedType = type;
  Set<List<String>> expandedPaths1 = expandedPaths != null && !expandedPaths.isEmpty() ? 
      expandedPaths : ExpandSelectHelper.getExpandedItemsPath(expand);
  for (Object value : property.asCollection()) {
    expandedPaths = expandedPaths1;
    derivedType = ((ComplexValue) value).getTypeName()!=null ? metadata.getEdm().getComplexType
        (new FullQualifiedName(((ComplexValue) value).getTypeName())): type;          
    switch (property.getValueType()) {
    case COLLECTION_COMPLEX:
      json.writeStartObject();
      if (isODataMetadataFull || (!isODataMetadataNone && !derivedType.equals(type))) {
           json.writeStringField(constants.getType(), "#" + 
               derivedType.getFullQualifiedName().getFullQualifiedNameAsString());
      }
      expandedPaths = expandedPaths == null || expandedPaths.isEmpty() ? null :
        ExpandSelectHelper.getReducedExpandItemsPaths(expandedPaths, property.getName());
      writeComplexValue(metadata, derivedType, ((ComplexValue) value).getValue(), 
          selectedPaths, json, expandedPaths, (ComplexValue) value, expand, property.getName());
      json.writeEndObject();
      break;
    default:
      throw new SerializerException("Property type not yet supported!",
          SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
    }
  }
  json.writeEndArray();
}