Examples of XmlSchemaSimpleTypeRestriction


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

    @Override
    public void writeSchema(XmlSchema root) {

        XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
        simple.setName(getSchemaType().getLocalPart());
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(XmlSchemaConstants.STRING_QNAME);
        simple.setContent(restriction);

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

        List<XmlSchemaFacet> facets = restriction.getFacets();
        for (Object constant : constants) {
            XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
            f.setValue(((Enum)constant).name());
            facets.add(f);
        }
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.