Map<Class, Transformer> tMap = new HashMap<Class, Transformer>();
for (Transformer t : Lookup.getDefault().lookupAll(Transformer.class)) {
tMap.put(t.getClass(), t);
}
for (TransformerUI ui : Lookup.getDefault().lookupAll(TransformerUI.class)) {
Transformer t = tMap.get(ui.getTransformerClass());
if (t != null) {
TransformerCategory c = ui.getCategory();
if (t.isNode()) {
Set<TransformerUI> uis = transformers.get(NODE_ELEMENT).get(c);
if (uis == null) {
uis = new LinkedHashSet<TransformerUI>();
transformers.get(NODE_ELEMENT).put(c, uis);
}
uis.add(ui);
}
if (t.isEdge()) {
Set<TransformerUI> uis = transformers.get(EDGE_ELEMENT).get(c);
if (uis == null) {
uis = new LinkedHashSet<TransformerUI>();
transformers.get(EDGE_ELEMENT).put(c, uis);
}