Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSFacet


                "XSFacetTest");

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

        XSAnnotation annotation = fractionDigits.getAnnotation();
        assertEquals("TEST9_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = fractionDigits.getAnnotations();
        assertEquals(
                "TES79_ANNOTATIONS_" + synth,
                expected,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
    }
View Full Code Here


                .getTypeDefinition();
        XSAttributeUse attr = (XSAttributeUse) ct.getAttributeUses().item(0);
        XSSimpleTypeDefinition st = attr.getAttrDeclaration()
                .getTypeDefinition();
        // Item 0 is minInclusive
        XSFacet fractionDigits = (XSFacet) st.getFacets().item(1);

        XSAnnotation annotation = fractionDigits.getAnnotation();
        assertEquals("TEST10_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = fractionDigits.getAnnotations();
        assertEquals(
                "TES10_ANNOTATIONS_" + synth,
                expected,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
    }
View Full Code Here

                .loadURI(getResourceURL("XSFacetTest01.xsd"));

        XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) model
                .getTypeDefinition("ST7", "XSFacetTest");
        // Item 0 is minInclusive
        XSFacet maxInclusive = (XSFacet) st.getFacets().item(1);

        XSAnnotation annotation = maxInclusive.getAnnotation();
        assertEquals("TEST11_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = maxInclusive.getAnnotations();
        assertEquals(
                "TES11_ANNOTATIONS_" + synth,
                expected,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
    }
View Full Code Here

                .loadURI(getResourceURL("XSFacetTest01.xsd"));

        XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) model
                .getTypeDefinition("ST8", "XSFacetTest");
        // Item 0 is minInclusive
        XSFacet length = (XSFacet) st.getFacets().item(1);

        XSAnnotation annotation = length.getAnnotation();
        assertEquals("TEST12_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = length.getAnnotations();
        assertEquals(
                "TES12_ANNOTATIONS_" + synth,
                expected,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
    }
View Full Code Here

        XSSimpleTypeDefinition stu = (XSSimpleTypeDefinition) model
                .getTypeDefinition("ST9", "XSFacetTest");
        XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) stu
                .getMemberTypes().item(0);
        // Item 0 is minInclusive
        XSFacet length = (XSFacet) st.getFacets().item(1);

        XSAnnotation annotation = length.getAnnotation();
        assertEquals("TEST12_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = length.getAnnotations();
        assertEquals(
                "TES13_ANNOTATIONS_" + synth,
                expected,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
    }
View Full Code Here

                .loadURI(getResourceURL("XSFacetTest01.xsd"));

        XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) model
                .getTypeDefinition("ST10", "XSFacetTest");
        // Item 0 is minInclusive
        XSFacet minLength = (XSFacet) st.getFacets().item(1);

        XSAnnotation annotation = minLength.getAnnotation();
        assertEquals("TEST14_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = minLength.getAnnotations();
        assertEquals(
                "TES14_ANNOTATIONS_" + synth,
                expected,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));

        if (synth.booleanValue() == true) {
            // Item 0 is minInclusive
            XSFacet maxLength = (XSFacet) st.getFacets().item(2);

            annotation = maxLength.getAnnotation();
            assertEquals("TEST14_ANNOTATION_" + synth, expected1,
                    trim(annotation.getAnnotationString()));
            annotations = maxLength.getAnnotations();
            assertEquals("TES14_ANNOTATIONS_" + synth, expected1,
                    trim(((XSAnnotation) annotations.item(0))
                            .getAnnotationString()));
        }
    }
View Full Code Here

                .loadURI(getResourceURL("XSFacetTest01.xsd"));

        XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) model
                .getTypeDefinition("ST11", "XSFacetTest");
        // Item 0 is minInclusive
        XSFacet maxLength = (XSFacet) st.getFacets().item(1);

        if (synth.booleanValue() == true) {
            XSAnnotation annotation = maxLength.getAnnotation();
            assertEquals("TEST15_ANNOTATION_" + synth, expected,
                    trim(annotation.getAnnotationString()));
            XSObjectList annotations = maxLength.getAnnotations();
            assertEquals("TES15_ANNOTATIONS_" + synth, expected,
                    trim(((XSAnnotation) annotations.item(0))
                            .getAnnotationString()));
        } else {
            XSAnnotation annotation = maxLength.getAnnotation();
            assertNull("TEST15_ANNOTATION_" + synth, annotation);
            XSObjectList annotations = maxLength.getAnnotations();
            assertEquals("TES15_ANNOTATIONS_" + synth, 0, annotations
                    .getLength());
        }
    }
View Full Code Here

                "XSFacetTest");

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

        XSAnnotation annotation = maxLength.getAnnotation();
        assertEquals("TEST16_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = maxLength.getAnnotations();
        assertEquals(
                "TES16_ANNOTATIONS_" + synth,
                expected,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
    }
View Full Code Here

        }
        else {
            sendIndentedElement("psv:facets");
            if (facets != null) {
                for (int i = 0; i < facets.getLength(); i++) {
                    XSFacet facet = (XSFacet)facets.item(i);
                    String name = this.translateFacetKind(facet.getFacetKind());
                    sendIndentedElement("psv:" + name);
                    sendElementEvent("psv:value", facet.getLexicalFacetValue());
                    sendElementEvent(
                        "psv:fixed",
                        String.valueOf(facet.getFixed()));
                    processPSVIAnnotation(facet.getAnnotation());
                    sendUnIndentedElement("psv:" + name);
                }
            }
            if (multiValueFacets != null) {
                for (int i = 0; i < multiValueFacets.getLength(); i++) {
                    XSMultiValueFacet facet =
                        (XSMultiValueFacet)multiValueFacets.item(i);
                    String name = this.translateFacetKind(facet.getFacetKind());
                    sendIndentedElement("psv:" + name);
                    StringList values = facet.getLexicalFacetValues();
                    for (int j = 0; j < values.getLength(); j++) {
                        sendElementEvent("psv:value", values.item(j));
                    }
                    sendElementEvent("psv:fixed", "false");
                    processPSVIAnnotations(facet.getAnnotations());
                    sendUnIndentedElement("psv:" + name);
                }
            }
            sendUnIndentedElement("psv:facets");
        }
View Full Code Here

TOP

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

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.