metaInfHolder.setExtension(true);
metaInfHolder.setExtensionClassName(className);
//Note - this is no array! so the array boolean is false
}
}else if (content instanceof XmlSchemaComplexContentRestriction){
XmlSchemaComplexContentRestriction restriction = (XmlSchemaComplexContentRestriction) content;
//process the base type if it has not been processed yet
if (!isAlreadyProcessed(restriction.getBaseTypeName())){
//pick the relevant basetype from the schema and process it
XmlSchemaType type = getType(parentSchema, restriction.getBaseTypeName());
if (type instanceof XmlSchemaComplexType) {
XmlSchemaComplexType complexType = (XmlSchemaComplexType) type;
if (complexType.getName() != null) {
processNamedComplexSchemaType(complexType,parentSchema);
} else {
//this is not possible. The restriction should always
//have a name
throw new SchemaCompilationException("Unnamed complex type used in restriction");//Internationlize this
}
} else if (type instanceof XmlSchemaSimpleType) {
throw new SchemaCompilationException("Not a valid restriction, complex content restriction base type cannot be a simple type.");
}
}
copyMetaInfoHierarchy(metaInfHolder,restriction.getBaseTypeName(),parentSchema);
//process the particle of this node
processParticle(restriction.getParticle(),metaInfHolder,parentSchema);
//process attributes - first look for the explicit attributes
XmlSchemaObjectCollection attribs = restriction.getAttributes();
Iterator attribIterator = attribs.getIterator();
while (attribIterator.hasNext()) {
Object o = attribIterator.next();
if (o instanceof XmlSchemaAttribute) {
processAttribute((XmlSchemaAttribute) o, metaInfHolder,parentSchema);
}
}
//process any attribute
//somehow the xml schema parser does not seem to pickup the any attribute!!
XmlSchemaAnyAttribute anyAtt = restriction.getAnyAttribute();
if (anyAtt != null) {
processAnyAttribute(metaInfHolder,anyAtt);
}
String className = findClassName(restriction.getBaseTypeName(), false);
if (!SchemaCompiler.DEFAULT_CLASS_NAME.equals(className)) {
metaInfHolder.setRestriction(true);
metaInfHolder.setRestrictionClassName(findClassName(restriction.getBaseTypeName(), false));
//Note - this is no array! so the array boolean is false
}
}
}