Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSParticle


               }
            }
         }
      }

      XSParticle particle = type.getParticle();
      if(particle != null)
      {
         ctx.pushType(binding);
         bindParticle(ctx, particle);
         ctx.popType();
View Full Code Here


   private static void bindModelGroup(Context ctx, XSModelGroup modelGroup)
   {
      XSObjectList particles = modelGroup.getParticles();
      for(int i = 0; i < particles.getLength(); ++i)
      {
         XSParticle particle = (XSParticle)particles.item(i);
         bindParticle(ctx, particle);
      }
   }
View Full Code Here

   private static void bindGlobalGroup(XSModelGroup group, SharedElements sharedElements)
   {
      XSObjectList particles = group.getParticles();
      for(int j = 0; j < particles.getLength(); ++j)
      {
         XSParticle particle = (XSParticle)particles.item(j);
         XSTerm term = particle.getTerm();
         switch(term.getType())
         {
            case XSConstants.ELEMENT_DECLARATION:
               XSElementDeclaration element = ((XSElementDeclaration)term);
               sharedElements.add(element);
View Full Code Here

        return signature.toString();
    }

    private static String inspectComplexType(XSComplexTypeDefinition ctypedef) {
        StringBuilder sig = new StringBuilder();
        XSParticle particle = ctypedef.getParticle();
        if (null != particle) {
            XSTerm term = particle.getTerm();
            sig.append(ComplexTypeDescription.inspectTerm(term));
        }
        return sig.toString();
    }
View Full Code Here

                sig.append(":").append(XSModelHelper.compositorToString(group.getCompositor()));
                sig.append("[");
                XSObjectList list = group.getParticles();
                List<String> subSignatures = new ArrayList<String>();
                for (int i = 0; i < list.getLength(); ++i) {
                    XSParticle part = (XSParticle) list.item(i);
                    XSTerm item = part.getTerm();
                    AbstractTypeDescription.logger.debug("==--> embedded [{" + item.getNamespace() + "}:" + item.getName() + "]");
                    subSignatures.add(ComplexTypeDescription.inspectTerm(item));
                }

                /*
 
View Full Code Here

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

        JLabel cell = (JLabel) listCellRendererDelegate.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

        if (value instanceof XSParticle) {
            XSParticle particle = (XSParticle) value;
            StringBuilder sb = new StringBuilder();
            sb.append(particle.getName());
            sb.append(":");
            sb.append(", <");
            sb.append(particle.getNamespace());
            sb.append(">");
            cell.setText(sb.toString());
        }

        return cell;
View Full Code Here

        executeWorker(ctypedef, parent);
        // handle attributes
        XSObjectList attributes = ctypedef.getAttributeUses();
        onVisitAttributes(attributes, ctypedef);

        XSParticle particle = ctypedef.getParticle();
        if (null != particle) {
            XSTerm term = particle.getTerm();
            // according to [1]#Interface-XSParticle this should be either a
            // model group, an element or a wildcard declaration
            onVisitTerm(ctypedef, term);
        }
View Full Code Here

            case XSConstants.MODEL_GROUP:
                XsModelWalker.logger.debug("==> found model group");
                XSModelGroup group = (XSModelGroup) term;
                XSObjectList list = group.getParticles();
                for (int i = 0; i < list.getLength(); ++i) {
                    XSParticle part = (XSParticle) list.item(i);
                    XSTerm item = part.getTerm();
                    XsModelWalker.logger.debug("==--> embedded [{" + item.getNamespace() + "}:" + item.getName() + "]");
                    onVisitTerm(ctypedef, item);
                }
                break;
            case XSConstants.ELEMENT_DECLARATION:
View Full Code Here

      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

      int lenobj = objlist != null ? objlist.getLength() : 0;

      for (int i = 0; i < lenobj; i++)
      {
         XSParticle jxsp = (XSParticle)objlist.item(i);
         XSTerm xterm = jxsp.getTerm();
         short termType = xterm.getType();
         if (termType == XSConstants.ELEMENT_DECLARATION)
         {
            XSElementDeclaration xsel = (XSElementDeclaration)jxsp.getTerm();
            buf.append(this.write(xsel, jxsp));
         }
         else if (termType == XSConstants.MODEL_GROUP)
         {
            XSObjectList olist = ((XSModelGroup)xterm).getParticles();
            int lobj = olist != null ? olist.getLength() : 0;
            for (int k = 0; k < lobj; k++)
            {
               XSParticle jxp = (XSParticle)olist.item(k);
               XSTerm xsterm = jxp.getTerm();
               termType = xsterm.getType();
               if (termType == XSConstants.ELEMENT_DECLARATION)
                  buf.append(write((XSElementDeclaration)xsterm, jxsp));
               else if (termType == XSConstants.MODEL_GROUP && k > 0)
                  buf.append(write((XSModelGroup)xsterm));
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.