Package org.freerealm.resource.bonus

Examples of org.freerealm.resource.bonus.BonusResourceImpl


        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;
    }
View Full Code Here


    public String toXML(BonusResourceManager bonusResourceManager) {
        StringBuffer xml = new StringBuffer();
        xml.append("<bonusResources>\n");
        Iterator<BonusResourceImpl> iterator = bonusResourceManager.getBonusResourcesIterator();
        while (iterator.hasNext()) {
            BonusResourceImpl bonusResource = iterator.next();
            xml.append(new BonusResourceImplXMLConverter().toXML(bonusResource));
        }
        xml.append("</bonusResources>\n");
        return xml.toString();
    }
View Full Code Here

    public BonusResourceManager initializeFromNode(Realm realm, Node node) {
        BonusResourceManager bonusResourceManager = new BonusResourceManager();
        for (Node bonusResourceNode = node.getFirstChild(); bonusResourceNode != null; bonusResourceNode = bonusResourceNode.getNextSibling()) {
            if (bonusResourceNode.getNodeType() == Node.ELEMENT_NODE) {
                BonusResourceImpl bonusResource = new BonusResourceImplXMLConverter().initializeFromNode(realm, bonusResourceNode);
                bonusResourceManager.addBonusResource(bonusResource);
            }
        }
        return bonusResourceManager;
    }
View Full Code Here

TOP

Related Classes of org.freerealm.resource.bonus.BonusResourceImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.