reader.moveDown();
String nodeName = reader.getNodeName();
if (nodeName.equals("gbean-info")) {
if (gbeanInfo != null) {
throw new ConversionException("GBean info declared more than once in gbean " + abstractName);
}
gbeanInfo = (GBeanInfo) unmarshallingContext.convertAnother(reader, GBeanInfo.class);
} else if (nodeName.equals("dependency")) {
ReferencePatterns referencePatterns = (ReferencePatterns) unmarshallingContext.convertAnother(reader, ReferencePatterns.class);
dependencies.add(referencePatterns);
} else if (nodeName.equals("attribute")) {
String attributeName = reader.getAttribute("name");
reader.moveDown();
String classAttribute = reader.getAttribute(mapper.attributeForImplementationClass());
Class type;
if (classAttribute == null) {
type = mapper.realClass(reader.getNodeName());
} else {
type = mapper.realClass(classAttribute);
}
Object attributeValue = unmarshallingContext.convertAnother(reader, type);
reader.moveUp();
attributes.put(attributeName, attributeValue);
} else if (nodeName.equals("reference")) {
String referenceName = reader.getAttribute("name");
ReferencePatterns referencePatterns = (ReferencePatterns) unmarshallingContext.convertAnother(reader, ReferencePatterns.class);
references.put(referenceName, referencePatterns);
} else {
throw new ConversionException("Unknown nested node in GBean: " + nodeName);
}
reader.moveUp();
}
if (gbeanInfo == null) {
throw new ConversionException("GBean info not declared in gbean " + abstractName);
}
GBeanData gbeanData = new GBeanData(abstractName, gbeanInfo);
gbeanData.setDependencies(dependencies);
for (Map.Entry<String, Object> entry : attributes.entrySet()) {