Search in sources :

Example 1 with XmlSchemaSimpleTypeUnion

use of org.apache.ws.commons.schema.XmlSchemaSimpleTypeUnion in project hale by halestudio.

the class XmlTypeUtil method configureSimpleType.

/**
 * Configure a type definition for a simple type based on the
 * {@link XmlSchemaSimpleType}.
 *
 * @param type the type definition
 * @param simpleType the schema simple type
 * @param index the XML index for resolving type definitions
 * @param reporter the report
 */
public static void configureSimpleType(XmlTypeDefinition type, XmlSchemaSimpleType simpleType, XmlIndex index, IOReporter reporter) {
    XmlSchemaSimpleTypeContent content = simpleType.getContent();
    // it's a simple type
    type.setConstraint(HasValueFlag.ENABLED);
    if (content instanceof XmlSchemaSimpleTypeUnion) {
        // simple type union
        configureSimpleTypeUnion(type, (XmlSchemaSimpleTypeUnion) content, index, reporter);
    } else if (content instanceof XmlSchemaSimpleTypeList) {
        // simple type list
        configureSimpleTypeList(type, (XmlSchemaSimpleTypeList) content, index, reporter);
    } else if (content instanceof XmlSchemaSimpleTypeRestriction) {
        // simple type restriction
        configureSimpleTypeRestriction(type, (XmlSchemaSimpleTypeRestriction) content, index, reporter);
    } else {
        reporter.error(new IOMessageImpl(MessageFormat.format("Unrecognized simple type {0}", type.getName()), null, simpleType.getLineNumber(), simpleType.getLinePosition()));
    }
}
Also used : XmlSchemaSimpleTypeList(org.apache.ws.commons.schema.XmlSchemaSimpleTypeList) XmlSchemaSimpleTypeRestriction(org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction) IOMessageImpl(eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl) XmlSchemaSimpleTypeContent(org.apache.ws.commons.schema.XmlSchemaSimpleTypeContent) XmlSchemaSimpleTypeUnion(org.apache.ws.commons.schema.XmlSchemaSimpleTypeUnion)

Aggregations

IOMessageImpl (eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl)1 XmlSchemaSimpleTypeContent (org.apache.ws.commons.schema.XmlSchemaSimpleTypeContent)1 XmlSchemaSimpleTypeList (org.apache.ws.commons.schema.XmlSchemaSimpleTypeList)1 XmlSchemaSimpleTypeRestriction (org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction)1 XmlSchemaSimpleTypeUnion (org.apache.ws.commons.schema.XmlSchemaSimpleTypeUnion)1