Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSParticle


      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)
         return null;

      XSModelGroup xm = (XSModelGroup)xsterm;
      XSObjectList xo = xm.getParticles();
      if (xo.getLength() != 1)
         return null;

      XSParticle xp = (XSParticle)xo.item(0);
      XSTerm term = xp.getTerm();
      if ((xp.getMaxOccursUnbounded() || xp.getMaxOccurs() > 1) == false || term instanceof XSElementDeclaration == false)
         return null;

      return (XSElementDeclaration)term;
   }
View Full Code Here


      }

      // Follow the order of elementNames
      for (QName name : elementNames.values())
      {
         XSParticle found = index.get(name.getLocalPart());
         if (found != null)
         {
            index.remove(name.getLocalPart());
            newList.add(found);
         }
View Full Code Here

      {
         XSTypeDefinition btype = baseType.getBaseType();
         if (btype != null)
            addBaseTypeParts(btype, xsparts); //Recurse
         //Just add the particles from this basetype as a ModelGroup sequence
         XSParticle part = ((XSComplexTypeDefinition)baseType).getParticle();
         XSTerm term = part.getTerm();
         if (term instanceof XSModelGroup)
         {
            JBossXSParticle p = new JBossXSParticle();
            p.setTerm(term);
            xsparts.add(p);
View Full Code Here

      {
         particles.add(getXSParticle(name, type, targetNS));
         return;
      }

      XSParticle particle = particles.get(0);
      XSTerm term = particle.getTerm();
      if (term.getType() == XSConstants.MODEL_GROUP)
      {
         JBossXSModelGroup group = (JBossXSModelGroup)term;
         XSObjectList list = group.getParticles();
         ArrayList<XSParticle> baseParticles = new ArrayList<XSParticle>();
View Full Code Here

         if (xsterm instanceof XSModelGroup)
         {
            XSModelGroup xsm = (XSModelGroup)xsterm;
            XSObjectList xparts = xsm.getParticles();
            //Ignore the first item - that will be a modelgroup for basetype
            XSParticle xspar = (XSParticle)xparts.item(1);
            XSTerm xterm = xspar.getTerm();
            if (xterm instanceof XSElementDeclaration)
            {
               vars.addAll(createVARforXSElementDeclaration(xterm, schemautils.isArrayType(xspar), schema, type));
            }
            else if (xterm instanceof XSModelGroup)
View Full Code Here

               // 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));
            }
            else if (xsparTerm instanceof XSElementDeclaration)
               vars.addAll(createVARforXSElementDeclaration(xsparTerm, schemautils.isArrayType(xspar), schema, type));
View Full Code Here

                  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));
               }
               else if (xsparTerm instanceof XSElementDeclaration)
                  vars.addAll(createVARforXSElementDeclaration(xsparTerm, schemautils.isArrayType(xspar), schema, type));
            }
View Full Code Here

   }

   private List createVARsforXSParticle(XSComplexTypeDefinition type, XSModel schema) throws IOException
   {
      List<VAR> list = new ArrayList<VAR>();
      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

         XSObjectList xsobjlist = xsm.getParticles();
         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

   {
      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

TOP

Related Classes of org.apache.xerces.xs.XSParticle

Copyright © 2018 www.massapicom. 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.