Examples of ComplexType


Examples of com.volantis.mcs.build.parser.ComplexType

     * @param out  the output stream
     */
    private void writeHasMixedContentMethod(
            ElementInfo info,
            PrintStream out) {
        ComplexType complexType = info.getComplexType();
        boolean mixed = (complexType != null && complexType.isMixed());
        if (!mixed) {
            out.println();
            out.println("  // Javadoc inherited from super class.");
            out.println("  boolean hasMixedContent() {");
            out.println("    return false;");
View Full Code Here

Examples of com.volantis.mcs.build.parser.ComplexType

        out.close();
    }

    private boolean isElementEmpty(ElementInfo info) {

        ComplexType complexType = info.getComplexType();

        // can only be non-empty if type is not mixed
        // always false if region tag
        boolean empty;
        boolean mixed;
        if (complexType == null) {
            empty = true;
            mixed = false;
        } else {
            mixed = complexType.isMixed();
            if ("region".equals(info.getName())) {
                empty = false;
            } else {
                empty = complexType.isEmpty() && !mixed;
            }
        }

        return empty;
    }
View Full Code Here

Examples of com.volantis.mcs.build.parser.ComplexType

        marlinElementList.add(info.getName());

        AttributesStructureInfo attributesStructureInfo
                = info.getAttributesStructureInfo();

        ComplexType complexType = info.getComplexType();

        // can only be non-empty if type is not mixed
        // always false if region tag
        boolean mixed = (complexType != null && complexType.isMixed());

        String className = info.getMarlinElementClass();
        className = info.getPrefix() + "ElementHandler";
        String papiElement = info.getAPIElementClass();
        String papiAttributes = info.getAPIAttributesClass();
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexType

    Schema edmSchema = view.getEdmSchema();
    edmSchema.getComplexTypes().add(getComplexType());
  }

  private ComplexType getComplexType() {
    ComplexType complexType = new ComplexType();

    List<Property> properties = new ArrayList<Property>();
    SimpleProperty property = new SimpleProperty();

    property.setName("Amount");
    property.setType(EdmSimpleTypeKind.Double);
    properties.add(property);

    property = new SimpleProperty();
    property.setName("Currency");
    property.setType(EdmSimpleTypeKind.String);
    properties.add(property);

    complexType.setName("OrderValue");
    complexType.setProperties(properties);

    return complexType;

  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexType

    if (edmComplexTypeName == null) {
      edmComplexTypeName = jpaEmbeddableTypeName;
    }

    view.getEdmComplexType().setName(edmComplexTypeName);
    ComplexType complexType = view.getEdmComplexType();
    complexType.setName(edmComplexTypeName);
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAType(view.getJPAEmbeddableType().getJavaType());
    complexType.setMapping((Mapping) mapping);

  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexType

          functionReturnType.setTypeName(edmSimpleTypeKind.getFullQualifiedName());

          break;
        case COMPLEX:
          String embeddableTypeName = null;
          ComplexType complexType = null;
          boolean exists = false;

          if (returnType.isCollection() == false) {
            embeddableTypeName = methodReturnType.getName();
          } else {
            embeddableTypeName = getReturnTypeName(method);
          }

          complexType = jpaEdmComplexTypeView.searchEdmComplexType(embeddableTypeName);

          if (complexType == null) {// This could occure of non JPA Embeddable Types : Extension Scenario
            List<ComplexType> complexTypeList = schemaView.getEdmSchema().getComplexTypes();
            String[] complexTypeNameParts = embeddableTypeName.split("\\.");
            String complexTypeName = complexTypeNameParts[complexTypeNameParts.length - 1];
            for (ComplexType complexType1 : complexTypeList) {
              if (complexType1.getName().equals(complexTypeName)) {
                complexType = complexType1;
                exists = true;
                break;
              }
            }
            if (exists == false) {
              throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_ENTITY_NOT_FOUND
                  .addContent(method.getDeclaringClass(), method.getName(), methodReturnType.getSimpleName()), null);
            }
          }
          functionReturnType.setTypeName(JPAEdmNameBuilder.build(schemaView, complexType.getName()));
          break;
        default:
          break;
        }
        functionImport.setReturnType(functionReturnType);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexType

            }
            keyViewBuilder.build();
          }
          break;
        case EMBEDDED:
          ComplexType complexType = complexTypeView
              .searchEdmComplexType(currentAttribute.getJavaType().getName());

          if (complexType == null) {
            JPAEdmComplexTypeView complexTypeViewLocal = new JPAEdmComplexType(
                schemaView, currentAttribute);
            complexTypeViewLocal.getBuilder().build();
            complexType = complexTypeViewLocal.getEdmComplexType();
            complexTypeView.addJPAEdmCompleTypeView(complexTypeViewLocal);
          }

          if (isBuildModeComplexType == false
              && entityTypeView.getJPAEntityType().getIdType()
                  .getJavaType()
                  .equals(currentAttribute.getJavaType())) {

            if (keyView == null) {
              keyView = new JPAEdmKey(complexTypeView,
                  JPAEdmProperty.this);
            }
            keyView.getBuilder().build();
            complexTypeView.expandEdmComplexType(complexType, properties, currentAttribute.getName());
          } else {
            currentComplexProperty = new ComplexProperty();
            if (isBuildModeComplexType) {
              JPAEdmNameBuilder
                  .build((JPAEdmComplexPropertyView) JPAEdmProperty.this,
                      complexTypeView.getJPAEmbeddableType().getJavaType().getSimpleName());
            } else {
              JPAEdmNameBuilder
                  .build((JPAEdmComplexPropertyView) JPAEdmProperty.this,
                      JPAEdmProperty.this, skipDefaultNaming);
            }
            currentComplexProperty.setType(new FullQualifiedName(
                schemaView.getEdmSchema().getNamespace(),
                complexType.getName()));

            properties.add(currentComplexProperty);
            if (!complexTypeView.isReferencedInKey(currentComplexProperty.getType().getName()))
            {
              complexTypeView.setReferencedInKey(currentComplexProperty.getType().getName());
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexType

    if (NAMESPACE_1.equals(edmFQName.getNamespace())) {
      if (COMPLEX_TYPE_1.getName().equals(edmFQName.getName())) {
        final List<Property> properties = new ArrayList<Property>();
        properties.add(new ComplexProperty().setName("City").setType(COMPLEX_TYPE_2));
        properties.add(new SimpleProperty().setName("Country").setType(EdmSimpleTypeKind.String));
        return new ComplexType().setName(COMPLEX_TYPE_1.getName()).setProperties(properties);

      } else if (COMPLEX_TYPE_2.getName().equals(edmFQName.getName())) {
        final List<Property> properties = new ArrayList<Property>();
        properties.add(new SimpleProperty().setName("PostalCode").setType(EdmSimpleTypeKind.String));
        properties.add(new SimpleProperty().setName("CityName").setType(EdmSimpleTypeKind.String));
        return new ComplexType().setName(COMPLEX_TYPE_2.getName()).setProperties(properties);
      }
    }

    return null;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexType

    Facets facets2 = new Facets().setNullable(true);
    SimpleProperty propertySimpleWithFacets2 =
        new SimpleProperty().setName("PropertyName").setType(EdmSimpleTypeKind.String).setFacets(facets2);
    propertySimpleWithFacetsProvider2 = new EdmSimplePropertyImplProv(edmImplProv, propertySimpleWithFacets2);

    ComplexType complexType = new ComplexType().setName("complexType");
    FullQualifiedName complexName = new FullQualifiedName("namespace", "complexType");
    when(edmProvider.getComplexType(complexName)).thenReturn(complexType);

    ComplexProperty propertyComplex = new ComplexProperty().setName("complexProperty").setType(complexName);
    propertyComplexProvider = new EdmComplexPropertyImplProv(edmImplProv, propertyComplex);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexType

      this.isAbstract = isAbstract;
      return this;
    }

    public ComplexType buildComplexType() {
      ComplexType complexType = new ComplexType();
      if (baseEntityType != null) {
        complexType.setBaseType(baseEntityType);
      }
      return complexType.setName(name).setProperties(properties);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.