Examples of XSTerm


Examples of org.apache.xerces.xs.XSTerm

   private void handleContentTypeElementsWithDerivationExtension(XSComplexTypeDefinition type, XSModel schema, boolean isExceptionType, List vars, XSParticle xsparticle)
         throws IOException
   {
      if (xsparticle != null)
      {
         XSTerm xsterm = xsparticle.getTerm();
         if (xsterm instanceof XSModelGroup)
         {
            XSModelGroup xsm = (XSModelGroup)xsterm;
            XSObjectList xparts = xsm.getParticles();

            int length = xparts.getLength();

            XSTypeDefinition baseType = type.getBaseType();

            if (baseType instanceof XSComplexTypeDefinition && ((XSComplexTypeDefinition)baseType).getContentType() != XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
            {
               XSTerm baseTerm = ((XSComplexTypeDefinition)baseType).getParticle().getTerm();
               if (isExceptionType && baseTerm instanceof XSModelGroup)
               {
                  typeNameToBaseVARList.put(type.getName(), createVARsforXSModelGroup((XSModelGroup)baseTerm, schema, type));
               }

               // HACK - The only way to know what elements are local to the subclass, and not inherited, is to compare to the base class
               // THIS TIES US TO XERCES
               if (baseType instanceof XSComplexTypeDefinition == false || ((XSComplexTypeDefinition)baseType).getParticle().getTerm() == xsterm)
                  return;
            }

            XSParticle xspar;

            if (baseType instanceof XSComplexTypeDefinition && ((XSComplexTypeDefinition)baseType).getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
            {
               // If the base type is empty there will not have been a particle to ignore.
               xspar = xsparticle;
            }
            else
            {
               xspar = (XSParticle)xparts.item(length - 1);
            }

            XSTerm xsparTerm = xspar.getTerm();
            if (xsparTerm instanceof XSModelGroup)
            {
               XSModelGroup xsmodelgrp = (XSModelGroup)xspar.getTerm();
               vars.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
            }
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

   private void handleContentTypeElementsWithDerivationNone(XSComplexTypeDefinition type, XSModel schema, boolean isExceptionType, List vars, XSParticle xsparticle)
         throws IOException
   {
      if (xsparticle != null)
      {
         XSTerm xsterm = xsparticle.getTerm();
         if (xsterm instanceof XSModelGroup)
         {
            XSModelGroup xsm = (XSModelGroup)xsterm;
            XSObjectList xparts = xsm.getParticles();
            int len = xparts != null ? xparts.getLength() : 0;
            int diff = len - 0;

            for (int i = 0; i < len; i++)
            {
               if (isExceptionType && type.getBaseType() != null)
               {
                  List<VAR> baseList = new ArrayList<VAR>();

                  //The first few xsterms are modelgroups for base class
                  for (int j = 0; j < diff - 1; j++)
                  {
                     XSParticle xspar = (XSParticle)xparts.item(j);
                     XSTerm xsparTerm = xspar.getTerm();
                     if (xsparTerm instanceof XSModelGroup)
                     {
                        XSModelGroup xsmodelgrp = (XSModelGroup)xspar.getTerm();
                        baseList.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
                     }

                  }
                  if (baseList.size() > 0)
                     this.typeNameToBaseVARList.put(type.getName(), baseList);
                  //Now take the modelgroup for the type in question
                  XSParticle xspar = (XSParticle)xparts.item(len - 1);
                  XSTerm xsparTerm = xspar.getTerm();
                  if (xsparTerm instanceof XSModelGroup)
                  {
                     XSModelGroup xsmodelgrp = (XSModelGroup)xspar.getTerm();
                     vars.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
                  }
                  break;
               }
               XSParticle xspar = (XSParticle)xparts.item(i);
               XSTerm xsparTerm = xspar.getTerm();
               if (xsparTerm instanceof XSModelGroup)
               {
                  XSModelGroup xsmodelgrp = (XSModelGroup)xspar.getTerm();
                  vars.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
               }
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

      XSParticle xsparticle = type.getParticle();

      if (xsparticle != null)
      {
         short xsptype = xsparticle.getType();
         XSTerm xsterm = xsparticle.getTerm();
         if (xsptype == XSConstants.ELEMENT_DECLARATION)
         {

         }
         else if (xsterm instanceof XSModelGroup)
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

         int len = xsobjlist.getLength();

         for (int i = 0; i < len; i++)
         {
            XSParticle xsparticle = (XSParticle)xsobjlist.item(i);
            XSTerm term = xsparticle.getTerm();

            if (term instanceof XSElementDeclaration)
            {
               vars.addAll(createVARforXSElementDeclaration(term, schemautils.isArrayType(xsparticle), schema, origType));
            }
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

      List<VAR> list = new ArrayList<VAR>();
      int len = xsobjlist.getLength();
      for (int i = 0; i < len; i++)
      {
         XSParticle xsparticle = (XSParticle)xsobjlist.item(i);
         XSTerm xsterm = xsparticle.getTerm();

         list.addAll(createVARforXSElementDeclaration(xsterm, schemautils.isArrayType(xsparticle), schema, origType));
         continue;
      }
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

     * particleToDefs
     */
    private boolean particleToDefs(XSParticle particle, List propDefList, List nodeDefList) throws SchemaConversionException {
        boolean orderable = false;

        XSTerm term = particle.getTerm();

        // If the maxoccurs setting of this particle is zero then this
        // particle does not contribute any node or property definition and
        // we do nothing and return.
        if (particle.getMaxOccurs() == 0) {
            return orderable;
        }

        // Determine the mandatory setting of the node or property
        // corresponding to this particle (if this particle does not
        // correspond to node or property this information is ignored).
        boolean mandatory = false;
        if (particle.getMinOccurs() > 0) {
            mandatory = true;
        }

        // Determine the same-name siblings setting of the node, or
        // the multiple setting of the property, corresponding to this
        // particle (if this particle does not correspond to
        // node or property this information is ignored).
        boolean multiple = false;
        if (particle.getMaxOccurs() > 1 || particle.getMaxOccursUnbounded()) {
            multiple = true;
        }

        // If this particle is an element declaration (an <xs:element>)
        // then it is converted into either a node or property def.
        if (term.getType() == XSConstants.ELEMENT_DECLARATION) {
            XSElementDeclaration eDec = (XSElementDeclaration) term;

            // Name for property or node def taken from the name of the element
            QName name = new QName(noNull(eDec.getNamespace()), eDec.getName());

            // Get the type definition for this element declaration
            XSTypeDefinition tDef = eDec.getTypeDefinition();

            // If this element declaration is of simple type
            // then it is converted into a property def
            if (tDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                XSSimpleTypeDefinition stDef = (XSSimpleTypeDefinition) tDef;
                PropDef propDef = simpleTypeToPropDef(stDef, name, mandatory, multiple);
                propDefList.add(propDef);

                // If this element declaration is of complex type then
                // it is converted into either node or property def
            } else if (tDef.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
                XSComplexTypeDefinition ctDef = (XSComplexTypeDefinition) tDef;

                // If the complex type definition contains a simple content model
                // and does not contain any attribute uses or attribute wildcards
                // then the enclosing element is converted to a property def
                if (ctDef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE && ctDef.getAttributeUses().getLength() == 0 && ctDef.getAttributeWildcard() == null) {
                    XSSimpleTypeDefinition std = ctDef.getSimpleType();
                    PropDef pd = simpleTypeToPropDef(std, name, mandatory, multiple);
                    propDefList.add(pd);

                    // If the complex type definition contains a complex content model
                    // or a simple content model with attribute uses or an attribute wildcard
                    // then the enclosing element is converted into a node def
                } else {
                    NodeDef nd = complexTypeToNodeDef(ctDef, name, mandatory, multiple);
                    nodeDefList.add(nd);
                }
            }

            // If this particle is a wildcard (an <xs:any> )then it
            // is converted into a node def.
        } else if (term.getType() == XSConstants.WILDCARD) {
            nodeDefList.add(wildcardNodeDef());

            // If this particle is a model group (one of
            // <xs:sequence>, <xs:choice> or <xs:all>) then
            // it subparticles must be processed.
        } else if (term.getType() == XSConstants.MODEL_GROUP) {
            XSModelGroup mg = (XSModelGroup) term;

            /* Si cela est une séquence */
            // If the top level compositor is <xs:sequence> we convert this to
            // mean that the node type corresponding to the complex type def will have
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

      {
         unwrappedElement = true;
      }
      else
      {
         XSTerm term = particle.getTerm();
         if (term instanceof XSModelGroup)
         {
            unwrappedElement = unwrapGroup(tempBuf, containingElement, (XSModelGroup)term);
         }
      }
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

      XSObjectList particles = group.getParticles();
      for (int i = 0; i < particles.getLength(); i++)
      {
         XSParticle particle = (XSParticle)particles.item(i);
         XSTerm term = particle.getTerm();
         if (term instanceof XSModelGroup)
         {
            if (unwrapGroup(buf, containingElement, (XSModelGroup)term) == false)
               return false;
         }
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

      {
         return true;
      }
      else
      {
         XSTerm term = particle.getTerm();
         if (term instanceof XSModelGroup)
         {
            unwrappedElement = unwrapGroup(partsMappings, methodMapping, messageName, containingElement, (XSModelGroup)term);
         }
      }
View Full Code Here

Examples of org.apache.xerces.xs.XSTerm

      XSObjectList particles = group.getParticles();
      for (int i = 0; i < particles.getLength(); i++)
      {
         XSParticle particle = (XSParticle)particles.item(i);
         XSTerm term = particle.getTerm();
         if (term instanceof XSModelGroup)
         {
            if (unwrapGroup(partsMappings, methodMapping, messageName, containingElement, (XSModelGroup)term) == false)
               return false;
         }
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.