Search in sources :

Example 6 with XmlSchemaFacet

use of org.apache.ws.commons.schema.XmlSchemaFacet in project cxf by apache.

the class EnumType method writeSchema.

@Override
public void writeSchema(XmlSchema root) {
    XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
    simple.setName(getSchemaType().getLocalPart());
    XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
    restriction.setBaseTypeName(Constants.XSD_STRING);
    simple.setContent(restriction);
    Object[] constants = getTypeClass().getEnumConstants();
    List<XmlSchemaFacet> facets = restriction.getFacets();
    for (Object constant : constants) {
        XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
        f.setValue(getValue(constant));
        facets.add(f);
    }
}
Also used : XmlSchemaFacet(org.apache.ws.commons.schema.XmlSchemaFacet) XmlSchemaSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleType) XmlSchemaSimpleTypeRestriction(org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction) XmlSchemaEnumerationFacet(org.apache.ws.commons.schema.XmlSchemaEnumerationFacet)

Aggregations

XmlSchemaFacet (org.apache.ws.commons.schema.XmlSchemaFacet)6 XmlSchemaEnumerationFacet (org.apache.ws.commons.schema.XmlSchemaEnumerationFacet)4 XmlSchemaSimpleTypeRestriction (org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction)4 XmlSchemaSimpleTypeContent (org.apache.ws.commons.schema.XmlSchemaSimpleTypeContent)2 ArrayList (java.util.ArrayList)1 QName (javax.xml.namespace.QName)1 Anonfixed (org.apache.cxf.binding.corba.wsdl.Anonfixed)1 CorbaType (org.apache.cxf.binding.corba.wsdl.CorbaType)1 Enum (org.apache.cxf.binding.corba.wsdl.Enum)1 Enumerator (org.apache.cxf.binding.corba.wsdl.Enumerator)1 Fixed (org.apache.cxf.binding.corba.wsdl.Fixed)1 XmlSchemaFractionDigitsFacet (org.apache.ws.commons.schema.XmlSchemaFractionDigitsFacet)1 XmlSchemaLengthFacet (org.apache.ws.commons.schema.XmlSchemaLengthFacet)1 XmlSchemaMaxLengthFacet (org.apache.ws.commons.schema.XmlSchemaMaxLengthFacet)1 XmlSchemaSimpleType (org.apache.ws.commons.schema.XmlSchemaSimpleType)1 XmlSchemaTotalDigitsFacet (org.apache.ws.commons.schema.XmlSchemaTotalDigitsFacet)1 XmlSchemaType (org.apache.ws.commons.schema.XmlSchemaType)1