Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSModelGroup


            for (int i = 0; i < particles.getLength(); i++) {
                XSObject item = particles.item(i);
                if (item instanceof XSParticle) {
                    XSParticle particle = (XSParticle) item;
                    if (particle.getTerm() instanceof XSModelGroup) {
                        XSModelGroup nestedModelGroup = (XSModelGroup) particle.getTerm();
                        String indent = "  ";
                        if (nestedHierarchy != 0) {
                            for (int j = 0; j < nestedHierarchy; j++) {
                                indent += indent;
                            }
                        }
                        if (nestedHierarchy == 0)
                            outFile.println("nested model group: ");
                        else {
                            outFile.println(indent + "nested nested model group: ");
                        }
                        outFile.println(indent + "element: " + getElementStack().peek().getName());
                        outFile.println(indent + "outer compositor: " + getCompositorString(modelGroup));
                        outFile.println(indent + "inner compositor: " + getCompositorString(nestedModelGroup));
                        outFile.println(indent + "inner min/max Occ: " + particle.getMinOccurs() + ", "
                                + particle.getMaxOccurs());
                        if (nestedModelGroup.getParticles() != null) {
                            for (int j = 0; j < nestedModelGroup.getParticles().getLength(); j++) {
                                XSParticle nestedChildParticle = (XSParticle) nestedModelGroup.getParticles().item(j);
                                if (nestedChildParticle.getMinOccurs() != 1 && nestedChildParticle.getMaxOccurs() != 1)
                                    outFile.println(indent + "inner child " + j + " min/max Occ: "
                                            + nestedChildParticle.getMinOccurs() + ", "
                                            + nestedChildParticle.getMaxOccurs());
                            }
View Full Code Here


        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

      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();
View Full Code Here

         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++)
                  analyzeParticle((XSParticle)list.item(i), parentName, namespace);
               break;
            case XSConstants.ELEMENT_DECLARATION:
               XSElementDeclaration decl = (XSElementDeclaration)term;
View Full Code Here

            return true;
        }

        XSTerm term = particle.getTerm();
        if (term instanceof XSModelGroup) {
            XSModelGroup modelGroup = (XSModelGroup) term;

            if (!handleModelGroup(modelGroup)) {
                return false;
            }

            XSObjectList particles = modelGroup.getParticles();
            for (int i = 0; i < particles.getLength(); i++) {
                if (particles.item(i) instanceof XSParticle) {
                    if (!handleParticle((XSParticle) particles.item(i))) {
                        return false;
                    }
View Full Code Here

         buf.append(this.write(xsel, xsp));
         buf.append("</sequence>");
      }
      else if (xsterm instanceof XSModelGroup)
      {
         XSModelGroup jmg = (XSModelGroup)xsterm;
         XSObjectList objlist = jmg.getParticles();
         String end = null;

         switch (jmg.getCompositor())
         {
            case XSModelGroup.COMPOSITOR_ALL:
               buf.append("<all>");
               end = "</all>";
               break;
View Full Code Here

         XSTerm term = particle.getTerm();

         if (term instanceof XSModelGroup == false)
            throw new WSException("[JAX-RPC 2.3.1.2] Expected model group, could not unwrap");

         XSModelGroup group = (XSModelGroup)term;

         unwrapped = unwrapModelGroup(group);
      }

      return unwrapped;
View Full Code Here

      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);
View Full Code Here

      JavaXmlTypeMapping jxtm = null;

      if (xt instanceof XSComplexTypeDefinition)
      {

         XSModelGroup xm = null;
         XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xt;
         if (xc.getContentType() != XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
         {
            XSParticle xp = xc.getParticle();
            if (xp != null)
View Full Code Here

               return complexTypeDef;
         }
         else
         {

            XSModelGroup xm = null;
            if(complexTypeDef.getContentType() != XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
            {
               XSParticle xp = complexTypeDef.getParticle();
               if (xp != null)
               {
                  XSTerm xterm = xp.getTerm();
                  if(xterm instanceof XSModelGroup)
                  {
                     xm = (XSModelGroup)xterm;
                     //System.out.println("xm -> " + xm);

                     XSObjectList xo = xm.getParticles();

                     // interate over nested particles
                     for(int i=0; i<xm.getParticles().getLength(); i++ )
                     {
                        XSTerm xsterm = ((XSParticle)xo.item(i)).getTerm();

                        // Can be either XSModelGroup, XSWildcard, XSElementDeclaration
                        // We only proceed with XSElementDeclaration
View Full Code Here

TOP

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

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.