@Override public SerializerResult complexCollection(final ServiceMetadata metadata, final EdmComplexType type, final Property property, final ComplexSerializerOptions options) throws SerializerException { final ContextURL contextURL = checkContextURL(options == null ? null : options.getContextURL()); writeMetadataETag(metadata, writer); Set<List<String>> selectedPaths = null; if (null != options && null != options.getSelect()) { final boolean all = ExpandSelectHelper.isAll(options.getSelect()); selectedPaths = all || property.isPrimitive() ? null : ExpandSelectHelper .getSelectedPaths(options.getSelect().getSelectItems()); if (null != options && null != options.getExpand()) { expandPaths = ExpandSelectHelper.getExpandedItemsPath(options.getExpand()); options == null ? null:options.xml10InvalidCharReplacement(), writer, expandPaths, null, options == null ? null : options.getExpand()); writer.writeEndElement(); writer.writeEndDocument();
private Builder() { options = new ComplexSerializerOptions(); }
SerializerException cachedException = null; try { final ContextURL contextURL = checkContextURL(options == null ? null : options.getContextURL()); CircleStreamBuffer buffer = new CircleStreamBuffer(); outputStream = buffer.getOutputStream(); json.writeFieldName(Constants.VALUE); Set<List<String>> selectedPaths = null; if (null != options && null != options.getSelect()) { final boolean all = ExpandSelectHelper.isAll(options.getSelect()); selectedPaths = all || property.isPrimitive() ? null : ExpandSelectHelper .getSelectedPaths(options.getSelect().getSelectItems()); if (null != options && null != options.getExpand()) { expandPaths = ExpandSelectHelper.getExpandedItemsPath(options.getExpand()); options == null ? null : options.getExpand()); json.writeEndObject();
@Override public SerializerResult serialize(Annotatable result, EdmType complexType) throws SerializerException, ODataJPASerializerException { final ContextURL contextUrl = ContextURL.with().build(); final ComplexSerializerOptions options = ComplexSerializerOptions.with().contextURL(contextUrl).build(); return serializer.complex(serviceMetadata, (EdmComplexType) complexType, (Property) result, options); }
? this.complexOptions.getContextURL() : this.primitiveOptions.getContextURL(); EdmAction action = this.metadata.getEdm().getBoundActionWithBindingType(
SerializerException cachedException = null; try { final ContextURL contextURL = checkContextURL(options == null ? null : options.getContextURL()); CircleStreamBuffer buffer = new CircleStreamBuffer(); outputStream = buffer.getOutputStream(); json.writeFieldName(Constants.VALUE); Set<List<String>> selectedPaths = null; if (null != options && null != options.getSelect()) { final boolean all = ExpandSelectHelper.isAll(options.getSelect()); selectedPaths = all || property.isPrimitive() ? null : ExpandSelectHelper .getSelectedPaths(options.getSelect().getSelectItems()); if (null != options && null != options.getExpand()) { expandPaths = ExpandSelectHelper.getExpandedItemsPath(options.getExpand()); options == null ? null : options.getExpand()); json.writeEndObject();
@Override public SerializerResult serialize(Annotatable result, EdmType complexType) throws SerializerException, ODataJPASerializerException { final ContextURL contextUrl = ContextURL.with().asCollection().build(); final ComplexSerializerOptions options = ComplexSerializerOptions.with().contextURL(contextUrl).build(); return serializer.complexCollection(serviceMetadata, (EdmComplexType) complexType, (Property) result, options); }
? this.complexOptions.getContextURL() : this.primitiveOptions.getContextURL(); EdmAction action = this.metadata.getEdm().getBoundActionWithBindingType(
@Override public SerializerResult complexCollection(final ServiceMetadata metadata, final EdmComplexType type, final Property property, final ComplexSerializerOptions options) throws SerializerException { final ContextURL contextURL = checkContextURL(options == null ? null : options.getContextURL()); writeMetadataETag(metadata, writer); Set<List<String>> selectedPaths = null; if (null != options && null != options.getSelect()) { final boolean all = ExpandSelectHelper.isAll(options.getSelect()); selectedPaths = all || property.isPrimitive() ? null : ExpandSelectHelper .getSelectedPaths(options.getSelect().getSelectItems()); if (null != options && null != options.getExpand()) { expandPaths = ExpandSelectHelper.getExpandedItemsPath(options.getExpand()); options == null ? null:options.xml10InvalidCharReplacement(), writer, expandPaths, null, options == null ? null : options.getExpand()); writer.writeEndElement(); writer.writeEndDocument();
SerializerException cachedException = null; try { final ContextURL contextURL = checkContextURL(options == null ? null : options.getContextURL()); final String name = contextURL == null ? null: contextURL.getEntitySetOrSingletonOrType(); final List<Property> values = property.isNull() ? Collections.<Property> emptyList() : property.asComplex().getValue(); writeProperties(metadata, type, values, options == null ? null : options == null ? null : options.getSelect(), json, property.asComplex(), options == null ? null : options.getExpand()); if (!property.isNull() && property.isComplex()) { writeNavigationProperties(metadata, type, property.asComplex(), options == null ? null : options.getExpand(), null, null, name, json);
@Override public SerializerResult serialize(final ODataRequest request, final EntityCollection result) throws SerializerException { final EdmEntitySet targetEdmEntitySet = Util.determineTargetEntitySet(uriInfo.getUriResourceParts()); final List<UriResource> resourceParts = uriInfo.getUriResourceParts(); final UriResourceProperty uriProperty = (UriResourceProperty) resourceParts.get(resourceParts.size() - 1); final EdmComplexType edmPropertyType = (EdmComplexType) uriProperty.getProperty().getType(); final String selectList = uriHelper.buildContextURLSelectList(targetEdmEntitySet.getEntityType(), uriInfo.getExpandOption(), uriInfo.getSelectOption()); final ContextURL contextUrl = ContextURL.with() .entitySet(targetEdmEntitySet) .navOrPropertyPath(Util.determineProptertyNavigationPath(uriInfo.getUriResourceParts())) .selectList(selectList) .build(); final ComplexSerializerOptions options = ComplexSerializerOptions.with() .contextURL(contextUrl) .select(uriInfo.getSelectOption()) .expand(uriInfo.getExpandOption()) .build(); if (uriProperty.getProperty().isCollection()) { return serializer.complexCollection(serviceMetadata, edmPropertyType, determineProperty(targetEdmEntitySet, result), options); } else { return serializer.complex(serviceMetadata, edmPropertyType, determineProperty(targetEdmEntitySet, result), options); } }
private Builder() { options = new ComplexSerializerOptions(); }
@Override public SerializerResult complex(final ServiceMetadata metadata, final EdmComplexType type, final Property property, final ComplexSerializerOptions options) throws SerializerException { final ContextURL contextURL = checkContextURL(options == null ? null : options.getContextURL()); final List<Property> values = property.asComplex().getValue(); writeProperties(metadata, resolvedType, values, options == null ? null : options.getSelect(), options == null ? null : options.xml10InvalidCharReplacement(), writer, property.asComplex(), options == null ? null : options.getExpand());
SerializerException cachedException = null; try { final ContextURL contextURL = checkContextURL(options == null ? null : options.getContextURL()); final String name = contextURL == null ? null: contextURL.getEntitySetOrSingletonOrType(); final List<Property> values = property.isNull() ? Collections.<Property> emptyList() : property.asComplex().getValue(); writeProperties(metadata, type, values, options == null ? null : options == null ? null : options.getSelect(), json, property.asComplex(), options == null ? null : options.getExpand()); if (!property.isNull() && property.isComplex()) { writeNavigationProperties(metadata, type, property.asComplex(), options == null ? null : options.getExpand(), null, null, name, json);
.build(); } else if (serilizerOptions.isAssignableFrom(ComplexSerializerOptions.class)) { return (T) ComplexSerializerOptions.with().contextURL(contextUrl) .expand(this.uriInfo.getExpandOption()).select(this.uriInfo.getSelectOption()) .xml10InvalidCharReplacement(xmlReplacement)
@Override public SerializerResult complex(final ServiceMetadata metadata, final EdmComplexType type, final Property property, final ComplexSerializerOptions options) throws SerializerException { final ContextURL contextURL = checkContextURL(options == null ? null : options.getContextURL()); final List<Property> values = property.asComplex().getValue(); writeProperties(metadata, resolvedType, values, options == null ? null : options.getSelect(), options == null ? null : options.xml10InvalidCharReplacement(), writer, property.asComplex(), options == null ? null : options.getExpand());
.build(); } else if (serilizerOptions.isAssignableFrom(ComplexSerializerOptions.class)) { return (T) ComplexSerializerOptions.with().contextURL(contextUrl) .expand(this.uriInfo.getExpandOption()).select(this.uriInfo.getSelectOption()) .xml10InvalidCharReplacement(xmlReplacement)