for (Iterator ci = propertyDefinitionsElement.getChildren()
.iterator(); ci.hasNext();) {
Element c = (Element) ci.next();
PropertyClassManager pcm = PropertyClassManager
.getInstance();
PropertyClass pc = pcm.getPropertyClass(c.getName());
if (pc == null) {
throw new ExtensionException(
ExtensionException.INTERNAL_ERROR,
"No property definition class named "
+ c.getName());
}
for (Iterator ei = c.getChildren().iterator(); ei
.hasNext();) {
Element ec = (Element) ei.next();
if (ec.getName().equals("definition")) {
PropertyDefinition def;
if (pc instanceof AttributesPropertyClass) {
def = new XMLAttributeDefinition(ec);
} else {
def = new XMLPropertyDefinition(ec);
}
propertyDefinitions.put(def.getName(), def);
pc.registerPropertyDefinition(def);
} else if (ec.getName().equals("category")) {
PropertyDefinitionCategory cat = new DefaultPropertyDefinitionCategory(
ec.getAttribute("id").getIntValue(), ec
.getAttributeValue("bundle"),
ec.getAttributeValue("image"));
cat.setPropertyClass(pc);
if (ec.getAttributeValue("parent") == null) {
pc.addPropertyDefinitionCategory(-1, cat);
} else {
PropertyDefinitionCategory parentCat = pc
.getPropertyDefinitionCategory(ec
.getAttribute("parent")
.getIntValue());
if (parentCat == null) {
throw new ExtensionException(
ExtensionException.INTERNAL_ERROR,
"No parent category for "
+ cat.getId()
+ " of "
+ ec
.getAttributeValue("parent"));
}
pc.addPropertyDefinitionCategory(parentCat
.getId(), cat);
}
propertyDefinitionCategories.put(cat.getId(),
cat);
} else {