List<TypeDefinition> typesList = null;
if (typeCreatorClassName != null) {
Object obj = null;
TypeCreator typeCreator = null;
try {
obj = Class.forName(typeCreatorClassName).newInstance();
} catch (InstantiationException e) {
throw new RuntimeException(
"Illegal class to create type system, must implement TypeCreator interface.", e);
} catch (IllegalAccessException e) {
throw new RuntimeException(
"Illegal class to create type system, must implement TypeCreator interface.", e);
} catch (ClassNotFoundException e) {
throw new RuntimeException(
"Illegal class to create type system, must implement TypeCreator interface.", e);
}
if (obj instanceof TypeCreator) {
typeCreator = (TypeCreator) obj;
} else {
throw new RuntimeException("Illegal class to create type system, must implement TypeCreator interface.");
}
// retrieve the list of available types from the configured class.
// test
typesList = typeCreator.createTypesList();
}
return typesList;
}