final String pluginCategory = plugin.category();
final Map<String, PluginType<?>> map = REGISTRY.getCategory(pluginCategory);
String type = plugin.elementType().equals(Plugin.EMPTY) ? plugin.name() : plugin.elementType();
PluginType<?> pluginType = new PluginType(clazz, type, plugin.printObject(), plugin.deferChildren());
map.put(plugin.name().toLowerCase(), pluginType);
final PluginAliases pluginAliases = clazz.getAnnotation(PluginAliases.class);
if (pluginAliases != null) {
for (String alias : pluginAliases.value()) {
type = plugin.elementType().equals(Plugin.EMPTY) ? alias : plugin.elementType();
pluginType = new PluginType(clazz, type, plugin.printObject(), plugin.deferChildren());
map.put(alias.trim().toLowerCase(), pluginType);
}
}