throw new LocSAXException("Invalid 'extension': Unknown base type " + base, getLocator());
}
if (type.isSimple()) {
throw new LocSAXException("Invalid 'extension': The base type " + base + " is simple.", getLocator());
}
XSComplexType myComplexType = type.getComplexType();
if (myComplexType.hasSimpleContent()) {
throw new LocSAXException("Invalid 'extension': The base type " + base + " has simple content.",
getLocator());
}
XsTTypeDefParticle particle = extension.getTypeDefParticle();
XSGroup group = getGroupByParticle(particle);
XsComplexContentType groupType = getContentTypeByParticle(particle, group);
if (XsComplexContentType.EMPTY.equals(groupType)) {
complexContentType = myComplexType.getComplexContentType();
complexContentParticle = myComplexType.getParticle();
} else if (myComplexType.isEmpty()) {
complexContentType = groupType;
complexContentParticle = new XSParticleImpl(group);
} else {
XSGroup sequenceGroup = new ExtensionGroup(pOwner, new XSParticle[]{myComplexType.getParticle(), new XSParticleImpl(group)});
complexContentParticle = new XSParticleImpl(sequenceGroup);
complexContentType = groupType;
}
XSAttributable[] inheritedAttributes = myComplexType.getAttributes();
XSAttributable[] myAttributes = XSAttributeGroupImpl.getAttributes(XSTypeImpl.this, extension);
attributes = new XSAttributable[inheritedAttributes.length + myAttributes.length];
System.arraycopy(inheritedAttributes, 0, attributes, 0, inheritedAttributes.length);
System.arraycopy(myAttributes, 0, attributes, inheritedAttributes.length, myAttributes.length);
extendedType = type;