}
XSObjectFactory factory = pParent.getXSSchema().getXSObjectFactory();
if (myComplexType.isExtension()) {
XSType extendedType = myComplexType.getSimpleContent().getType();
extendedType.validate();
XSSimpleType extendedSimpleType = extendedType.getSimpleType();
XSSimpleType mySimpleType;
if (extendedSimpleType.isAtomic()) {
mySimpleType = factory.newXSAtomicType(this, extendedType, pRestriction);
} else if (extendedSimpleType.isList()) {
mySimpleType = factory.newXSListType(this, extendedType, pRestriction);
} else if (extendedSimpleType.isUnion()) {
mySimpleType = factory.newXSUnionType(this, extendedType, pRestriction);
} else {
throw new LocSAXException("Unknown restriction type: " + extendedType,
pRestriction.getLocator());
}
simpleType = mySimpleType;
//was: setSimpleType( extendedType.getSimpleType() );
} else {
XsTLocalSimpleType localSimpleType = pRestriction.getSimpleType();
XSType restrictedType;
if (localSimpleType != null) {
restrictedType = factory.newXSType(this, localSimpleType);
} else {
restrictedType = myComplexType.getSimpleContent().getType();
}
restrictedType.validate();
XSSimpleType restrictedSimpleType = restrictedType.getSimpleType();
if (restrictedSimpleType.isAtomic()) {
simpleType = factory.newXSAtomicType(this, restrictedType, pRestriction);
} else if (restrictedSimpleType.isList()) {
simpleType = factory.newXSListType(this, restrictedType, pRestriction);
} else if (restrictedSimpleType.isUnion()) {
simpleType = factory.newXSUnionType(this, restrictedType, pRestriction);
}
}
this.name = null;
isSimple = true;