Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSAttributeDeclaration


         XSObjectList list = jxstype.getAttributeUses();
         for (int i = 0; i < list.getLength(); i++)
         {
            XSAttributeUse use = (XSAttributeUse)list.item(i);
            XSAttributeDeclaration decl = use.getAttrDeclaration();
            buf.append(write(decl));
         }

         if (baseType != null)
         {
View Full Code Here


      //Copy all the attributes
      xsmp = xsmodel.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
      len = xsmp != null ? xsmp.getLength() : 0;
      for (int i = 0; i < len; i++)
      {
         XSAttributeDeclaration xsattr = (XSAttributeDeclaration)xsmp.item(i);
         jb.addXSAttributeDeclaration(xsattr);
      }

      //copy all the global annotations
      //xsmp = xsmodel.getComponents(XSConstants.ANNOTATION);
View Full Code Here

      //Merge the attributes
      JBossXSNamedMap nmap = (JBossXSNamedMap)nsi.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
      int len = nmap.getLength();
      for(int i=0;i<len;i++)
      {
         XSAttributeDeclaration xatt = (XSAttributeDeclaration)nmap.item(i);
         this.addXSAttributeDeclaration(xatt);
      }

      //Merge the types
      nmap = (JBossXSNamedMap)nsi.getComponents(XSConstants.TYPE_DEFINITION);
View Full Code Here

        }
      }
      XSObjectList attrs = ((XSComplexTypeDefinition) type).getAttributeUses();
      for (int i = 0; i < attrs.getLength(); i++) {
        XSAttributeUse attrUse = (XSAttributeUse) attrs.item(i);
        XSAttributeDeclaration attr = attrUse.getAttrDeclaration();
        AttributeInfo attrInfo = new AttributeInfo(attr.getName(), true, AttributeInfo.NONE, attrUse.getRequired());
        tagInfo.addAttributeInfo(attrInfo);
      }

    }
  }
View Full Code Here

      {
         XSAttributeUse attr = (XSAttributeUse)attributeUses.item(i);
        
         if (!contains(baseAttributeUses, attr))
         {
            XSAttributeDeclaration attrDecl = attr.getAttrDeclaration();
            String sName = attrDecl.getName();
            PrimitiveMessagePart part = new PrimitiveMessagePart(sName);

            if (!addPart(parent, part))
            {
               if (s_logger.isWarnEnabled())
               {
                  s_logger.warn("Ignoring duplicate XSD attribute definition \"" + attr.getName() +
                     "\" in element type \"" + def.getName() + "\"");
               }

               continue;
            }

            part.setParent(parent);

            if (attr.getRequired())
            {
               part.setMinCount(1);
            }

            part.setMaxCount(1);
            part.setDescription(parseDescription(attrDecl.getAnnotation()));

            XMLMessagePartMapping mapping = new XMLMessagePartMapping();

            mapping.setNodeName(sName);
            initMapping(mapping, part, XMLMessagePartMapping.ATTRIBUTE, attrDecl.getNamespace(), attrDecl.getTypeDefinition());

            String[] enumerations = XSDUtil.getEnumeration(attrDecl);

            for (int nEnumIndex = 0; nEnumIndex < enumerations.length; ++nEnumIndex)
            {
View Full Code Here

      Set nameLookup = new HashSet(attributeUses.getLength());
     
      for (int i=0; i < attributeUses.getLength(); ++i)
      {
         XSAttributeUse attr = (XSAttributeUse)attributeUses.item(i);
         XSAttributeDeclaration attrDecl = attr.getAttrDeclaration();
         nameLookup.add(attrDecl.getName());
      }
     
      stripAttributes(element, nameLookup);
   }
View Full Code Here

      if(xobj1.getLength() != xobj2.getLength())
         return false;
      int len = xobj1.getLength();
      for(int i=0; i<len ; i++)
      {
         XSAttributeDeclaration xat1 = (XSAttributeDeclaration)xobj1.item(i);
         XSAttributeDeclaration xat2 = (XSAttributeDeclaration)xobj1.item(i);
         bool =  checkXSAttributesEquality(xat1,xat2);
      }

      //Validate the particles
      XSParticle xspart1 = xc1.getParticle();
View Full Code Here

             String attrName = attributes.getLocalName(attrIndx);
             String attrUri = attributes.getURI(attrIndx);           
             // iterate all the attribute declarations of a complex type, for the current element
             for (int attrUsesIndx = 0; attrUsesIndx < attributeUses.getLength(); attrUsesIndx++) {
                XSAttributeUseImpl attrUseImpl = (XSAttributeUseImpl) attributeUses.get(attrUsesIndx);
                XSAttributeDeclaration attrDecl = attrUseImpl.getAttrDeclaration();             
                // the current element, has an inheritable attribute
                if (attrName.equals(attrDecl.getName()) && XSTypeHelper.isUriEqual(attrUri, attrDecl.getNamespace()) &&   
                                                                                       attrUseImpl.getInheritable()) {                  
                    InheritableAttribute inhrAttr = new InheritableAttribute(attributes.getLocalName(attrIndx),
                                                                             attributes.getPrefix(attrIndx),
                                                                             attributes.getURI(attrIndx),
                                                                             attributes.getValue(attrIndx),
View Full Code Here

      return binding;
   }

   private AttributeBinding bindAttribute(XSAttributeUse attrUse)
   {
      XSAttributeDeclaration attr = attrUse.getAttrDeclaration();
      QName attrName = new QName(attr.getNamespace(), attr.getName());

      XSSimpleTypeDefinition attrType = attr.getTypeDefinition();
      TypeBinding typeBinding = bindSimpleType(attrType);

      if (trace)
      {
         log.trace("binding attribute " + attrName + ", required=" + attrUse.getRequired());
      }

      AttributeBinding binding = new AttributeBinding(schema, attrName, typeBinding, DefaultHandlers.ATTRIBUTE_HANDLER);
      binding.setRequired(attrUse.getRequired());
      if(attrUse.getConstraintType() == XSConstants.VC_DEFAULT)
      {
         // Associate the default value with the binding
         binding.setDefaultConstraint(attrUse.getConstraintValue());
      }

      if (processAnnotations)
      {
         XSAnnotation an = attr.getAnnotation();
         if(an != null)
         {
            if (trace)
            {
               log.trace(attrName + " attribute annotation");
View Full Code Here

             String attrUri = attributes.getURI(attrIndx);           
             // iterate all the attributes declarations, of the complex type,
             // for the current element.
             for (int attrUsesIndx = 0; attrUsesIndx < attributeUses.getLength(); attrUsesIndx++) {
                XSAttributeUseImpl attrUseImpl = (XSAttributeUseImpl) attributeUses.get(attrUsesIndx);
                XSAttributeDeclaration attrDecl = attrUseImpl.getAttrDeclaration();             
                // the current element, has an inheritable attribute
                if (attrName.equals(attrDecl.getName()) &&
                      uriEqual(attrUri, attrDecl.getNamespace()) &&   
                      attrUseImpl.getInheritable()) {                  
                    InheritableAttribute inhrAttr = new InheritableAttribute(
                                            attributes.getLocalName(attrIndx),
                                            attributes.getPrefix(attrIndx),
                                            attributes.getURI(attrIndx),
View Full Code Here

TOP

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

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.