Examples of XSModelGroup


Examples of org.apache.xerces.xs.XSModelGroup

      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

Examples of org.apache.xerces.xs.XSModelGroup

      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

Examples of org.apache.xerces.xs.XSModelGroup

               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

Examples of org.apache.xerces.xs.XSModelGroup

      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)
            {
               XSModelGroup xsmodelgrp = (XSModelGroup)xterm;
               vars.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
            }
         }
      }
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSModelGroup

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

Examples of org.apache.xerces.xs.XSModelGroup

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

Examples of org.apache.xerces.xs.XSModelGroup

         {

         }
         else if (xsterm instanceof XSModelGroup)
         {
            XSModelGroup xsm = (XSModelGroup)xsterm;
            XSObjectList xparts = xsm.getParticles();
            list.addAll(createVARsForElements(xparts, schema, type));
         }
      }
      return list;
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSModelGroup

         String temp = this.fname;
         // Unwrap any array wrappers
         if (SchemaUtils.isWrapperArrayType(xstypedef))
         {
            XSComplexTypeDefinition complex = (XSComplexTypeDefinition)xstypedef;
            XSModelGroup group = (XSModelGroup)complex.getParticle().getTerm();
            XSElementDeclaration element = (XSElementDeclaration)((XSParticle)group.getParticles().item(0)).getTerm();
            xstypedef = element.getTypeDefinition();
            xstypename = xstypedef.getName();
            arrayType = true;
         }
View Full Code Here

Examples of org.apache.xerces.xs.XSModelGroup

   {
      XSTerm term = particle.getTerm();
      switch(term.getType())
      {
         case XSConstants.MODEL_GROUP:
            XSModelGroup modelGroup = (XSModelGroup)term;
            // todo: investigate this
            if(modelGroup.getParticles().getLength() > 0)
            {
               ModelGroupBinding groupBinding;
               switch(modelGroup.getCompositor())
               {
                  case XSModelGroup.COMPOSITOR_ALL:
                     groupBinding = new AllBinding(ctx.schema);
                     break;
                  case XSModelGroup.COMPOSITOR_CHOICE:
                     groupBinding = new ChoiceBinding(ctx.schema);
                     break;
                  case XSModelGroup.COMPOSITOR_SEQUENCE:
                     groupBinding = new SequenceBinding(ctx.schema);
                     break;
                  default:
                     throw new JBossXBRuntimeException("Unexpected model group: " + modelGroup.getCompositor());
               }

               ParticleBinding particleBinding = new ParticleBinding(groupBinding);
               particleBinding.setMaxOccursUnbounded(particle.getMaxOccursUnbounded());
               particleBinding.setMinOccurs(particle.getMinOccurs());
               particleBinding.setMaxOccurs(particle.getMaxOccurs());

               if (ctx.trace)
               {
                  log.trace("created model group " + groupBinding);
               }

               if (ctx.processAnnotations)
               {
                  XSAnnotation annotation = modelGroup.getAnnotation();
                  if(annotation != null)
                  {
                     customizeTerm(annotation, groupBinding, ctx.trace);
                  }
               }
View Full Code Here

Examples of org.apache.xerces.xs.XSModelGroup

                        for (int i = 0; i < strList.getLength(); ++i) {
                            model.addElement(strList.item(i));
                        }
                    }
                    else if (value instanceof XSModelGroup) {
                        XSModelGroup group = (XSModelGroup) value;
                        XSObjectList list = group.getParticles();
                        Collection collection = XSModelHelper.flat(list);
                        for (Object item : collection) {
                            model.addElement(item);
                        }
                    }
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.