Examples of XSAttributeDeclaration


Examples of org.apache.xerces.xs.XSAttributeDeclaration

     * @param value
     * @param cell
     */
    private static void renderAttributeType(final Object value, JLabel cell) {
        if (value instanceof XSAttributeDeclaration) {
            XSAttributeDeclaration attribute = (XSAttributeDeclaration) value;
            StringBuilder sb = new StringBuilder();
            sb.append(attribute.getName());
            sb.append(", <");
            final String namespace = attribute.getNamespace();
            sb.append((null == namespace) ? "default namespace" : namespace);
            sb.append(">");
            cell.setText(sb.toString());
            cell.setIcon(AttributeRenderer.icon);
        }
View Full Code Here

Examples of org.apache.xerces.xs.XSAttributeDeclaration

    private void onVisitAttributes(XSObjectList attributeUsesList, XSObject parent) {
        for (int i = 0; i < attributeUsesList.getLength(); ++i) {
            XSAttributeUse xsAttribute = (XSAttributeUse) attributeUsesList.item(i);
            // attribute declaration contains interesting properties of the
            // attribute
            XSAttributeDeclaration xsAttributeType = xsAttribute.getAttrDeclaration();

            XsModelWalker.logger.debug("--> Attribute [{" + xsAttributeType.getNamespace() + "}:" + xsAttributeType.getName() + "]");

            executeWorker(xsAttributeType, parent);

            // handle
            /*
             * TODO check if we really need this...
             *
             * A {scope} of global identifies attribute declarations available for use in complex type definitions
             * throughout the schema. Locally scoped declarations are available for use only within the complex type
             * definition identified by the {scope} property. This property is ·absent· in the case of declarations
             * within attribute group definitions: their scope will be determined when they are used in the construction
             * of complex type definitions.
             */
            XSComplexTypeDefinition ctypedef = xsAttributeType.getEnclosingCTDefinition();
            if (null != ctypedef) {
                visitComponent(ctypedef, parent);
            }

            visitComponent(xsAttributeType.getTypeDefinition(), parent);
        }

    }
View Full Code Here

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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

      //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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

      //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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

        }
      }
      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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

      {
         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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

      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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

      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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

             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
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.