Package org.apache.xerces.xs

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


      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

      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

      private void analyzeParticle(XSParticle particle, String parentName, String namespace)
      {
         // Is this right, can a particle be null?
         if (particle == null)
            return;
         XSTerm term = particle.getTerm();

         // Is this right, can a term be null?
         if (term == null)
            return;
         switch (term.getType())
         {
            case XSConstants.MODEL_GROUP:
               XSModelGroup group = (XSModelGroup)term;
               XSObjectList list = group.getParticles();
               for (int i = 0; i < list.getLength(); i++)
View Full Code Here

   {
      Map<String, XSParticle> index = new LinkedHashMap<String, XSParticle>();
      List<XSParticle> newList = new ArrayList<XSParticle>();
      for (XSParticle particle : particles)
      {
         XSTerm term = particle.getTerm();
         if (term instanceof XSElementDeclaration)
            index.put(((XSElementDeclaration)term).getName(), particle);
         else newList.add(particle);
      }
View Full Code Here

   private void addVariableMappings(Class javaType, JavaXmlTypeMapping javaXmlTypeMapping, List<XSParticle> particles, Map<String, String> reversedNames)
   {
      for (XSParticle particle : particles)
      {
         XSTerm term = particle.getTerm();
         if (term.getType() == XSConstants.MODEL_GROUP)
         {
            XSModelGroup group = (XSModelGroup)term;
            XSObjectList list = group.getParticles();
            ArrayList<XSParticle> baseParticles = new ArrayList<XSParticle>();
            for (int i = 0; i < list.getLength(); i++)
               baseParticles.add((XSParticle)list.item(i));

            addVariableMappings(javaType, javaXmlTypeMapping, baseParticles, null);

            continue;
         }

         String name = term.getName();
         String variableName = name;
         if (reversedNames != null && reversedNames.get(name) != null)
            variableName = reversedNames.get(name);

         VariableMapping mapping = new VariableMapping(javaXmlTypeMapping);
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>();
         for (int i = 0; i < list.getLength(); i++)
View Full Code Here

   private void handleContentTypeElementsWithDerivationRestriction(XSComplexTypeDefinition type, XSModel schema, 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();
            //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

   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

TOP

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

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.