Map<String, Map<String, String>> componentDetails;
for (DefDescriptor<ComponentDef> descriptor : descriptors) {
component = new TreeMap<String, Map<String, Map<String, String>>>();
try {
ComponentDef compDef = descriptor.getDef();
String compName = descriptor.getNamespace() + ":" + compDef.getName();
if (components.containsKey(compName)) {
continue;
}
Map<DefDescriptor<AttributeDef>, AttributeDef> attDefs = compDef.getAttributeDefs();
if (attDefs != null && attDefs.size() > 0) {
componentDetails = new TreeMap<String, Map<String, String>>();
for (DefDescriptor<AttributeDef> attDef : attDefs.keySet()) {
Map<String, String> attributePros = new TreeMap<String, String>();
attributePros.put("type", attDefs.get(attDef).getTypeDef().getName());
String desc = attDefs.get(attDef).getDescription();
if (desc != null) {
attributePros.put(DESCRIPTION_KEY, desc);
}
componentDetails.put(attDef.getName(), attributePros);
}
component.put(ATTRIBUTES_KEY, componentDetails);
}
Map<String, RegisterEventDef> eventDefs = compDef.getRegisterEventDefs();
if (eventDefs != null && eventDefs.size() > 0) {
componentDetails = new TreeMap<String, Map<String, String>>();
for (String eventDef : eventDefs.keySet()) {
Map<String, String> eventPros = new TreeMap<String, String>();
eventPros.put(TYPE_KEY, "Action");
String desc = eventDefs.get(eventDef).getDescription();
if (desc != null) {
eventPros.put(DESCRIPTION_KEY, desc);
}
componentDetails.put(eventDef, eventPros);
}
component.put(EVENTS_KEY, componentDetails);
}
Collection<EventHandlerDef> handlerDefs = compDef.getHandlerDefs();
if (handlerDefs != null && handlerDefs.size() > 0) {
componentDetails = new TreeMap<String, Map<String, String>>();
for (EventHandlerDef handlerDef : handlerDefs) {
Map<String, String> eventHandlerProps = new TreeMap<String, String>();
String desc = handlerDef.getDescription();
if (desc != null) {
eventHandlerProps.put(DESCRIPTION_KEY, desc);
}
componentDetails.put(handlerDef.getName(), eventHandlerProps);
}
component.put(HANDLERS_KEY, componentDetails);
}
String desc = compDef.getDescription();
if (desc != null) {
componentDetails = new TreeMap<String, Map<String, String>>();
componentDetails.put(desc, new TreeMap<String, String>());
component.put(DESCRIPTION_KEY, componentDetails);
}
String support = compDef.getSupport().toString();
if (support != null) {
componentDetails = new TreeMap<String, Map<String, String>>();
componentDetails.put(support, new TreeMap<String, String>());
component.put(SUPPORT_KEY, componentDetails);
}