}
public void init(SGFactory pFactory) {
super.init(pFactory);
sgFactory = pFactory;
SchemaReader schemaReader = pFactory.getGenerator().getSchemaReader();
if (schemaReader instanceof JaxMeSchemaReader) {
JaxMeSchemaReader jaxmeSchemaReader = (JaxMeSchemaReader) schemaReader;
jaxmeSchemaReader.addXsObjectCreator(new XsObjectCreator(){
public XsObject newBean(XsObject pParent, Locator pLocator, XsQName pQName) throws SAXException {
if (pParent instanceof JAXBGlobalBindings) {
if (TAMINOAPI4J_SCHEMA_URI.equals(pQName.getNamespaceURI())) {
if ("raDetails".equals(pQName.getLocalName())) {
if (getRaDetails() != null) {
throw new LocSAXException("An element named " + pQName + " has already been specified.",
pLocator);
}
if (getDbDetails() != null) {
throw new LocSAXException("The elements dbDetails and raDetails are mutually exclusive.",
pLocator);
}
RaDetails details = new RaDetails(pParent);
setRaDetails(details);
return details;
} else if ("dbDetails".equals(pQName.getLocalName())) {
if (getDbDetails() != null) {
throw new LocSAXException("An element named " + pQName + " has already been specified.",
pLocator);
}
if (getRaDetails() != null) {
throw new LocSAXException("The elements dbDetails and raDetails are mutually exclusive.",
pLocator);
}
DbDetails details = new DbDetails(pParent);
setDbDetails(details);
return details;
} else {
throw new LocSAXException("Invalid element name: " + pQName, pLocator);
}
}
}
return null;
}
});
} else {
throw new IllegalStateException("The schema reader " + schemaReader.getClass().getName() +
" is not an instance of " + JaxMeSchemaReader.class.getName());
}
}