public static void addProperties( final EdmEnabledODataClient client, final Map<String, Object> changes, final ClientComplexValue entity) { for (Map.Entry<String, Object> entry : changes.entrySet()) { entity.add(getODataComplexProperty( client, new FullQualifiedName(entity.getTypeName()), entry.getKey(), entry.getValue())); } }
@Override public Map<String, Object> asJavaMap() { final Map<String, Object> result = new LinkedHashMap<String, Object>(); for (Map.Entry<String, ClientProperty> entry : fields.entrySet()) { Object value = null; if (entry.getValue().hasPrimitiveValue()) { value = entry.getValue().getPrimitiveValue().toValue(); } else if (entry.getValue().hasComplexValue()) { value = entry.getValue().getComplexValue().asJavaMap(); } else if (entry.getValue().hasCollectionValue()) { value = entry.getValue().getCollectionValue().asJavaCollection(); } else if (entry.getValue().hasEnumValue()) { value = entry.getValue().getEnumValue().toString(); } result.put(entry.getKey(), value); } return result; }
@Override protected ClientProperty getInternalProperty(final String name) { return getComplex() == null ? null : getComplex().get(name); } }
private OperationInvocationHandler(final ComplexInvocationHandler complexHandler) { super(complexHandler.service); this.target = complexHandler; this.targetFQN = new FullQualifiedName(complexHandler.getComplex().getTypeName()); }
.entrySet()) { try { value.asComplex().add(getODataComplexProperty( client, type.getFullQualifiedName(), changes.getKey(), changes.getValue())); } catch (Exception ignore) {
private List<ClientAnnotation> internalAnnotations() { List<ClientAnnotation> result = Collections.<ClientAnnotation> emptyList(); if (targetHandler.getInternal() instanceof ClientEntity) { result = propName == null ? ((ClientEntity) targetHandler.getInternal()).getNavigationLink(navPropName).getAnnotations() : ((ClientEntity) targetHandler.getInternal()).getProperty(propName).getAnnotations(); } else if (targetHandler.getInternal() instanceof ClientComplexValue) { result = propName == null ? ((ClientComplexValue) targetHandler.getInternal()).getNavigationLink(navPropName).getAnnotations() : ((ClientComplexValue) targetHandler.getInternal()).get(propName).getAnnotations(); } return result; }
ComplexInvocationHandler.getInstance(typeHandler, getter.getReturnType())); populate(client, typeHandler, complex, Property.class, property.getValue().asComplex().iterator()); setPropertyValue(bean, getter, complex); } else if (property.hasCollectionValue()) { ComplexInvocationHandler.getInstance(typeHandler, collItemClass)); populate(client, typeHandler, collItem, Property.class, value.asComplex().iterator()); collection.add(collItem);
private OperationInvocationHandler(final ComplexInvocationHandler complexHandler) { super(complexHandler.service); this.target = complexHandler; this.targetFQN = new FullQualifiedName(complexHandler.getComplex().getTypeName()); }
.entrySet()) { try { value.asComplex().add(getODataComplexProperty( client, type.getFullQualifiedName(), changes.getKey(), changes.getValue())); } catch (Exception ignore) {
private List<ClientAnnotation> internalAnnotations() { List<ClientAnnotation> result = Collections.<ClientAnnotation> emptyList(); if (targetHandler.getInternal() instanceof ClientEntity) { result = propName == null ? ((ClientEntity) targetHandler.getInternal()).getNavigationLink(navPropName).getAnnotations() : ((ClientEntity) targetHandler.getInternal()).getProperty(propName).getAnnotations(); } else if (targetHandler.getInternal() instanceof ClientComplexValue) { result = propName == null ? ((ClientComplexValue) targetHandler.getInternal()).getNavigationLink(navPropName).getAnnotations() : ((ClientComplexValue) targetHandler.getInternal()).get(propName).getAnnotations(); } return result; }
ComplexInvocationHandler.getInstance(typeHandler, getter.getReturnType())); populate(client, typeHandler, complex, Property.class, property.getValue().asComplex().iterator()); setPropertyValue(bean, getter, complex); } else if (property.hasCollectionValue()) { ComplexInvocationHandler.getInstance(typeHandler, collItemClass)); populate(client, typeHandler, collItem, Property.class, value.asComplex().iterator()); collection.add(collItem);
public static void addProperties( final EdmEnabledODataClient client, final Map<String, Object> changes, final ClientComplexValue entity) { for (Map.Entry<String, Object> entry : changes.entrySet()) { entity.add(getODataComplexProperty( client, new FullQualifiedName(entity.getTypeName()), entry.getKey(), entry.getValue())); } }
protected Object getValue(final ClientValue value) { Object valueResource = null; if (value == null) { return null; } if (value.isEnum()) { valueResource = value.asEnum().getValue(); } else if (value.isPrimitive()) { valueResource = value.asPrimitive().toValue(); } else if (value.isComplex()) { List<Property> complexProperties = new ArrayList<Property>(); for (final ClientProperty propertyValue : value.asComplex()) { complexProperties.add(getProperty(propertyValue)); } final ComplexValue lcValueResource = new ComplexValue(); lcValueResource.getValue().addAll(complexProperties); annotations(value.asComplex(), lcValueResource); links(value.asComplex(), lcValueResource); lcValueResource.setTypeName(value.asComplex().getTypeName()); valueResource = lcValueResource; } else if (value.isCollection()) { final ClientCollectionValue<? extends ClientValue> _value = value.asCollection(); ArrayList<Object> lcValueResource = new ArrayList<Object>(); for (final ClientValue collectionValue : _value) { lcValueResource.add(getValue(collectionValue)); } valueResource = lcValueResource; } return valueResource; }
@Override public Map<String, Object> asJavaMap() { final Map<String, Object> result = new LinkedHashMap<String, Object>(); for (Map.Entry<String, ClientProperty> entry : fields.entrySet()) { Object value = null; if (entry.getValue().hasPrimitiveValue()) { value = entry.getValue().getPrimitiveValue().toValue(); } else if (entry.getValue().hasComplexValue()) { value = entry.getValue().getComplexValue().asJavaMap(); } else if (entry.getValue().hasCollectionValue()) { value = entry.getValue().getCollectionValue().asJavaCollection(); } else if (entry.getValue().hasEnumValue()) { value = entry.getValue().getEnumValue().toString(); } result.put(entry.getKey(), value); } return result; }
@Override protected ClientProperty getInternalProperty(final String name) { return getComplex() == null ? null : getComplex().get(name); } }
protected Object getValue(final ClientValue value) { Object valueResource = null; if (value == null) { return null; } if (value.isEnum()) { valueResource = value.asEnum().getValue(); } else if (value.isPrimitive()) { valueResource = value.asPrimitive().toValue(); } else if (value.isComplex()) { List<Property> complexProperties = new ArrayList<Property>(); for (final ClientProperty propertyValue : value.asComplex()) { complexProperties.add(getProperty(propertyValue)); } final ComplexValue lcValueResource = new ComplexValue(); lcValueResource.getValue().addAll(complexProperties); annotations(value.asComplex(), lcValueResource); links(value.asComplex(), lcValueResource); lcValueResource.setTypeName(value.asComplex().getTypeName()); valueResource = lcValueResource; } else if (value.isCollection()) { final ClientCollectionValue<? extends ClientValue> _value = value.asCollection(); ArrayList<Object> lcValueResource = new ArrayList<Object>(); for (final ClientValue collectionValue : _value) { lcValueResource.add(getValue(collectionValue)); } valueResource = lcValueResource; } return valueResource; }
value = param.getValue().asPrimitive().toValue(); } else if (param.getValue().isComplex()) { value = param.getValue().asComplex().asJavaMap(); } else if (param.getValue().isCollection()) { value = param.getValue().asCollection().asJavaCollection();
propertyResource.setValue(ValueType.ENUM, propertyValue); } else if (odataValuable.hasComplexValue()) { propertyResource.setType(odataValuable.getComplexValue().getTypeName()); propertyResource.setValue(ValueType.COMPLEX, propertyValue); } else if (odataValuable.hasCollectionValue()) {