{
try
{
for (Iterator iter = getJavaMetaData().iterator(); iter.hasNext();)
{
JavaMetaData metadata = (JavaMetaData)iter.next();
String factoryInterface = metadata.getFactoryInterface();
if (factoryInterface != null)
{
Class factoryInterfaceClass = classLoader.loadClass(factoryInterface);
SDOUtil.registerStaticTypes(factoryInterfaceClass);
}
else
{
String typeInterface = metadata.getTypeInterface();
Class typeInterfaceClass = classLoader.loadClass(typeInterface);
// TODO: introspect and register the type
}
}
XSDHelper xsdHelper = SDOUtil.createXSDHelper(typeHelper);
for (Iterator iter = getXsdMetaData().iterator(); iter.hasNext();)
{
XSDMetaData metadata = (XSDMetaData)iter.next();
URL url = getClass().getResource(metadata.getLocation());
InputStream inputStream = url.openStream();
xsdHelper.define(inputStream, url.toString());
}
XMLHelper xmlHelper = SDOUtil.createXMLHelper(typeHelper);
for (Iterator iter = getTypeMetaData().iterator(); iter.hasNext();)
{
TypeMetaData metadata = (TypeMetaData)iter.next();
URL url = getClass().getResource(metadata.getLocation());
InputStream inputStream = url.openStream();
XMLDocument xmlDocument = xmlHelper.load(inputStream);
Types types = (Types)xmlDocument.getRootObject();
typeHelper.define(types.getTypeList());
}