/** Parses a component profile */
private AbstractComponent parseComponentProfile(Element elem, boolean isSubComponent) throws ProfileException {
AbstractComponent comp = null;
if (isSubComponent) {
log.debug(" Parsing subcomp profile: " + elem.getAttribute("Name"));
comp = new SubComponent();
} else {
log.debug(" Parsing comp profile: " + elem.getAttribute("Name"));
comp = new Component();
int childIndex = 1;
NodeList children = elem.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node n = children.item(i);
if (n.getNodeType() == Node.ELEMENT_NODE) {
Element child = (Element) n;
if (child.getNodeName().equalsIgnoreCase("SubComponent")) {
SubComponent subcomp = (SubComponent) parseComponentProfile(child, true);
((Component) comp).setSubComponent(childIndex++, subcomp);
}
}
}
}