Examples of XSFacet


Examples of org.apache.xerces.xs.XSFacet

        }
        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

Examples of org.apache.xerces.xs.XSFacet

        }
       
        // handling single-valued Facets
        XSObjectList facets = simpleTypeDefn.getFacets();
        for (int facetIdx = 0; facetIdx < facets.getLength(); facetIdx++) {
            XSFacet facet = (XSFacet) facets.item(facetIdx);                       
            String facetName = getFacetName(facet.getFacetKind());
            String facetValue = facet.getLexicalFacetValue();
            Element facetDomNode = document.createElementNS(
                                            XSD_LANGUAGE_URI,
                                            XSD_LANGUAGE_PREFIX +
                                            facetName);
            facetDomNode.setAttributeNS(null, "value", facetValue);
View Full Code Here

Examples of org.apache.xerces.xs.XSFacet

        }
       
        // handling single-valued Facets
        XSObjectList facets = simpleTypeDefn.getFacets();
        for (int facetIdx = 0; facetIdx < facets.getLength(); facetIdx++) {
            XSFacet facet = (XSFacet) facets.item(facetIdx);                       
            String facetName = getFacetName(facet.getFacetKind());
            String facetValue = facet.getLexicalFacetValue();
            Element facetDomNode = document.createElementNS(
                                            XSD_LANGUAGE_URI,
                                            XSD_LANGUAGE_PREFIX +
                                            facetName);
            facetDomNode.setAttributeNS(null, "value", facetValue);
View Full Code Here

Examples of org.apache.xerces.xs.XSFacet

        }
        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

Examples of org.apache.xerces.xs.XSFacet

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

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

        XSAnnotation annotation = length.getAnnotation();
        assertNull("TEST1_NO_ANNOTATION_" + synth, annotation);
        XSObjectList annotations = length.getAnnotations();
        assertEquals("TEST1_NO_ANNOTATIONS_" + synth, 0, annotations
                .getLength());
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSFacet

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

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

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

        XSFacet maxLength = (XSFacet) st.getFacets().item(2);
        annotation = maxLength.getAnnotation();
        assertEquals("TEST2_NO_ANNOTATION_" + synth, expected2, trim(annotation
                .getAnnotationString()));
        annotations = maxLength.getAnnotations();
        assertEquals(
                "TEST2_NO_ANNOTATIONS_" + synth,
                expected2,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSFacet

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

        XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) model
                .getTypeDefinition("ST3", "XSFacetTest");
        XSFacet whitespace = (XSFacet) st.getFacets().item(0);

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

Examples of org.apache.xerces.xs.XSFacet

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

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

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

Examples of org.apache.xerces.xs.XSFacet

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

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

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

Examples of org.apache.xerces.xs.XSFacet

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

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

        XSAnnotation annotation = fractionDigits.getAnnotation();
        assertEquals("TEST6_ANNOTATION_" + synth, expected, trim(annotation
                .getAnnotationString()));
        XSObjectList annotations = fractionDigits.getAnnotations();
        assertEquals(
                "TES6_ANNOTATIONS_" + synth,
                expected,
                trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
    }
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.