Search in sources :

Example 21 with XmlSchemaComplexType

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

the class XmlSchemaUtils method getContentAttributes.

public static List<XmlSchemaAnnotated> getContentAttributes(XmlSchemaComplexType type, SchemaCollection collection) {
    List<XmlSchemaAnnotated> results = new ArrayList<>();
    QName baseTypeName = getBaseType(type);
    if (baseTypeName != null) {
        XmlSchemaComplexType baseType = (XmlSchemaComplexType) collection.getTypeByQName(baseTypeName);
        // recurse onto the base type ...
        results.addAll(getContentAttributes(baseType, collection));
        // and now process our sequence.
        List<XmlSchemaAttributeOrGroupRef> extAttrs = getContentAttributes(type);
        results.addAll(extAttrs);
        return results;
    }
    // no base type, the simple case.
    List<XmlSchemaAttributeOrGroupRef> attrs = type.getAttributes();
    results.addAll(attrs);
    return results;
}
Also used : QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) XmlSchemaAnnotated(org.apache.ws.commons.schema.XmlSchemaAnnotated) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType) XmlSchemaAttributeOrGroupRef(org.apache.ws.commons.schema.XmlSchemaAttributeOrGroupRef)

Example 22 with XmlSchemaComplexType

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

the class ImportRepairTest method createDerivedType2.

private void createDerivedType2(XmlSchema importingSchema) {
    XmlSchemaComplexContent complexContent;
    XmlSchemaComplexType derivedType2 = new XmlSchemaComplexType(importingSchema, true);
    derivedType2.setName("derivedRestriction");
    XmlSchemaComplexContentRestriction restriction = new XmlSchemaComplexContentRestriction();
    restriction.setBaseTypeName(new QName(BASE_TYPE_SCHEMA2, "baseType2"));
    complexContent = new XmlSchemaComplexContent();
    complexContent.setContent(restriction);
    derivedType2.setContentModel(complexContent);
}
Also used : QName(javax.xml.namespace.QName) XmlSchemaComplexContentRestriction(org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType) XmlSchemaComplexContent(org.apache.ws.commons.schema.XmlSchemaComplexContent)

Example 23 with XmlSchemaComplexType

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

the class ImportRepairTest method createTypeImportedByElement.

private void createTypeImportedByElement(XmlSchema elementTypeSchema) {
    XmlSchemaComplexType elementImportedType = new XmlSchemaComplexType(elementTypeSchema, true);
    elementImportedType.setName("importedElementType");
    elementImportedType.setParticle(new XmlSchemaSequence());
}
Also used : XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType)

Example 24 with XmlSchemaComplexType

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

the class ImportRepairTest method createBaseType1.

private void createBaseType1(XmlSchema baseTypeSchema1) {
    XmlSchemaComplexType baseType1 = new XmlSchemaComplexType(baseTypeSchema1, true);
    baseType1.setName("baseType1");
    baseType1.setParticle(new XmlSchemaSequence());
}
Also used : XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType)

Example 25 with XmlSchemaComplexType

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

the class ImportRepairTest method createBaseType2.

private XmlSchemaComplexType createBaseType2(XmlSchema baseTypeSchema2) {
    XmlSchemaComplexType baseType2 = new XmlSchemaComplexType(baseTypeSchema2, true);
    baseType2.setName("baseType2");
    baseType2.setParticle(new XmlSchemaSequence());
    return baseType2;
}
Also used : XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType)

Aggregations

XmlSchemaComplexType (org.apache.ws.commons.schema.XmlSchemaComplexType)88 XmlSchemaElement (org.apache.ws.commons.schema.XmlSchemaElement)60 QName (javax.xml.namespace.QName)45 XmlSchemaSequence (org.apache.ws.commons.schema.XmlSchemaSequence)38 XmlSchemaSimpleType (org.apache.ws.commons.schema.XmlSchemaSimpleType)25 XmlSchemaType (org.apache.ws.commons.schema.XmlSchemaType)25 XmlSchema (org.apache.ws.commons.schema.XmlSchema)24 Test (org.junit.Test)18 XmlSchemaComplexContentExtension (org.apache.ws.commons.schema.XmlSchemaComplexContentExtension)13 XmlSchemaObject (org.apache.ws.commons.schema.XmlSchemaObject)12 XmlSchemaParticle (org.apache.ws.commons.schema.XmlSchemaParticle)12 XmlSchemaObjectCollection (org.apache.ws.commons.schema.XmlSchemaObjectCollection)11 XmlSchemaSequenceMember (org.apache.ws.commons.schema.XmlSchemaSequenceMember)11 XmlSchemaGroupBase (org.apache.ws.commons.schema.XmlSchemaGroupBase)10 FeatureMetacardType (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType)8 ParameterInfo (org.talend.designer.webservice.ws.wsdlinfo.ParameterInfo)8 ArrayList (java.util.ArrayList)7 AbstractAegisTest (org.apache.cxf.aegis.AbstractAegisTest)7 XmlSchemaAttribute (org.apache.ws.commons.schema.XmlSchemaAttribute)7 XmlSchemaComplexContentRestriction (org.apache.ws.commons.schema.XmlSchemaComplexContentRestriction)6