Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSAnnotation


        XSComplexTypeDefinition ct = (XSComplexTypeDefinition) model
                .getTypeDefinition("CT3", "XSModelGroup");
        XSParticle particle = ct.getParticle();
        XSModelGroup group = (XSModelGroup) particle.getTerm();

        XSAnnotation annotation = group.getAnnotation();
        assertEquals("TEST9_NO_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = group.getAnnotations();
        assertEquals("TEST9_NO_ANNOTATIONS_" + synth, 1, annotations
                .getLength());
        assertEquals(
View Full Code Here


        // 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",
View Full Code Here

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

        XSNotationDeclaration notation = model.getNotationDeclaration(
                "notation1", "XSNotationAnnotationsTest");
        XSAnnotation annotation = notation.getAnnotation();
        assertNull("TEST1_NO_ANNOTATION", annotation);

        XSObjectList annotations = notation.getAnnotations();
        assertEquals("TEST1_NO_ANNOTATIONS", 0, annotations.getLength());
View Full Code Here

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

        XSNotationDeclaration notation = model.getNotationDeclaration(
                "notation2", "XSNotationAnnotationsTest");
        XSAnnotation annotation = notation.getAnnotation();
        assertNotNull("TEST2_ANNOTATION", annotation);

        XSObjectList annotations = notation.getAnnotations();
        assertEquals("TEST2_ANNOTATIONS", 1, annotations.getLength());
    }
View Full Code Here

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

        XSNotationDeclaration notation = model.getNotationDeclaration(
                "notation2", "XSNotationAnnotationsTest");
        XSAnnotation annotation = notation.getAnnotation();
        assertNull("TEST3_NO_ANNOTATION", annotation);

        XSObjectList annotations = notation.getAnnotations();
        assertEquals("TEST3_NO_ANNOTATIONS", 0, annotations.getLength());
View Full Code Here

        String expected = "<annotation id=\"ANNOT1\" xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"XSNotationAnnotationsTest\" xmlns:sn=\"SyntheticAnnotation\" > "
                + "<appinfo>APPINFO1</appinfo>" + "</annotation>";

        XSNotationDeclaration notation = model.getNotationDeclaration(
                "notation3", "XSNotationAnnotationsTest");
        XSAnnotation annotation = notation.getAnnotation();
        assertNotNull("TEST4_ANNOTATION", annotation);
        assertEquals("TEST4_ANNOTATION_EQ", trim(expected), trim(annotation
                .getAnnotationString()));

        XSObjectList annotations = notation.getAnnotations();
        assertEquals("TEST4_ANNOTATIONS", 1, annotations.getLength());
        assertEquals(
View Full Code Here

        String expected = "<annotation sn:att=\"synth\" id=\"ANNOT2\" xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"XSNotationAnnotationsTest\" xmlns:sn=\"SyntheticAnnotation\" > "
                + "<documentation>DOC1</documentation>" + "</annotation>";

        XSNotationDeclaration notation = model.getNotationDeclaration(
                "notation4", "XSNotationAnnotationsTest");
        XSAnnotation annotation = notation.getAnnotation();
        assertNotNull("TEST5_ANNOTATION", annotation);
        assertEquals("TEST5_ANNOTATION_EQ", trim(expected), trim(annotation
                .getAnnotationString()));

        XSObjectList annotations = notation.getAnnotations();
        assertEquals("TEST5_ANNOTATIONS", 1, annotations.getLength());
        assertEquals(
View Full Code Here

        XSElementDeclaration elem = model.getElementDeclaration("test",
                "XSWildcardTest");
        XSWildcard attrWC = ((XSComplexTypeDefinition) elem.getTypeDefinition())
                .getAttributeWildcard();

        XSAnnotation annotation = attrWC.getAnnotation();
        assertNull("TEST1_ATTRWC_NO_ANNOTATION", annotation);

        XSObjectList annotations = attrWC.getAnnotations();
        assertEquals("TEST1_ATTRWC_NO_ANNOTATIONS", 0, annotations.getLength());
View Full Code Here

        XSElementDeclaration elem = model.getElementDeclaration("root",
                "XSWildcardTest");
        XSWildcard attrWC = ((XSComplexTypeDefinition) elem.getTypeDefinition())
                .getAttributeWildcard();

        XSAnnotation annotation = attrWC.getAnnotation();
        assertEquals("TEST2_ATTRWC_ANNOTATION_" + synthetic, expected,
                trim(annotation.getAnnotationString()));

        XSObjectList annotations = attrWC.getAnnotations();
        assertEquals(
                "TEST2_ATTRWC_ANNOTATIONS_" + synthetic,
                expected,
View Full Code Here

        XSAttributeGroupDefinition attgp = model.getAttributeGroup("attgrp",
                "XSWildcardTest");
        XSWildcard attrWC = attgp.getAttributeWildcard();

        XSAnnotation annotation = attrWC.getAnnotation();
        assertEquals("TEST3_ATTRWC_ANNOTATION_" + synthetic, expected,
                trim(annotation.getAnnotationString()));

        XSObjectList annotations = attrWC.getAnnotations();
        assertEquals(
                "TEST3_ATTRWC_ANNOTATIONS_" + synthetic,
                expected,
View Full Code Here

TOP

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

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.