Examples of XSComplexTypeDefinition


Examples of org.apache.xerces.xs.XSComplexTypeDefinition

         "  </xsd:complexType>" +
         "</xsd:schema>";

      XSModel model = Util.loadSchema(xsd, (String)null);

      XSComplexTypeDefinition type = (XSComplexTypeDefinition)model.getTypeDefinition("valueType", "");
      XSModelGroup modelGroup = (XSModelGroup)type.getParticle().getTerm();
      assertNull(modelGroup.getAnnotation());

      type = (XSComplexTypeDefinition)model.getTypeDefinition("annotatedValueType", "");
      modelGroup = (XSModelGroup)type.getParticle().getTerm();
      assertNull(modelGroup.getAnnotation());
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

         XSTypeDefinition type = (XSTypeDefinition)types.item(i);
         if(!Constants.NS_XML_SCHEMA.equals(type.getNamespace()))
         {
            if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
            {
               XSComplexTypeDefinition typeDef = (XSComplexTypeDefinition) type;
               XSObjectList annotations = typeDef.getAnnotations();
               assertEquals(1, annotations.getLength());
            }
         }
      }
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

      if (xt instanceof XSComplexTypeDefinition == false)
         throw new WSException("Tried to unwrap a non-complex type.");

      List<MethodParamPartsMapping> partsMappings = new ArrayList<MethodParamPartsMapping>();

      XSComplexTypeDefinition wrapper = (XSComplexTypeDefinition)xt;

      if (wrapper.getAttributeUses().getLength() > 0)
         return false;

      boolean unwrappedElement = false;

      XSParticle particle = wrapper.getParticle();
      if (particle == null)
      {
         return true;
      }
      else
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

      JavaXmlTypeMapping jxtm = null;

      if (xt instanceof XSComplexTypeDefinition)
      {
         XSModelGroup xm = null;
         XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xt;
         XSTypeDefinition baseType = xc.getBaseType();
         short der = xc.getDerivationMethod();

         if ((baseType != null) && !utils.isBaseTypeIgnorable(baseType, xc))
         {
               addJavaXMLTypeMap(baseType, baseType.getName(), "", "", jwm, skipWrapperArray); //Recurse for base types
         }

         // handleContentTypeElementsWithDerivationNone
         if (xc.getContentType() != XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
         {
            XSParticle xp = xc.getParticle();
            if (xp != null)
            {
               XSTerm xterm = xp.getTerm();
               if (xterm instanceof XSModelGroup)
                  xm = (XSModelGroup)xterm;
            }
         }

         if ((skipWrapperArray && SchemaUtils.isWrapperArrayType(xt)) == false)
         {
            jxtm = new JavaXmlTypeMapping(jwm);
            String javaType;
            String localName = xt.getName();

            // Anonymous
            if (localName == null)
            {
               String tempName = containingElement + ToolsUtils.firstLetterUpperCase(name);
               javaType = getJavaTypeAsString(null, new QName(tempName), xt.getNamespace(), false, true);
               StringBuilder temp = new StringBuilder();
               if (containingType != null && containingType.length() > 0)
                  temp.append(">").append(containingType);
               temp.append(">").append(name);
               localName = temp.toString();
               jxtm.setAnonymousTypeQName(new QName(xt.getNamespace(), localName, "typeNS"));
            }
            else
            {
               javaType = getJavaTypeAsString(null, new QName(localName), xt.getNamespace(), false, true);
               jxtm.setRootTypeQName(new QName(xt.getNamespace(), xt.getName(), "typeNS"));
            }

            if (typeNamespace == null)
            {
               typeNamespace = xt.getNamespace();
            }

            if (registeredTypes.contains(javaType))
               return;

            jxtm.setJavaType(javaType);
            jxtm.setQNameScope("complexType");

            registeredTypes.add(javaType);
            jwm.addJavaXmlTypeMappings(jxtm);
            // addJavaXMLTypeMapping(jwm, jxtm

            if (xm != null)
            {
               addVariableMappingMap(xm, jxtm, javaType);
            }

            // Add simple content if it exists
            XSSimpleTypeDefinition simple = xc.getSimpleType();
            if (simple != null)
            {
               addJavaXMLTypeMap(simple, xc.getName(), "", "", jwm, skipWrapperArray);
            }

            // Add attributes
            XSObjectList attributeUses = ((XSComplexTypeDefinition)xc).getAttributeUses();
            if (attributeUses != null)
               addAttributeMappings(attributeUses, jxtm);
         }

         if (xm != null)
            addGroup(xm, name, xc.getName(), jwm);
      }

      // Add enum simpleType support
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

        }

        getElementStack().push(element);

        XSTypeDefinition typeDefinition = element.getTypeDefinition();
        XSComplexTypeDefinition complexTypeDefi = Util.getComplexType(typeDefinition);
        List<XSAttributeUse> attributeUses = null;
        boolean hasAttributes = false;
        boolean hasChardata = false;

        if (!ignoreElement) {
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

            valiHeaderFile.print("struct ");
            valiHeaderFile.println(structName);
            valiHeaderFile.println("{");

            if (element.getTypeDefinition() instanceof XSComplexTypeDefinition) {
                XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) element.getTypeDefinition();
                if (stateMachineMap.get(complexType) != null) {
                    printComplexValidationDataStructMember(valiHeaderFile, config
                            .getComplexValidationDataStateMachineStructMemberType(), config
                            .getComplexValidationStateMachineStructMember());
                }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

                XSModelGroup modelGroup = (XSModelGroup) term;
                printComplexValidationDataStructMembers(stream, modelGroup, printedMembers);
            }
        }
        if (complexType.getBaseType() instanceof XSComplexTypeDefinition) {
            XSComplexTypeDefinition baseType = (XSComplexTypeDefinition) complexType.getBaseType();
            if (!Constants.XSD_ANYTYPE_NAME.equals(baseType.getName())
                    && !config.getXSNamespace().equals(baseType.getNamespace())) {
                printComplexValidationDataStructMembers(stream, baseType, printedMembers);
            }
        }
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

                if (parentType instanceof XSComplexTypeDefinition) {
                    complexParentTypes.add((XSComplexTypeDefinition) parentType);
                }
            }
            if (complexParentTypes.size() == 1) {
                XSComplexTypeDefinition parentType = complexParentTypes.iterator().next();
                printComplexValidationBlockOpen(stream);
                validationBlockOpened = true;

                printComplexValidationForSingleParent(stream, cppName, element, parentType);
            } else if (!complexParentTypes.isEmpty()) {
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

        stream.println();
        stream.println("{");

        // TODO no vali block

        XSComplexTypeDefinition complexType = null;
        XSSimpleTypeDefinition simpleType = null;
        if (typeDefinition instanceof XSComplexTypeDefinition) {
            complexType = (XSComplexTypeDefinition) typeDefinition;
        } else if (typeDefinition instanceof XSSimpleTypeDefinition) {
            simpleType = (XSSimpleTypeDefinition) typeDefinition;
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

     * @return Code to be inserted in template.
     */
    protected static String attributesInitObjects(XSElementDeclaration element, IGenerationDataProvider dataProvider) {
        String code = new String();
        Config config = dataProvider.getConfig();
        XSComplexTypeDefinition complexTypeDefi = Util.getComplexType(element.getTypeDefinition());
        if (complexTypeDefi != null) {
            List<XSAttributeUse> attributeUses = Util.objectListToList(complexTypeDefi.getAttributeUses());
            for (XSAttributeUse attrUse : attributeUses) {
                if (Util.isAttributeInitializationRequired(attrUse, dataProvider.getConfig())) {
                    XSSimpleTypeDefinition attrType = Util.getType(attrUse);
                    String codeTmpl = dataProvider.getConfig().getTemplateAttributeInitObject();

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.