}
if (handler == null) {
throw new IllegalArgumentException("handler cannot be null");
}
DefinitionType type = (DefinitionType) definitionTypeRegistry.get(
definitionClass);
if (type != null) {
throw new IllegalArgumentException(
"Definition type for " + definitionClass +
" is already registered");
}
type = new DefinitionType(handler);
definitionTypeRegistry.put(definitionClass, type);
return type;
}