xml.append("</bonusResource>\n");
return xml.toString();
}
public BonusResourceImpl initializeFromNode(Realm realm, Node node) {
BonusResourceImpl bonusResourceImpl = new BonusResourceImpl();
bonusResourceImpl.setId(Integer.parseInt(XMLConverterUtility.findNode(node, "id").getFirstChild().getNodeValue()));
bonusResourceImpl.setName(XMLConverterUtility.findNode(node, "name").getFirstChild().getNodeValue());
Node propertiesNode = XMLConverterUtility.findNode(node, "properties");
for (Node propertyNode = propertiesNode.getFirstChild(); propertyNode != null; propertyNode = propertyNode.getNextSibling()) {
if (propertyNode.getNodeType() == Node.ELEMENT_NODE) {
Property property = PropertyFactory.createProperty(realm, propertyNode);
bonusResourceImpl.addProperty(property);
}
}
return bonusResourceImpl;
}