Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSAttributeUse


                .getTypeDefinition("CT", "XSAttributeUseAnnotationsTest");

        XSObjectList attrUses = ct.getAttributeUses();

        // Attr ref
        XSAttributeUse attr = (XSAttributeUse) attrUses.item(0);
        XSObjectList annotations = attr.getAnnotations();
        assertEquals("REF", 0, annotations.getLength());

        // local attr
        attr = (XSAttributeUse) attrUses.item(1);
        annotations = attr.getAnnotations();
        assertEquals("LOCAL", 0, annotations.getLength());

        // attr grp ref
        attr = (XSAttributeUse) attrUses.item(2);
        annotations = attr.getAnnotations();
        assertEquals("GROUP", 0, annotations.getLength());
    }
View Full Code Here


                .getTypeDefinition("CT", "XSAttributeUseAnnotationsTest");

        XSObjectList attrUses = ct.getAttributeUses();

        // Attr ref
        XSAttributeUse attr = (XSAttributeUse) attrUses.item(0);
        XSObjectList annotations = attr.getAnnotations();
        assertEquals("REF", 0, annotations.getLength());

        // local attr
        attr = (XSAttributeUse) attrUses.item(1);
        annotations = attr.getAnnotations();
        assertEquals("LOCAL", 0, annotations.getLength());

        // attr grp ref
        attr = (XSAttributeUse) attrUses.item(2);
        annotations = attr.getAnnotations();
        assertEquals("GROUP", 0, annotations.getLength());
    }
View Full Code Here

                .getTypeDefinition("CT", "XSAttributeUseAnnotationsTest");

        XSObjectList attrUses = ct.getAttributeUses();

        // Attr ref
        XSAttributeUse attr = (XSAttributeUse) attrUses.item(0);
        XSObjectList annotations = attr.getAnnotations();
        assertEquals("REF", 1, annotations.getLength());

        // local attr
        attr = (XSAttributeUse) attrUses.item(1);
        annotations = attr.getAnnotations();
        assertEquals("LOCAL", 1, annotations.getLength());

        // attr grp ref
        attr = (XSAttributeUse) attrUses.item(2);
        annotations = attr.getAnnotations();
        assertEquals("GROUP", 0, annotations.getLength());

    }
View Full Code Here

                .getTypeDefinition("CT", "XSAttributeUseAnnotationsTest");

        XSObjectList attrUses = ct.getAttributeUses();

        // Attr ref
        XSAttributeUse attr = (XSAttributeUse) attrUses.item(0);
        XSObjectList annotations = attr.getAnnotations();
        assertEquals("REF", 1, annotations.getLength());

        // local attr
        attr = (XSAttributeUse) attrUses.item(1);
        annotations = attr.getAnnotations();
        assertEquals("LOCAL", 1, annotations.getLength());

        // attr grp ref
        // The attribute in the group has an annotation element
        attr = (XSAttributeUse) attrUses.item(2);
        annotations = attr.getAnnotations();
        assertEquals("GROUP", 1, annotations.getLength());
    }
View Full Code Here

                .getTypeDefinition("CT", "XSAttributeUseAnnotationsTest");

        XSObjectList attrUses = ct.getAttributeUses();

        // Attr ref
        XSAttributeUse attr = (XSAttributeUse) attrUses.item(0);
        XSObjectList annotations = attr.getAnnotations();
        assertEquals("REF", 1, annotations.getLength());

        // local attr
        attr = (XSAttributeUse) attrUses.item(1);
        annotations = attr.getAnnotations();
        assertEquals("LOCAL", 1, annotations.getLength());

        // attr grp ref
        // The attribute in the group has an annotation element
        attr = (XSAttributeUse) attrUses.item(2);
        annotations = attr.getAnnotations();
        assertEquals("GROUP", 1, annotations.getLength());
    }
View Full Code Here

                .getTypeDefinition("CT", "XSAttributeUseAnnotationsTest");

        XSObjectList attrUses = ct.getAttributeUses();

        // Attr ref
        XSAttributeUse attr = (XSAttributeUse) attrUses.item(0);
        XSObjectList annotations = attr.getAnnotations();
        assertEquals("REF", 1, annotations.getLength());

        XSAnnotation annotation = attr.getAttrDeclaration().getAnnotation();
        String expected = "<annotation sn:att=\"ATT1\"  id=\"ANNOT1\" xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"XSAttributeUseAnnotationsTest\" xmlns:sn=\"SyntheticAnnotationNS\" > "
                + "<appinfo>APPINFO1</appinfo>" + "</annotation>";
        assertEquals("REF_STRING", trim(expected), trim(annotation
                .getAnnotationString()));

        annotations = attr.getAttrDeclaration().getAnnotations();
        assertEquals(
                "REF_STRING_ANNOTATIONS",
                trim(expected),
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));

        // local attr
        attr = (XSAttributeUse) attrUses.item(1);
        annotations = attr.getAnnotations();
        assertEquals("LOCAL", 1, annotations.getLength());

        annotation = attr.getAttrDeclaration().getAnnotation();
        expected = "<annotation sn:att=\"ATT11\"  id=\"ANNOT6\" xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"XSAttributeUseAnnotationsTest\" xmlns:sn=\"SyntheticAnnotationNS\" > "
                + "<appinfo>APPINFO6</appinfo>" + "</annotation>";
        assertEquals("LOCAL_STRING", trim(expected), trim(annotation
                .getAnnotationString()));

        annotations = attr.getAttrDeclaration().getAnnotations();
        assertEquals(
                "LOCAL_STRING_ANNOTATIONS",
                trim(expected),
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));

        // attr grp ref
        // The attribute in the group has an annotation element
        attr = (XSAttributeUse) attrUses.item(2);
        annotations = attr.getAnnotations();
        assertEquals("GROUP", 1, annotations.getLength());

        annotation = attr.getAttrDeclaration().getAnnotation();
        expected = "<annotation id=\"ANNOT3\" xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"XSAttributeUseAnnotationsTest\" xmlns:sn=\"SyntheticAnnotationNS\" > "
                + "<appinfo>APPINFO3</appinfo>" + "</annotation>";
        assertEquals("GROUP_STRING", trim(expected), trim(annotation
                .getAnnotationString()));

        annotations = attr.getAttrDeclaration().getAnnotations();
        assertEquals(
                "GROUP_STRING_ANNOTATIONS",
                trim(expected),
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
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

        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

   private void addAttributeMappings(XSObjectList attributes, JavaXmlTypeMapping jxtm)
   {
      for (int i = 0; i < attributes.getLength(); i++)
      {
         XSAttributeUse obj = (XSAttributeUse)attributes.item(i);
         XSAttributeDeclaration att = obj.getAttrDeclaration();
         XSSimpleTypeDefinition simple = att.getTypeDefinition();
         addJavaXMLTypeMap(simple, "none", "", "", jxtm.getJavaWsdlMapping(), true);
         VariableMapping vm = new VariableMapping(jxtm);
         String name = att.getName();
         vm.setXmlAttributeName(name);
View Full Code Here

      if (xsobjlist != null)
      {
         int len = xsobjlist.getLength();
         for (int i = 0; i < len; i++)
         {
            XSAttributeUse obj = (XSAttributeUse)xsobjlist.item(i);
            XSAttributeDeclaration att = obj.getAttrDeclaration();
            XSSimpleTypeDefinition xstype = att.getTypeDefinition();
            QName qn = SchemaUtils.handleSimpleType(xstype);
            boolean primitive = obj.getRequired();
            VAR v = createVAR(qn, att.getName(), getPackageName(xstype.getNamespace()), primitive);
            if (vars == null)
               vars = new ArrayList();
            vars.add(v);
         }
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.