Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSObjectList


         }
         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


      List<VAR> vars = new ArrayList<VAR>();
      short compositor = xsm.getCompositor();

      if (XSModelGroup.COMPOSITOR_SEQUENCE == compositor)
      {
         XSObjectList xsobjlist = xsm.getParticles();
         int len = xsobjlist.getLength();

         for (int i = 0; i < len; i++)
         {
            XSParticle xsparticle = (XSParticle)xsobjlist.item(i);
            XSTerm term = xsparticle.getTerm();

            if (term instanceof XSElementDeclaration)
            {
               vars.addAll(createVARforXSElementDeclaration(term, schemautils.isArrayType(xsparticle), schema, origType));
View Full Code Here

         XSModelGroup group)
   {
      if (group.getCompositor() != XSModelGroup.COMPOSITOR_SEQUENCE)
         return false;

      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(partsMappings, methodMapping, messageName, containingElement, (XSModelGroup)term) == false)
               return false;
View Full Code Here

            {
               addJavaXMLTypeMap(simple, xc.getName(), "", "", jwm, skipWrapperArray);
            }

            // Add attributes
            XSObjectList attributeUses = ((XSComplexTypeDefinition)xc).getAttributeUses();
            if (attributeUses != null)
               addAttributeMappings(attributeUses, jxtm);
         }

         if (xm != null)
View Full Code Here

      // Add enum simpleType support
   }

   private void addVariableMappingMap(XSModelGroup xm, JavaXmlTypeMapping jxtm, String javaType)
   {
      XSObjectList xo = xm.getParticles();
      int len = xo != null ? xo.getLength() : 0;
      for (int i = 0; i < len; i++)
      {
         XSTerm xsterm = ((XSParticle)xo.item(i)).getTerm();
         if (xsterm instanceof XSModelGroup)
         {
            addVariableMappingMap((XSModelGroup)xsterm, jxtm, javaType);
         }
         else if (xsterm instanceof XSElementDeclaration)
View Full Code Here

        // Set Primary Item. Currently we set this to null: no primary item
        nodeTypeDef.setPrimaryItemName(null);

        // Convert attribute uses (<xs:attribute>) to property definitions
        XSObjectList list = ctdef.getAttributeUses();
        for (int i = 0; i < list.getLength(); i++) {
            XSAttributeUse attribUse = (XSAttributeUse) list.item(i);
            PropDef propDef = attributeUseToPropDef(attribUse);
            propDefList.add(propDef);
        }

        // Convert attribute wildcard (<xs:anyattribute>)to residual property
View Full Code Here

                orderable = true;
            }

            // We ignore any further nested compositors
            // by ignoring the return value of nested particleToDefs calls.
            XSObjectList list = mg.getParticles();
            for (int i = 0; i < list.getLength(); i++) {
                XSParticle pp = (XSParticle) list.item(i);
                particleToDefs(pp, propDefList, nodeDefList);
            }
        }
        return orderable;
    }
View Full Code Here

    AttributePSVImpl attrPSVI = null;

    boolean isSimple =
      fCurrentType == null || fCurrentType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE;

    XSObjectList attrUses = null;
    int useCount = 0;
    XSWildcardDecl attrWildcard = null;
    if (!isSimple) {
      attrUses = attrGrp.getAttributeUses();
      useCount = attrUses.getLength();
      attrWildcard = attrGrp.fAttributeWC;
    }

    // Element Locally Valid (Complex Type)
    // 3 For each attribute information item in the element information item's [attributes] excepting those whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is one of type, nil, schemaLocation or noNamespaceSchemaLocation, the appropriate case among the following must be true:
    // get the corresponding attribute decl
    for (int index = 0; index < attCount; index++) {

      attributes.getName(index, fTempQName);

      if (DEBUG) {
        System.out.println("==>process attribute: " + fTempQName);
      }

      if (fAugPSVI || fIdConstraint) {
        augs = attributes.getAugmentations(index);
        attrPSVI = (AttributePSVImpl) augs.getItem(Constants.ATTRIBUTE_PSVI);
        if (attrPSVI != null) {
          attrPSVI.reset();
        } else {
          attrPSVI = new AttributePSVImpl();
          augs.putItem(Constants.ATTRIBUTE_PSVI, attrPSVI);
        }
        // PSVI attribute: validation context
        attrPSVI.fValidationContext = fValidationRoot;
      }

      // Element Locally Valid (Type)
      // 3.1.1 The element information item's [attributes] must be empty, excepting those
      // whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and
      // whose [local name] is one of type, nil, schemaLocation or noNamespaceSchemaLocation.

      // for the 4 xsi attributes, get appropriate decl, and validate
      if (fTempQName.uri == SchemaSymbols.URI_XSI) {
        XSAttributeDecl attrDecl = null;
        if (fTempQName.localpart == SchemaSymbols.XSI_SCHEMALOCATION)
          attrDecl =
            SchemaGrammar.SG_XSI.getGlobalAttributeDecl(
              SchemaSymbols.XSI_SCHEMALOCATION);
        else if (fTempQName.localpart == SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION)
          attrDecl =
            SchemaGrammar.SG_XSI.getGlobalAttributeDecl(
              SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION);
        else if (fTempQName.localpart == SchemaSymbols.XSI_NIL)
          attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_NIL);
        else if (fTempQName.localpart == SchemaSymbols.XSI_TYPE)
          attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_TYPE);
        if (attrDecl != null) {
          processOneAttribute(element, attributes, index, attrDecl, null, attrPSVI);
          continue;
        }
      }

      // for namespace attributes, no_validation/unknow_validity
      if (fTempQName.rawname == XMLSymbols.PREFIX_XMLNS
        || fTempQName.rawname.startsWith("xmlns:")) {
        continue;
      }

      // simple type doesn't allow any other attributes
      if (isSimple) {
        reportSchemaError(
          "cvc-type.3.1.1",
          new Object[] { element.rawname, fTempQName.rawname });
        continue;
      }

      // it's not xmlns, and not xsi, then we need to find a decl for it
      XSAttributeUseImpl currUse = null, oneUse;
      for (int i = 0; i < useCount; i++) {
        oneUse = (XSAttributeUseImpl) attrUses.item(i);
        if (oneUse.fAttrDecl.fName == fTempQName.localpart
          && oneUse.fAttrDecl.fTargetNamespace == fTempQName.uri) {
          currUse = oneUse;
          break;
        }
View Full Code Here

    // (3) add default attrs (FIXED and NOT_FIXED)
    //
    if (DEBUG) {
      System.out.println("==>addDefaultAttributes: " + element);
    }
    XSObjectList attrUses = attrGrp.getAttributeUses();
    int useCount = attrUses.getLength();
    XSAttributeUseImpl currUse;
    XSAttributeDecl currDecl;
    short constType;
    ValidatedInfo defaultValue;
    boolean isSpecified;
    QName attName;
    // for each attribute use
    for (int i = 0; i < useCount; i++) {

      currUse = (XSAttributeUseImpl) attrUses.item(i);
      currDecl = currUse.fAttrDecl;
      // get value constraint
      constType = currUse.fConstraintType;
      defaultValue = currUse.fDefault;
      if (constType == XSConstants.VC_NONE) {
View Full Code Here

            return true;
        }

        // 2.2.4 B's {variety} is union and D is validly derived from a type definition in B's {member type definitions} given the subset, as defined by this constraint.
        if (base.getVariety() == XSSimpleType.VARIETY_UNION) {
            XSObjectList subUnionMemberDV = base.getMemberTypes();
            int subUnionSize = subUnionMemberDV.getLength();
            for (int i=0; i<subUnionSize; i++) {
                base = (XSSimpleType)subUnionMemberDV.item(i);
                if (checkSimpleDerivation(derived, base, block))
                    return true;
            }
        }
View Full Code Here

TOP

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

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.