//process attributes - first look for the explicit attributes
processAttributes(extension.getAttributes(), metaInfHolder, parentSchema);
//process any attribute
//somehow the xml schema parser does not seem to pickup the any attribute!!
XmlSchemaAnyAttribute anyAtt = extension.getAnyAttribute();
if (anyAtt != null) {
processAnyAttribute(metaInfHolder, anyAtt);
}
String className = findClassName(extension.getBaseTypeName(), false);
if (!writer.getDefaultClassName().equals(className)) {
//the particle has been processed, However since this is an extension we need to
//add the basetype as an extension to the complex type class.
// The basetype has been processed already
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
XmlSchema resolvedSchema = getParentSchema(parentSchema,
restriction.getBaseTypeName(),
COMPONENT_TYPE);
if (resolvedSchema == null) {
throw new SchemaCompilationException("can not find the complex type " +
restriction.getBaseTypeName()
+ " from the parent type " +
parentSchema.getTargetNamespace());
} else {
XmlSchemaType type = resolvedSchema.getTypeByName(restriction.getBaseTypeName());
if (type instanceof XmlSchemaComplexType) {
XmlSchemaComplexType complexType = (XmlSchemaComplexType) type;
if (complexType.getName() != null) {
processNamedComplexSchemaType(complexType, resolvedSchema);
} 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.getBaseTypeName(), restriction.getParticle(), metaInfHolder,
parentSchema);
//process attributes - first look for the explicit attributes
processAttributes(restriction.getAttributes(), 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);