Examples of XSAttributeDeclaration


Examples of org.apache.xerces.xs.XSAttributeDeclaration

      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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

             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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

      return binding;
   }

   private static AttributeBinding bindAttributes(Context ctx, TypeBinding type, XSAttributeUse attrUse)
   {
      XSAttributeDeclaration attr = attrUse.getAttrDeclaration();
      QName attrName = new QName(attr.getNamespace(), attr.getName());

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

      XSSimpleTypeDefinition attrType = attr.getTypeDefinition();
      TypeBinding typeBinding = bindSimpleType(ctx, attrType);
      AttributeBinding binding = type.addAttribute(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 (ctx.processAnnotations)
      {
         XSAnnotation an = attr.getAnnotation();
         if(an != null)
         {
            if (ctx.trace)
            {
               log.trace(attrName + " attribute annotation");
View Full Code Here

Examples of org.apache.xerces.xs.XSAttributeDeclaration

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

                final XSParticle particle = complexTypeDefinition.getParticle();
                if (particle != null) {
View Full Code Here

Examples of org.apache.xerces.xs.XSAttributeDeclaration

      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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

      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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

                        synth);

        XSModel model = fSchemaLoader
                .loadURI(getResourceURL("XSFacetTest01.xsd"));

        XSAttributeDeclaration attr = model.getAttributeDeclaration("attr",
                "XSFacetTest");

        XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) attr
                .getTypeDefinition();
        // Item 0 is minInclusive
        XSFacet maxLength = (XSFacet) st.getFacets().item(1);

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

Examples of org.apache.xerces.xs.XSAttributeDeclaration

     */
    public void testNoAnnotation() {
        XSModel model = fSchemaLoader
                .loadURI(getResourceURL("XSAttributeAnnotationsTest01.xsd"));

        XSAttributeDeclaration attr = model.getAttributeDeclaration("attr",
                "XSAttributeAnnotationsTest");
        XSAnnotation annotation = attr.getAnnotation();

        assertNull(annotation);
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSAttributeDeclaration

     */
    public void testNoAnnotations() {
        XSModel model = fSchemaLoader
                .loadURI(getResourceURL("XSAttributeAnnotationsTest01.xsd"));

        XSAttributeDeclaration attr = model.getAttributeDeclaration("attr",
                "XSAttributeAnnotationsTest");
        XSObjectList annotations = attr.getAnnotations();

        assertEquals(0, annotations.getLength());
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSAttributeDeclaration

     */
    public void testAnnotation() {
        XSModel model = fSchemaLoader
                .loadURI(getResourceURL("XSAttributeAnnotationsTest02.xsd"));

        XSAttributeDeclaration attr = model.getAttributeDeclaration("attr",
                "XSAttributeAnnotationsTest");
        XSAnnotation annotation = attr.getAnnotation();

        String expectedResult = "<annotation id=\"ANNOT1\" "
                + "xmlns=\"http://www.w3.org/2001/XMLSchema\" "
                + "xmlns:sv=\"XSAttributeAnnotationsTest\" >"
                + "<appinfo source=\"None\">"
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.