/** <p>Adds the given object to the schema.</p>
*
*/
protected void add(XsESchema pSyntaxSchema, Object pChild) throws SAXException {
XSSchema mySchema = getSchema();
XSContext data = getData();
XSObjectFactory factory = data.getXSObjectFactory();
if (pChild instanceof XsEAnnotation) {
XsEAnnotation annotation = (XsEAnnotation) pChild;
mySchema.add(factory.newXSAnnotation(mySchema, annotation));
} else if (pChild instanceof XsETopLevelSimpleType) {
XsETopLevelSimpleType type = (XsETopLevelSimpleType) pChild;
mySchema.add(factory.newXSType(mySchema, type));
} else if (pChild instanceof XsTComplexType) {
XsTComplexType type = (XsTComplexType) pChild;
mySchema.add(factory.newXSType(mySchema, type));
} else if (pChild instanceof XsTNamedGroup) {
XsTNamedGroup group = (XsTNamedGroup) pChild;
mySchema.add(factory.newXSGroup(mySchema, group));
} else if (pChild instanceof XsTAttributeGroup) {
XsTAttributeGroup attributeGroup = (XsTAttributeGroup) pChild;
mySchema.add(factory.newXSAttributeGroup(mySchema, attributeGroup));
} else if (pChild instanceof XsTTopLevelElement) {
XsTTopLevelElement element = (XsTTopLevelElement) pChild;
mySchema.add(factory.newXSElement(mySchema, element));
} else if (pChild instanceof XsTAttribute) {
XsTAttribute attribute = (XsTAttribute) pChild;
mySchema.add(factory.newXSAttribute(mySchema, attribute));
} else if (pChild instanceof XsENotation) {
XsENotation notation = (XsENotation) pChild;
mySchema.add(factory.newXSNotation(mySchema, notation));
} else {
Locator locator = (pChild instanceof XsObject) ?
((XsObject) pChild).getLocator() : pSyntaxSchema.getLocator();
throw new LocSAXException("Unknown child type: " + pChild.getClass().getName() +
", perhaps you should handle this in a subclass?", locator);