Search in sources :

Example 11 with XmlSchemaGroupBase

use of org.apache.ws.commons.schema.XmlSchemaGroupBase 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

XmlSchemaGroupBase (org.apache.ws.commons.schema.XmlSchemaGroupBase)11 XmlSchemaParticle (org.apache.ws.commons.schema.XmlSchemaParticle)11 XmlSchemaComplexType (org.apache.ws.commons.schema.XmlSchemaComplexType)10 XmlSchemaObjectCollection (org.apache.ws.commons.schema.XmlSchemaObjectCollection)9 XmlSchemaSimpleType (org.apache.ws.commons.schema.XmlSchemaSimpleType)8 XmlSchemaElement (org.apache.ws.commons.schema.XmlSchemaElement)7 XmlSchemaObject (org.apache.ws.commons.schema.XmlSchemaObject)6 ParameterInfo (org.talend.designer.webservice.ws.wsdlinfo.ParameterInfo)6 XmlSchemaType (org.apache.ws.commons.schema.XmlSchemaType)5 Iterator (java.util.Iterator)4 XmlSchemaAny (org.apache.ws.commons.schema.XmlSchemaAny)3 XmlSchemaAttribute (org.apache.ws.commons.schema.XmlSchemaAttribute)3 XmlSchemaComplexContentExtension (org.apache.ws.commons.schema.XmlSchemaComplexContentExtension)3 XmlSchemaComplexContentRestriction (org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction)3 ArrayList (java.util.ArrayList)2 QName (javax.xml.namespace.QName)1 AxisMessage (org.apache.axis2.description.AxisMessage)1 XmlSchemaAll (org.apache.ws.commons.schema.XmlSchemaAll)1 XmlSchemaChoice (org.apache.ws.commons.schema.XmlSchemaChoice)1 XmlSchemaSequence (org.apache.ws.commons.schema.XmlSchemaSequence)1