Examples of XmlSchemaSimpleTypeRestriction


Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

            return;
        }
       
        // xmlschema:fixed
        XmlSchemaSimpleType fixedSimpleType = new XmlSchemaSimpleType(schema);
        XmlSchemaSimpleTypeRestriction fixedRestriction = new XmlSchemaSimpleTypeRestriction();
        fixedRestriction.setBaseTypeName(Constants.XSD_DECIMAL);
        XmlSchemaTotalDigitsFacet fixedTotalDigits = new XmlSchemaTotalDigitsFacet();
        fixedTotalDigits.setValue(digitsNode.toString());
        XmlSchemaFractionDigitsFacet fixedFractionDigits = new XmlSchemaFractionDigitsFacet();
        fixedFractionDigits.setValue(scaleNode.toString());
        fixedFractionDigits.setFixed(true);
        fixedRestriction.getFacets().add(fixedTotalDigits);
        fixedRestriction.getFacets().add(fixedFractionDigits);
        fixedSimpleType.setName(scopedName.toString());
        fixedSimpleType.setContent(fixedRestriction);

        // add xmlschema:fixed
        setSchemaType(fixedSimpleType);
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

   
    private void visitAnonBoundedString() {
        // xmlschema:bounded anon string
        XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema);
        simpleType.setName(stringScopedName.toString());
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(Constants.XSD_STRING);
        XmlSchemaMaxLengthFacet maxLengthFacet = new XmlSchemaMaxLengthFacet();
        maxLengthFacet.setValue(boundNode.toString());
        restriction.getFacets().add(maxLengthFacet);
        simpleType.setContent(restriction);

        // add schemaType
        schema.getItems().add(simpleType);
        schema.addType(simpleType);
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

   
    private void visitBoundedString() {
        // xmlschema:bounded string
        XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema);
        simpleType.setName(stringScopedName.toString());
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(Constants.XSD_STRING);
        XmlSchemaMaxLengthFacet maxLengthFacet = new XmlSchemaMaxLengthFacet();
        maxLengthFacet.setValue(boundNode.toString());
        restriction.getFacets().add(maxLengthFacet);
        simpleType.setContent(restriction);

        setSchemaType(simpleType);
       
       
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

                               CorbaTypeImpl corbaType) {
        // xmlschema:simpleType
        XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema);
        Scope scopedName = new Scope(getScope(), identifierNode);
        simpleType.setName(scopedName.toString());
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(schemaType.getQName());
        simpleType.setContent(restriction);
       
        // add xmlschema:simpleType
        setSchemaType(simpleType);
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

        // xmlschema:enum
        XmlSchemaSimpleType enumSchemaSimpleType = new XmlSchemaSimpleType(schema);
        enumSchemaSimpleType.setName(enumNameScope.toString());
       
        XmlSchemaSimpleTypeRestriction enumSchemaSimpleTypeRestriction = new XmlSchemaSimpleTypeRestriction();
        enumSchemaSimpleTypeRestriction.setBaseTypeName(Constants.XSD_STRING);
       
        //XmlSchemaSimpleTypeContent xmlSchemaSimpleTypeContent = enumSchemaSimpleTypeRestriction;
        enumSchemaSimpleType.setContent(enumSchemaSimpleTypeRestriction);

       
        // corba:enum
        Enum corbaEnum = new Enum();
        corbaEnum.setQName(new QName(typeMap.getTargetNamespace(), enumNameScope.toString()));
        corbaEnum.setRepositoryID(enumNameScope.toIDLRepositoryID());
        corbaEnum.setType(enumSchemaSimpleType.getQName());
       
       
        AST node = enumNameNode.getNextSibling();
        while (node != null) {
            // xmlschema:enumeration
            XmlSchemaEnumerationFacet enumeration = new XmlSchemaEnumerationFacet();
            enumeration.setValue(node.toString());
            enumSchemaSimpleTypeRestriction.getFacets().add(enumeration);

            // corba:enumerator
            Enumerator enumerator = new Enumerator();
            enumerator.setValue(node.toString());
            corbaEnum.getEnumerator().add(enumerator);
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

    @Override
    public void writeSchema(XmlSchema root) {
        if (serializedWhenUnknown) {
            XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
            simple.setName("serializedJavaObject");
            XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
            simple.setContent(restriction);
            restriction.setBaseTypeName(XmlSchemaConstants.BASE64BINARY_QNAME);
        }
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

       
        XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root);
        simple.setName(getSchemaType().getLocalPart());
        root.addType(simple);
        root.getItems().add(simple);
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(XmlSchemaConstants.STRING_QNAME);
        simple.setContent(restriction);

        Object[] constants = getTypeClass().getEnumConstants();

        XmlSchemaObjectCollection facets = restriction.getFacets();
        for (Object constant : constants) {
            XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
            f.setValue(((Enum)constant).name());
            facets.add(f);
        }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

        if (serializedWhenUnknown) {
            XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root);
            simple.setName("serializedJavaObject");
            root.addType(simple);
            root.getItems().add(simple);
            XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();   
            simple.setContent(restriction);
            restriction.setBaseTypeName(XmlSchemaConstants.BASE64BINARY_QNAME);
        }
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

    public static boolean isEumeration(XmlSchemaSimpleType type) {
        XmlSchemaSimpleTypeContent content = type.getContent();
        if (!(content instanceof XmlSchemaSimpleTypeRestriction)) {
            return false;
        }
        XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
        XmlSchemaObjectCollection facets = restriction.getFacets();
        for (int x = 0; x < facets.getCount(); x++) {
            XmlSchemaFacet facet = (XmlSchemaFacet) facets.getItem(x);
            if (!(facet instanceof XmlSchemaEnumerationFacet)) {
                return false;
            }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction

     * @param type
     * @return
     */
    public static List<String> enumeratorValues(XmlSchemaSimpleType type) {
        XmlSchemaSimpleTypeContent content = type.getContent();
        XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
        XmlSchemaObjectCollection facets = restriction.getFacets();
        List<String> values = new ArrayList<String>();
        for (int x = 0; x < facets.getCount(); x++) {
            XmlSchemaFacet facet = (XmlSchemaFacet) facets.getItem(x);
            XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet;
            values.add(enumFacet.getValue().toString());
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.