Search in sources :

Example 11 with XmlSchemaComplexContentRestriction

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

the class SchemaCollection method addCrossImports.

private void addCrossImports(XmlSchema schema, XmlSchemaContentModel contentModel) {
    if (contentModel == null) {
        return;
    }
    XmlSchemaContent content = contentModel.getContent();
    if (content == null) {
        return;
    }
    if (content instanceof XmlSchemaComplexContentExtension) {
        XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension) content;
        XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
        addCrossImportsAttributeList(schema, extension.getAttributes());
        XmlSchemaParticle particle = extension.getParticle();
        if (particle instanceof XmlSchemaSequence) {
            addCrossImports(schema, (XmlSchemaSequence) particle);
        } else if (particle instanceof XmlSchemaChoice) {
            addCrossImports(schema, (XmlSchemaChoice) particle);
        } else if (particle instanceof XmlSchemaAll) {
            addCrossImports(schema, (XmlSchemaAll) particle);
        }
    } else if (content instanceof XmlSchemaComplexContentRestriction) {
        XmlSchemaComplexContentRestriction restriction = (XmlSchemaComplexContentRestriction) content;
        XmlSchemaUtils.addImportIfNeeded(schema, restriction.getBaseTypeName());
        addCrossImportsAttributeList(schema, restriction.getAttributes());
    } else if (content instanceof XmlSchemaSimpleContentExtension) {
        XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension) content;
        XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
        addCrossImportsAttributeList(schema, extension.getAttributes());
    } else if (content instanceof XmlSchemaSimpleContentRestriction) {
        XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction) content;
        XmlSchemaUtils.addImportIfNeeded(schema, restriction.getBaseTypeName());
        addCrossImportsAttributeList(schema, restriction.getAttributes());
    }
}
Also used : XmlSchemaComplexContentExtension(org.apache.ws.commons.schema.XmlSchemaComplexContentExtension) XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) XmlSchemaSimpleContentExtension(org.apache.ws.commons.schema.XmlSchemaSimpleContentExtension) XmlSchemaAll(org.apache.ws.commons.schema.XmlSchemaAll) XmlSchemaContent(org.apache.ws.commons.schema.XmlSchemaContent) XmlSchemaChoice(org.apache.ws.commons.schema.XmlSchemaChoice) XmlSchemaComplexContentRestriction(org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction) XmlSchemaParticle(org.apache.ws.commons.schema.XmlSchemaParticle) XmlSchemaSimpleContentRestriction(org.apache.ws.commons.schema.XmlSchemaSimpleContentRestriction)

Example 12 with XmlSchemaComplexContentRestriction

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

the class WSDLToCorbaHelper method processComplexContentStruct.

protected Struct processComplexContentStruct(XmlSchemaComplexContent complex, QName defaultName, Struct corbaStruct, QName schematypeName) throws Exception {
    if (complex.getContent() instanceof XmlSchemaComplexContentExtension) {
        XmlSchemaComplexContentExtension extype = (XmlSchemaComplexContentExtension) complex.getContent();
        QName extName = extype.getBaseTypeName();
        corbaStruct = processComplexContentStructParticle(extype.getParticle(), defaultName, corbaStruct, schematypeName, extName, extype.getAttributes());
    } else {
        if (complex.getContent() instanceof XmlSchemaComplexContentRestriction) {
            XmlSchemaComplexContentRestriction extype = (XmlSchemaComplexContentRestriction) complex.getContent();
            QName extName = extype.getBaseTypeName();
            corbaStruct = processComplexContentStructParticle(extype.getParticle(), defaultName, corbaStruct, schematypeName, extName, extype.getAttributes());
        }
    }
    return corbaStruct;
}
Also used : XmlSchemaComplexContentExtension(org.apache.ws.commons.schema.XmlSchemaComplexContentExtension) QName(javax.xml.namespace.QName) XmlSchemaComplexContentRestriction(org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction)

Aggregations

XmlSchemaComplexContentRestriction (org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction)12 XmlSchemaComplexContentExtension (org.apache.ws.commons.schema.XmlSchemaComplexContentExtension)9 XmlSchemaParticle (org.apache.ws.commons.schema.XmlSchemaParticle)7 XmlSchemaComplexType (org.apache.ws.commons.schema.XmlSchemaComplexType)6 XmlSchemaContent (org.apache.ws.commons.schema.XmlSchemaContent)6 QName (javax.xml.namespace.QName)5 XmlSchemaObjectCollection (org.apache.ws.commons.schema.XmlSchemaObjectCollection)5 XmlSchemaSimpleContentExtension (org.apache.ws.commons.schema.XmlSchemaSimpleContentExtension)5 XmlSchemaSimpleContentRestriction (org.apache.ws.commons.schema.XmlSchemaSimpleContentRestriction)5 XmlSchemaContentModel (org.apache.ws.commons.schema.XmlSchemaContentModel)4 XmlSchemaObject (org.apache.ws.commons.schema.XmlSchemaObject)4 XmlSchemaSimpleType (org.apache.ws.commons.schema.XmlSchemaSimpleType)4 XmlSchemaGroupBase (org.apache.ws.commons.schema.XmlSchemaGroupBase)3 XmlSchemaSequence (org.apache.ws.commons.schema.XmlSchemaSequence)3 XmlSchemaType (org.apache.ws.commons.schema.XmlSchemaType)3 XmlSchemaAll (org.apache.ws.commons.schema.XmlSchemaAll)2 XmlSchemaChoice (org.apache.ws.commons.schema.XmlSchemaChoice)2 IOMessageImpl (eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl)1 DefaultPropertyDefinition (eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition)1 ComplexContentHasValue (eu.esdihumboldt.hale.io.xsd.model.ComplexContentHasValue)1