public EdmStructuralTypeImplProv(final EdmImplProv edm, final ComplexType structuralType, final EdmTypeKind edmTypeKind, final String namespace) throws EdmException { super(edm, structuralType.getName()); this.structuralType = structuralType; this.namespace = namespace; this.edmTypeKind = edmTypeKind; resolveBaseType(); buildPropertiesInternal(); edmProperties = new HashMap<String, EdmTyped>(); }
public EdmStructuralTypeImplProv(final EdmImplProv edm, final ComplexType structuralType, final EdmTypeKind edmTypeKind, final String namespace) throws EdmException { super(edm, structuralType.getName()); this.structuralType = structuralType; this.namespace = namespace; this.edmTypeKind = edmTypeKind; resolveBaseType(); buildPropertiesInternal(); edmProperties = new HashMap<String, EdmTyped>(); }
public EdmStructuralTypeImplProv(final EdmImplProv edm, final ComplexType structuralType, final EdmTypeKind edmTypeKind, final String namespace) throws EdmException { super(edm, structuralType.getName()); this.structuralType = structuralType; this.namespace = namespace; this.edmTypeKind = edmTypeKind; resolveBaseType(); buildPropertiesInternal(); edmProperties = new HashMap<String, EdmTyped>(); }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { Schema schema = namespace2Schema.get(edmFQName.getNamespace()); if (schema != null) { List<ComplexType> complexTypes = schema.getComplexTypes(); for (ComplexType complexType : complexTypes) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { Schema schema = namespace2Schema.get(edmFQName.getNamespace()); if (schema != null) { List<ComplexType> complexTypes = schema.getComplexTypes(); for (ComplexType complexType : complexTypes) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { Schema schema = namespace2Schema.get(edmFQName.getNamespace()); if (schema != null) { List<ComplexType> complexTypes = schema.getComplexTypes(); for (ComplexType complexType : complexTypes) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (ComplexType complexType : schema.getComplexTypes()) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (ComplexType complexType : schema.getComplexTypes()) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (ComplexType complexType : schema.getComplexTypes()) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } } return null; }
private void includeComplexType(Schema targetSchema, IServiceInfo service, ComplexType sourceType) throws ODataException { List<ComplexType> types = targetSchema.getComplexTypes(); if (types != null) { for (ComplexType type : types) { if (type.getName().equals(sourceType.getName())) { throw new ODataException("complex type " + sourceType.getName() + " already defined"); } } } else { types = new ArrayList<ComplexType>(); } ComplexType newType = clone(sourceType); if (newType.getProperties() != null) { for (Property property : newType.getProperties()) { if (property instanceof ComplexProperty) { ((ComplexProperty) property).setType(new FullQualifiedName( targetSchema.getNamespace(), ((ComplexProperty) property).getType().getName())); } } } types.add(newType); targetSchema.setComplexTypes(types); }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { List<Schema> schemas = getSchemas(); if (schemas == null) { return null; } for (Schema schema : schemas) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { List<ComplexType> types = schema.getComplexTypes(); if (types == null) { return null; } for (ComplexType type : types) { if (type.getName().equals(edmFQName.getName())) { return type; } } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { if (edmFQName != null) { if (complexTypes.containsKey(edmFQName.toString())) { return complexTypes.get(edmFQName.toString()); } else if (schemas == null) { getSchemas(); } for (Schema schema : schemas) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { if (schema.getComplexTypes() == null) { return null; } for (ComplexType ct : schema.getComplexTypes()) { if (ct.getName().equals(edmFQName.getName())) { complexTypes.put(edmFQName.toString(), ct); return ct; } } } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { if (edmFQName != null) { if (complexTypes.containsKey(edmFQName.toString())) { return complexTypes.get(edmFQName.toString()); } else if (schemas == null) { getSchemas(); } for (Schema schema : schemas) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { if (schema.getComplexTypes() == null) { return null; } for (ComplexType ct : schema.getComplexTypes()) { if (ct.getName().equals(edmFQName.getName())) { complexTypes.put(edmFQName.toString(), ct); return ct; } } } } } return null; }
ComplexProperty cProp = (ComplexProperty)prop; for(ComplexType eCompType : eCompTypes){ if((cProp.getType().getName()).equals(eCompType.getName())){ List<Property> compPropList = eCompType.getProperties(); for(Property compProp : compPropList){
private ComplexType clone(ComplexType type) { if (type == null) { return null; } ComplexType newType = new ComplexType(); newType.setAbstract(type.isAbstract()); newType.setAnnotationAttributes(type.getAnnotationAttributes()); newType.setAnnotationElements(type.getAnnotationElements()); newType.setBaseType(type.getBaseType()); newType.setDocumentation(type.getDocumentation()); newType.setMapping(type.getMapping()); newType.setName(type.getName()); newType.setProperties(cloneProperties(type.getProperties())); return newType; }