Examples of XSComplexTypeDefinition


Examples of org.apache.xerces.xs.XSComplexTypeDefinition

        }

        getElementStack().push(element);

        if (element.getTypeDefinition() instanceof XSComplexTypeDefinition) {
            XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) element.getTypeDefinition();
            createComplexValidationDataStructName(element2ElementName.get(element).cppElementName, element, complexType);
            XSObjectList attributeUses = complexType.getAttributeUses();

            for (int i = 0; i < attributeUses.getLength(); i++) {
                XSObject item = attributeUses.item(i);
                if (item instanceof XSAttributeUse) {
                    XSAttributeUse attrUse = (XSAttributeUse) item;
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

            return true;
        }
        getElementStack().push(element);

        if (element.getTypeDefinition() instanceof XSComplexTypeDefinition) {
            XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) element.getTypeDefinition();
            if (complexType.getParticle() != null) {
                if (complexType.getParticle().getTerm() instanceof XSModelGroup) {
                    XSModelGroup modelGroup = (XSModelGroup) complexType.getParticle().getTerm();
                    checkModelGroup(modelGroup, 0);
                }
            }
        }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

      }
      buf.append(newline);
      XSTypeDefinition baseType = null;
      if (type instanceof XSComplexTypeDefinition)
      {
         XSComplexTypeDefinition t = (XSComplexTypeDefinition)type;

         baseType = t.getBaseType();
         //Check baseType is xsd:anyType
         if (baseType != null)
         {
            if (baseType.getNamespace() == Constants.NS_SCHEMA_XSD && baseType.getName().equals("anyType"))
               baseType = null; //Ignore this baseType
         }
         if (XSComplexTypeDefinition.CONTENTTYPE_SIMPLE == t.getContentType())
         {
            baseType = null; //ComplexType has a simplecontent
         }
      }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

   public static XSElementDeclaration unwrapArrayType(XSTypeDefinition xst)
   {
      if (xst instanceof XSComplexTypeDefinition == false)
         return null;

      XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xst;
      if (xc.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
         return null;

      XSParticle xsp = xc.getParticle();
      if (xsp == null)
         return null;

      XSTerm xsterm = xsp.getTerm();
      if (xsterm instanceof XSModelGroup == false)
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

     *            Element to collect attributes for.
     */
    public static List<XSAttributeUse> collectAttributeUses(XSElementDeclaration element) {
        XSTypeDefinition type = element.getTypeDefinition();
        if (type instanceof XSComplexTypeDefinition) {
            XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) type;
            List<XSAttributeUse> attrList = objectListToList(complexType.getAttributeUses());
            return attrList;
        }
        return new ArrayList<XSAttributeUse>();
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

     */
    static public XSSimpleTypeDefinition findSimpleTypeDefinition(XSTypeDefinition typeDefi) {
        if (typeDefi instanceof XSSimpleTypeDefinition) {
            return (XSSimpleTypeDefinition) typeDefi;
        } else if (typeDefi instanceof XSComplexTypeDefinition) {
            XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) typeDefi;
            if (complexType.getSimpleType() == null
                    && complexType.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_MIXED) {
                return XSFactory.createXSAnyType();
            }
            if (complexType.getSimpleType() != null) {
                return complexType.getSimpleType();
            } else {
                return findSimpleTypeDefinition(complexType.getBaseType());
            }
        }
        return null;
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

     *            Type to handle.
     * @return True if traversing shall continue, false for abort.
     */
    protected boolean handleTypeDefinition(XSTypeDefinition typeDefinition) {
        if (isTypeComplex(typeDefinition)) {
            XSComplexTypeDefinition complexTypeDefi = (XSComplexTypeDefinition) typeDefinition;
            boolean success = handleParticle(complexTypeDefi.getParticle());
            if (!success) {
                return false;
            }
        }
        XSTypeDefinition baseType = typeDefinition.getBaseType();
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

        this.substitutionGroups = substitutionGroups;

        handledTypes.add(type);

        if (type instanceof XSComplexTypeDefinition) {
            XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) type;
            handleParticle(complexType.getParticle());

            XSTypeDefinition baseType = complexType.getBaseType();
            SortedSet<XSElementDeclaration> baseTypeChildren = null;
            if (!handledTypes.contains(baseType)) {
                DirectChildrenCollector baseTypeChildrenCollector = new DirectChildrenCollector();
                baseTypeChildren = baseTypeChildrenCollector.collect(baseType, substitutionGroups, handledTypes);
            }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

      /*xsp.setType(XSConstants.ELEMENT_DECLARATION);
       xsp.setMaxOccurs(-1);
       JBossXSElementDeclaration xsel = (JBossXSElementDeclaration)createXSElementDeclaration("name", utils.getSchemaBasicType("string"),  true);

       xsp.setTerm(xsel); */
      XSComplexTypeDefinition ct = new JBossXSComplexTypeDefinition(exname, ns);

      ((JBossXSComplexTypeDefinition)ct).setParticle(xsp);
      return ct;
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSComplexTypeDefinition

      StringBuilder buf = new StringBuilder();

      //Handle Complex Type
      if (xstype instanceof XSComplexTypeDefinition)
      {
         XSComplexTypeDefinition jxstype = (XSComplexTypeDefinition)xstype;
         String jxsTypeName = jxstype.getName();
         boolean isSimple = jxstype.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE;

         if (xstype.getAnonymous())
            buf.append("<complexType>");
         else buf.append("<complexType name='" + jxsTypeName + "'>");

         XSTypeDefinition xsbase = (XSTypeDefinition)jxstype.getBaseType();
         String baseType = null;
         if (xsbase != null && !("anyType".equals(xsbase.getName())))
            baseType = getPrefix(xsbase.getNamespace()) + ":" + xsbase.getName();

         if (baseType != null)
         {
            buf.append((isSimple) ? "<simpleContent>" : "<complexContent>");
            buf.append("<extension base='" + baseType + "'>");
         }

         XSParticle xsp = jxstype.getParticle();
         if (xsp != null)
            appendComplexTypeDefinition(buf, jxstype);

         XSObjectList list = jxstype.getAttributeUses();
         for (int i = 0; i < list.getLength(); i++)
         {
            XSAttributeUse use = (XSAttributeUse)list.item(i);
            XSAttributeDeclaration decl = use.getAttrDeclaration();
            buf.append(write(decl));
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.