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;
}
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);
}
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());
}
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());
}
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;
}
Aggregations