Search in sources :

Example 26 with XmlSchemaParticle

use of org.apache.ws.commons.schema.XmlSchemaParticle in project tomee by apache.

the class CommonsSchemaInfoBuilder method getNestedElements.

private static List<XmlSchemaElement> getNestedElements(XmlSchemaComplexType complexType) {
    List<XmlSchemaElement> elements = new ArrayList<>();
    XmlSchemaParticle particle = complexType.getParticle();
    if (particle instanceof XmlSchemaElement) {
        XmlSchemaElement element = (XmlSchemaElement) particle;
        elements.add(element);
    } else if (particle instanceof XmlSchemaGroupBase && !(particle instanceof XmlSchemaChoice)) {
        XmlSchemaGroupBase groupBase = (XmlSchemaGroupBase) particle;
        for (Iterator iterator = groupBase.getItems().getIterator(); iterator.hasNext(); ) {
            XmlSchemaParticle child = (XmlSchemaParticle) iterator.next();
            if (child instanceof XmlSchemaElement) {
                XmlSchemaElement element = (XmlSchemaElement) child;
                elements.add(element);
            }
        }
    } else {
    // ignore all other types... you can have these other types, but JAX-RPC doesn't support them
    }
    return elements;
}
Also used : XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) XmlSchemaChoice(org.apache.ws.commons.schema.XmlSchemaChoice) XmlSchemaParticle(org.apache.ws.commons.schema.XmlSchemaParticle) XmlSchemaGroupBase(org.apache.ws.commons.schema.XmlSchemaGroupBase)

Aggregations

XmlSchemaParticle (org.apache.ws.commons.schema.XmlSchemaParticle)26 XmlSchemaElement (org.apache.ws.commons.schema.XmlSchemaElement)15 XmlSchemaSequence (org.apache.ws.commons.schema.XmlSchemaSequence)13 XmlSchemaComplexType (org.apache.ws.commons.schema.XmlSchemaComplexType)12 XmlSchemaGroupBase (org.apache.ws.commons.schema.XmlSchemaGroupBase)11 XmlSchemaObjectCollection (org.apache.ws.commons.schema.XmlSchemaObjectCollection)11 XmlSchemaChoice (org.apache.ws.commons.schema.XmlSchemaChoice)10 XmlSchemaObject (org.apache.ws.commons.schema.XmlSchemaObject)10 XmlSchemaSimpleType (org.apache.ws.commons.schema.XmlSchemaSimpleType)8 XmlSchemaComplexContentExtension (org.apache.ws.commons.schema.XmlSchemaComplexContentExtension)7 XmlSchemaComplexContentRestriction (org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction)7 QName (javax.xml.namespace.QName)6 ParameterInfo (org.talend.designer.webservice.ws.wsdlinfo.ParameterInfo)6 Iterator (java.util.Iterator)5 XmlSchemaAll (org.apache.ws.commons.schema.XmlSchemaAll)5 XmlSchemaAny (org.apache.ws.commons.schema.XmlSchemaAny)5 XmlSchemaType (org.apache.ws.commons.schema.XmlSchemaType)5 ArrayList (java.util.ArrayList)4 XmlSchemaAttribute (org.apache.ws.commons.schema.XmlSchemaAttribute)4 XmlSchemaContent (org.apache.ws.commons.schema.XmlSchemaContent)4