Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSAttributeUse


                                              attrGpAnnotation);
            }
           
            XSObjectList attrUses = attrGpDecl.getAttributeUses();
            for (int attrUsesIdx = 0; attrUsesIdx < attrUses.size(); attrUsesIdx++) {
               XSAttributeUse attrUse = (XSAttributeUse) attrUses.item(attrUsesIdx);
               XSAttributeDecl attrDecl = (XSAttributeDecl) attrUse.getAttrDeclaration();
               String constraintName = null;
               String constraintVal = null;          
               if (attrUse.getConstraintType() != XSConstants.VC_NONE) {
                   constraintName = (attrUse.getConstraintType() ==
                                               XSConstants.VC_DEFAULT) ?
                                               "default" : "fixed";
                   constraintVal = attrUse.getConstraintValue();
               }
               String requiredVal = (attrUse.getRequired() == true) ?
                                              "required" : "optional";
               addAttributeToSchemaComponent(document, attrGpDomNode,
                                             attrDecl, constraintName,
                                             constraintVal, requiredVal);
            }
View Full Code Here


       
        // iterate all attributes on the complex type. all attributes on a complex type (from all-of
        // it's xs:attribute & xs:attributeGroup declarations) are expanded, into an XSObjectList list. 
        XSObjectList attributeUses = complexTypeDecl.getAttributeUses();
        for (int attrUsesIdx = 0; attrUsesIdx < attributeUses.getLength(); attrUsesIdx++) {
           XSAttributeUse attrUse = (XSAttributeUse) attributeUses.item(attrUsesIdx);
           String constraintName = null;
           String constraintVal = null;          
           if (attrUse.getConstraintType() != XSConstants.VC_NONE) {
              constraintName = (attrUse.getConstraintType() == XSConstants.VC_DEFAULT) ? "default" : "fixed";
              constraintVal = attrUse.getConstraintValue();
           }
          
           String requiredVal = (attrUse.getRequired() == true) ? "required" : "optional";
          
           XSAttributeDecl attrDecl = (XSAttributeDecl)
                                                  attrUse.getAttrDeclaration();
           XSComplexTypeDefinition enclosingCTDefn = attrDecl.
                                                  getEnclosingCTDefinition();
           boolean complexTypesIdentical = (enclosingCTDefn == null) ? false : XSTypeHelper.isSchemaTypesIdentical(
                                                                                  complexTypeDecl, enclosingCTDefn);
           // do not add attributes, from the base type. they will be serialized as part of the base type serialization.
View Full Code Here

            sendElementEvent("psv:attributeUses");
        }
        else {
            sendIndentedElement("psv:attributeUses");
            for (int i = 0; i < uses.getLength(); i++) {
                XSAttributeUse use = (XSAttributeUse)uses.item(i);
                sendIndentedElement("psv:attributeUse");
                sendElementEvent("psv:required", String.valueOf(use.getRequired()));
                processPSVIAttributeDeclarationOrRef(use.getAttrDeclaration());
                processPSVIValueConstraint(use.getConstraintType(), use.getConstraintValue());
                sendUnIndentedElement("psv:attributeUse");
            }
            sendUnIndentedElement("psv:attributeUses");
        }
    }
View Full Code Here

      AttributeBinding attrBinding = null;
      boolean hasOnlyIdAttrs = true;
      for(int i = 0; i < attrs.getLength(); ++i)
      {
         XSAttributeUse attr = (XSAttributeUse)attrs.item(i);
         attrBinding = bindAttribute(attr);
         binding.addAttribute(attrBinding);
         if(hasOnlyIdAttrs && !Constants.QNAME_ID.equals(attrBinding.getType().getQName()))
         {
            hasOnlyIdAttrs = false;
View Full Code Here

        XSObjectList attrUseS = fromAttrGrp.getAttributeUses();
        XSAttributeUseImpl  duplicateAttrUse =  null, oneAttrUse = null;
        int attrCount = attrUseS.getLength();
        for (int i=0; i<attrCount; i++) {
            oneAttrUse = (XSAttributeUseImpl)attrUseS.item(i);
            XSAttributeUse existingAttrUse = toAttrGrp.getAttributeUse(oneAttrUse.fAttrDecl.getNamespace(),
                    oneAttrUse.fAttrDecl.getName());
            if (existingAttrUse == null) {
               
                String idName = toAttrGrp.addAttributeUse(oneAttrUse);
                if (idName != null) {
View Full Code Here

         log.trace(typeName + " attributes " + attrs.getLength());

      boolean hasOnlyIdAttrs = true;
      for(int i = 0; i < attrs.getLength(); ++i)
      {
         XSAttributeUse attr = (XSAttributeUse)attrs.item(i);
         AttributeBinding attrBinding = bindAttributes(ctx, binding, attr);
         if(hasOnlyIdAttrs && !Constants.QNAME_ID.equals(attrBinding.getType().getQName()))
         {
            hasOnlyIdAttrs = false;
         }
View Full Code Here

                final XSComplexTypeDefinition complexTypeDefinition = (XSComplexTypeDefinition) typeDefinition;
                final Node element = new Node(parent, new QName(xsElement.getNamespace(), xsElement.getName()), new HashSet<Node>(), new ArrayList<Node>());

                final XSObjectList attributeUses = complexTypeDefinition.getAttributeUses();
                for (final Object attributeObject : attributeUses) {
                    final XSAttributeUse attributeUse = (XSAttributeUse) attributeObject;
                    final XSAttributeDeclaration attributeDeclaration = attributeUse.getAttrDeclaration();

                    log.trace("Attribute {{}}{}", attributeDeclaration.getNamespace(), attributeDeclaration.getName());
                    final Node attribute = new Node(element, new QName(attributeDeclaration.getNamespace(), attributeDeclaration.getName()), convert(attributeDeclaration.getTypeDefinition()));
                    element.attributes.add(attribute);
                }
View Full Code Here

      AttributeBinding attrBinding = null;
      boolean hasOnlyIdAttrs = true;
      for(int i = 0; i < attrs.getLength(); ++i)
      {
         XSAttributeUse attr = (XSAttributeUse)attrs.item(i);
         attrBinding = bindAttribute(attr);
         binding.addAttribute(attrBinding);
         if(hasOnlyIdAttrs && !Constants.QNAME_ID.equals(attrBinding.getType().getQName()))
         {
            hasOnlyIdAttrs = false;
View Full Code Here

      AttributeBinding attrBinding = null;
      boolean hasOnlyIdAttrs = true;
      for(int i = 0; i < attrs.getLength(); ++i)
      {
         XSAttributeUse attr = (XSAttributeUse)attrs.item(i);
         attrBinding = bindAttribute(attr);
         binding.addAttribute(attrBinding);
         if(hasOnlyIdAttrs && !Constants.QNAME_ID.equals(attrBinding.getType().getQName()))
         {
            hasOnlyIdAttrs = false;
View Full Code Here

        XSElementDeclaration elem = model.getElementDeclaration("elem4",
                "XSFacetTest");

        XSComplexTypeDefinition ct = (XSComplexTypeDefinition) elem
                .getTypeDefinition();
        XSAttributeUse attr = (XSAttributeUse) ct.getAttributeUses().item(0);
        XSSimpleTypeDefinition st = attr.getAttrDeclaration()
                .getTypeDefinition();
        // Item 0 is minInclusive
        XSFacet fractionDigits = (XSFacet) st.getFacets().item(1);

        XSAnnotation annotation = fractionDigits.getAnnotation();
View Full Code Here

TOP

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

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.