ClassLoaderPolicy policy = clpm.getPolicy();
ClassLoader cl = unit.getClassLoader();
for (ClassLoadingTranslatorMetaData cltmd : translators)
{
TranslatorScope scope = cltmd.getScope();
if (scope == null)
throw new IllegalArgumentException("Null scope for: " + cltmd);
String className = cltmd.getClassName();
Object instance = cl.loadClass(className).newInstance();
String methodName = cltmd.getMethod();
Translator translator;
if (methodName != null)
translator = new ReflectionTranslator(instance, methodName);
else
translator = Translator.class.cast(instance);
scope.addTranslator(system, domain, policy, translator);
added.put(translator, scope);
}
unit.addAttachment(TRANSLATORS_KEY, added);
}