Java Code Examples for org.apache.olingo.commons.api.data.ValueType#COMPLEX
The following examples show how to use
org.apache.olingo.commons.api.data.ValueType#COMPLEX .
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: ODataXmlDeserializer.java From olingo-odata4 with Apache License 2.0 | 5 votes |
private ValueType getValueType(final EdmType edmType, final boolean isCollection) { if (edmType instanceof EdmPrimitiveType) { if (edmType instanceof EdmEnumType) { return isCollection ? ValueType.COLLECTION_ENUM : ValueType.ENUM; } else { return isCollection ? ValueType.COLLECTION_PRIMITIVE : ValueType.PRIMITIVE; } } else if (edmType instanceof EdmComplexType) { return isCollection ? ValueType.COLLECTION_COMPLEX : ValueType.COMPLEX; } else { return ValueType.PRIMITIVE; } }
Example 2
Source File: ResponseUtil.java From olingo-odata4 with Apache License 2.0 | 5 votes |
public static Property createComplex(final String name, final String type, final Property... properties) { ComplexValue complexValue = new ComplexValue(); for (final Property property : properties) { complexValue.getValue().add(property); } return new Property(type, name, ValueType.COMPLEX, complexValue); }
Example 3
Source File: DataProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
private Property createAddress(final String street, final String city, final String zipCode, final String country) { ComplexValue complexValue=new ComplexValue(); List<Property> addressProperties = complexValue.getValue(); addressProperties.add(createPrimitive("Street", street)); addressProperties.add(createPrimitive("City", city)); addressProperties.add(createPrimitive("ZipCode", zipCode)); addressProperties.add(createPrimitive("Country", country)); return new Property(null, "Address", ValueType.COMPLEX, complexValue); }