FieldHandlerDef def = (FieldHandlerDef) enumeration.nextElement();
String name = def.getName();
if (_fieldHandlers.containsKey(name)) {
throw new MappingException(Messages.format("mapping.dupFieldHandler", name));
}
Class clazz = resolveType(def.getClazz());
FieldHandler fieldHandler = null;
try {
if (!FieldHandler.class.isAssignableFrom(clazz)) {
throw new MappingException(Messages.format("mapping.classNotFieldHandler",
name, def.getClazz()));
}
fieldHandler = (FieldHandler) clazz.newInstance();
_fieldHandlers.put(name, fieldHandler);
} catch (InstantiationException e) {
throw new MappingException(e);
} catch (IllegalAccessException e) {
throw new MappingException(e);
}
// Add configuration data, if there is any
configureFieldHandler(def, fieldHandler);