if (names != null) {
for (int i = 0; i < names.length; i++) {
XsQName name = names[i];
XSType type = pOwner.getXSSchema().getType(name);
if (type == null) {
throw new LocSAXException("Unknown member type: " + name, pBaseUnion.getLocator());
}
type.validate();
if (!type.isSimple()) {
throw new LocSAXException("The member type " + name + " is complex.",
pBaseUnion.getLocator());
}
memberTypes.add(type);
}
}
XsTLocalSimpleType[] simpleTypes = pBaseUnion.getSimpleTypes();
if (simpleTypes != null) {
for (int i = 0; i < simpleTypes.length; i++) {
XsTLocalSimpleType localSimpleType = simpleTypes[i];
XSType type = pOwner.getXSSchema().getXSObjectFactory().newXSType(pOwner, localSimpleType);
type.validate();
memberTypes.add(type);
}
}
if (memberTypes.size() == 0) {
throw new LocSAXException("Neither the 'memberTypes' attribute nor the 'simpleType' child elements did define a member type.",
pBaseUnion.getLocator());
}
}