@Override public String getSegmentValue() { return property.getName(); } }
@Override public String getSegmentValue() { return property.getName(); } }
@Override public String getSegmentValue() { return property.getName(); } }
@Override public String getSegmentValue() { return property.getName(); } }
public DynamicStructuredType addProperty(final EdmProperty property) { if (properties == null) { properties = new LinkedHashMap<String, EdmProperty>(); } properties.put(property.getName(), property); return this; }
public DynamicStructuredType addProperty(final EdmProperty property) { if (properties == null) { properties = new LinkedHashMap<String, EdmProperty>(); } properties.put(property.getName(), property); return this; }
private static List<String> getPropertyPath(final List<UriResource> path) { List<String> result = new LinkedList<String>(); int index = 1; while (index < path.size() && path.get(index) instanceof UriResourceProperty) { result.add(((UriResourceProperty) path.get(index)).getProperty().getName()); index++; } return result; }
private static List<String> getPropertyPath(final List<UriResource> path) { List<String> result = new LinkedList<String>(); int index = 1; while (index < path.size() && path.get(index) instanceof UriResourceProperty) { result.add(((UriResourceProperty) path.get(index)).getProperty().getName()); index++; } return result; }
private static List<String> getPropertyPath(final List<UriResource> path) { List<String> result = new LinkedList<String>(); int index = 1; while (index < path.size() && path.get(index) instanceof UriResourceProperty) { result.add(((UriResourceProperty) path.get(index)).getProperty().getName()); index++; } return result; }
private static List<String> getPropertyPath(final List<UriResource> path) { List<String> result = new LinkedList<String>(); int index = 1; while (index < path.size() && path.get(index) instanceof UriResourceProperty) { result.add(((UriResourceProperty) path.get(index)).getProperty().getName()); index++; } return result; }
protected void writeProperty(final ServiceMetadata metadata, final EdmProperty edmProperty, final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) throws IOException, SerializerException { boolean isStreamProperty = isStreamProperty(edmProperty); if (property != null) { if (!isStreamProperty) { json.writeFieldName(edmProperty.getName()); } writePropertyValue(metadata, edmProperty, property, selectedPaths, json); } }
protected void writeProperty(final ServiceMetadata metadata, final EdmProperty edmProperty, final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) throws IOException, SerializerException { boolean isStreamProperty = isStreamProperty(edmProperty); if (property != null) { if (!isStreamProperty) { json.writeFieldName(edmProperty.getName()); } writePropertyValue(metadata, edmProperty, property, selectedPaths, json); } }
protected void writeProperty(final ServiceMetadata metadata, final EdmProperty edmProperty, final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) throws IOException, SerializerException { boolean isStreamProperty = isStreamProperty(edmProperty); if (property != null) { if (!isStreamProperty) { json.writeFieldName(edmProperty.getName()); } writePropertyValue(metadata, edmProperty, property, selectedPaths, json); } }
protected void writeProperty(final ServiceMetadata metadata, final EdmProperty edmProperty, final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) throws IOException, SerializerException { boolean isStreamProperty = isStreamProperty(edmProperty); if (property != null) { if (!isStreamProperty) { json.writeFieldName(edmProperty.getName()); } writePropertyValue(metadata, edmProperty, property, selectedPaths, json); } }
@Override public final Object readPrimitiveValue(UriInfo uriInfo,ODataRequest request,ODataResponse response) throws ODataApplicationException { ReadEntityResultType entity = readEntity(uriInfo, request, response, false); List<UriResource> resourceParts = uriInfo.getUriResourceParts(); UriResourceProperty uriProperty = (UriResourceProperty) resourceParts.get(resourceParts.size() -2); Object propValue = entity.getEntity().getProperty(uriProperty.getProperty().getName()).getValue(); if(propValue!=null && propValue instanceof byte[]){ return new String((byte[])propValue); } return propValue; }
@Override public void visit(StreamResponse response) throws ODataApplicationException { EdmProperty edmProperty = request.getUriResourceProperty().getProperty(); Property property = details.entity.getProperty(edmProperty.getName()); response.writeStreamResponse(new ByteArrayInputStream((byte[]) (property.getValue())), ContentType.APPLICATION_OCTET_STREAM); }
@Override public void visit(UriResourcePrimitiveProperty info) { String propertyName = info.getProperty().getName(); ElementSymbol es = new ElementSymbol(propertyName, this.context.getGroupSymbol()); this.context.addProjectedColumn(propertyName, es); this.selectionComplete = true; }
public void visit(PropertyResponse response) throws ODataLibraryException, ODataApplicationException { EntityCollection entitySet = (EntityCollection)queryResponse; if (!entitySet.getEntities().isEmpty()) { Entity entity = entitySet.getEntities().get(0); EdmProperty edmProperty = request.getUriResourceProperty().getProperty(); Property property = entity.getProperty(edmProperty.getName()); response.writeProperty(edmProperty.getType(), property); } else { response.writeNotFound(true); } }
@Override public void visit(PropertyResponse response) throws ODataApplicationException, SerializerException { EdmProperty edmProperty = request.getUriResourceProperty().getProperty(); Property property = details.entity.getProperty(edmProperty.getName()); response.writeProperty(edmProperty.getType(), property); }
@Override public void visit(PrimitiveValueResponse response) throws ODataApplicationException, SerializerException { EdmProperty edmProperty = request.getUriResourceProperty().getProperty(); Property property = details.entity.getProperty(edmProperty.getName()); response.write(property.getValue()); }