Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSTerm


         particleList.add(particle);

         while(!particleList.isEmpty())
         {
            XSTerm term = ((XSParticle)particleList.remove(0)).getTerm();
            XSObjectList childParticleList = ((XSModelGroup)term).getParticles();

            for (int i = 0; i < childParticleList.getLength(); i++)
            {
               XSParticle childParticle = (XSParticle)childParticleList.item(i);
               XSTerm childTerm = (childParticle).getTerm();

               if (childTerm.getType() == XSConstants.ELEMENT_DECLARATION)
               {
                  nCount += 1;

                  if (nCount > nMoreThan)
                  {
                     return true;
                  }
               }
               else if (childTerm.getType() == XSConstants.MODEL_GROUP)
               {
                  particleList.add(childParticle);
               }
            }
         }
View Full Code Here


      return childParticle.getMaxOccursUnbounded() || childParticle.getMaxOccurs() > 1;
   }

   private void addChildParts(final CompositeMessagePartInstance parentPart, XSParticle[] modelGroupParticles, XSParticle childParticle, XSComplexTypeDefinition baseType, Byte aggregation)
   {
      XSTerm term = childParticle.getTerm();
     
      switch (term.getType())
      {
         case XSConstants.MODEL_GROUP:
            //determine if aggregation should be random
            if (parentPart.getAggregation() != CompositeMessagePart.RANDOM)
            {
View Full Code Here

      if (part == null)
      {
         return null;
      }
     
      XSTerm term = part.getTerm();
     
      if (term.getType()!=XSConstants.MODEL_GROUP)
      {
         return null;
      }
      return (XSModelGroup)term;
   }
View Full Code Here

      assertTrue("HelloObjArray is a complex type?",xobj instanceof XSComplexTypeDefinition);
      assertTrue("HelloObjArray is not a Wild Card?",!(xobj instanceof XSWildcard));
      XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xobj;
      XSParticle xspart =  xc.getParticle();
      assertNotNull("Particle is null?",xspart);
      XSTerm xsterm = xspart.getTerm();
      assertNotNull("XSTerm is null?",xsterm);
      assertTrue("XSTerm is a model group",xsterm instanceof XSModelGroup);
      XSModelGroup xm = (XSModelGroup)xsterm;
      XSObjectList objlist = xm.getParticles();
      XSParticle xp = (XSParticle)objlist.item(0);
View Full Code Here

      }

      //Validate the particles
      XSParticle xspart1 = xc1.getParticle();
      XSParticle xspart2 = xc2.getParticle();
      XSTerm xt1 = xspart1.getTerm();
      XSTerm xt2 = xspart2.getTerm();
      if(xt1 instanceof XSModelGroup && xt2 instanceof XSModelGroup)
         bool = validateXSModelGroups((XSModelGroup)xt1, (XSModelGroup)xt2);
      return bool;
   }
View Full Code Here

         if( xo1.getLength() != xo2.getLength())
            throw new IllegalStateException("Length of particles do not match:"+xm1.getName());
         int len = xo1.getLength();
         for(int i=0; i< len; i++)
         {
            XSTerm xterm1 = ((XSParticle)xo1.item(i)).getTerm();
            XSTerm xterm2 = ((XSParticle)xo2.item(i)).getTerm();
            short termType = xterm1.getType();
            if(xterm1.getType() != xterm2.getType())
               throw new IllegalStateException(xm1.getName() + " does not match with "+ xm2.getName());
            if(XSConstants.MODEL_GROUP == termType)
               bool = validateXSModelGroups((XSModelGroup)xterm1, (XSModelGroup)xterm2);
            else
               if(XSConstants.ELEMENT_DECLARATION == termType)
View Full Code Here

      assertEquals(decl.getName(), "inside");

      XSTypeDefinition defi = xsmodel.getTypeDefinition(">>root>inside", "http://org.jboss.ws/anonymous/types");
      assertEquals(defi.getTypeCategory(), XSTypeDefinition.COMPLEX_TYPE);
      XSComplexTypeDefinition complex = (XSComplexTypeDefinition) defi;
      XSTerm term = complex.getParticle().getTerm();
      assertEquals(term.getType(), XSConstants.MODEL_GROUP);
      XSModelGroup group = (XSModelGroup) term;
      XSParticle particle = (XSParticle) group.getParticles().item(0);
      term = particle.getTerm();
      assertEquals(term.getType(), XSConstants.ELEMENT_DECLARATION);
      assertEquals(((XSElementDeclaration) term).getName(), "data2");
   }
View Full Code Here

            complexContentDomNode.appendChild(complexContentDerivationNode);
        }
       
        XSParticle particle = complexTypeDecl.getParticle();
        if (derivationMethod == XSConstants.DERIVATION_EXTENSION) {
            XSTerm particleTerm = null;
            if (particle != null) {
              particleTerm = particle.getTerm();
              XSModelGroupImpl modelGroup = (XSModelGroupImpl) particleTerm;
              if (modelGroup.fParticles.length == 2) {
                 particle = modelGroup.fParticles[1]
View Full Code Here

     */
    private void processParticleFromComplexType(Document document,
                                                Element parentDomNode,
                                                XSParticle particle)
                                                throws DOMException {
        XSTerm particleTerm = particle.getTerm();
       
        if (particleTerm instanceof XSModelGroup) {
            XSModelGroup modelGroup = (XSModelGroup) particleTerm;
            String minOccurs = getMinOccursVal(particle);
            String maxOccurs = getMaxOccursVal(particle);
View Full Code Here

        for (int seqIdx = 0; seqIdx < compositorChildren.getLength(); seqIdx++) {
            XSObject seqItem = compositorChildren.item(seqIdx);
            XSParticle compositorParticle = (XSParticle) seqItem;
            String minOccursParticle = getMinOccursVal(compositorParticle);
            String maxOccursParticle = getMaxOccursVal(compositorParticle);
            XSTerm partclTerm = compositorParticle.getTerm();           
            if (partclTerm instanceof XSElementDeclaration) {
               XSElementDecl elemDecl = (XSElementDecl) partclTerm;
               addElementDeclToSchemaComponent(document,
                                               compositorDomNode,
                                               elemDecl,
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.