Package org.criticalfailure.torchlight.core.domain.entity.object

Examples of org.criticalfailure.torchlight.core.domain.entity.object.ObjectProperty


                logger.debug("obj: " + obj);

                if(obj instanceof Node) {
                    Node node = (Node)obj;

                    ObjectProperty op = objectPropertyFactory.createObjectProperty(baseTemplate.getCampaign(), true);
                    logger.trace("op: " + op);

                    op.setName(node.selectSingleNode("@name").getStringValue());
                    try {
                        op.setTemplate(Boolean.parseBoolean(node.selectSingleNode("@template").getStringValue()));
                    }
                    catch(Exception e) {
                        // ignore
                    }
                    // try {
                    // op.setSequence(Integer.parseInt(node.selectSingleNode("@sequence").getStringValue()));
                    // }
                    // catch(Exception e) {
                    // // ignore
                    // }
                    try {
                        op.setInstanceValueLimit(Integer.parseInt(node.selectSingleNode("@instance-limit")
                                .getStringValue()));
                    }
                    catch(Exception e) {
                        // ignore
                    }

                    // calculator
                    {
                        Node calcNode = node.selectSingleNode("calculator");
                        if(calcNode != null) {
                            op.setCalculatorType(calcNode.selectSingleNode("@type").getStringValue());
                            op.setCalculatorInputs(calcNode.selectSingleNode("@inputs").getStringValue());
                            op.setCalculatorBody(calcNode.getStringValue());
                        }
                    }

                    // formatter
                    {
                        Node formatterNode = node.selectSingleNode("formatter");
                        if(formatterNode != null) {
                            op.setFormatterType(formatterNode.selectSingleNode("@type").getStringValue());
                            op.setFormatterBody(formatterNode.getStringValue());
                        }
                    }

                    // validator
                    {
                        Node validatorNode = node.selectSingleNode("validator");
                        if(validatorNode != null) {
                            op.setValidatorType(validatorNode.selectSingleNode("@type").getStringValue());
                            op.setValidatorBody(validatorNode.getStringValue());
                        }
                    }

                    baseTemplate.addProperty(op);
                    op.setObjectTemplate(baseTemplate);
                }
            }
        }
        catch(Exception e) {
            logger.error("Exception caught while trying to load object template: " + e.getLocalizedMessage(), e);
View Full Code Here


            // EncounterCommonConstants.ENCOUNTER_ICON_PATH));

            {
                logger.debug("creating 'name' object property");

                ObjectProperty op = objectPropertyFactory.createObjectProperty(baseTemplate.getCampaign(), true);
                logger.trace("op: " + op);

                op.setName("name");
                op.setInstanceValueLimit(1);

                baseTemplate.addProperty(op);
            }

            {
                logger.debug("creating 'participants' object property");

                ObjectProperty op = objectPropertyFactory.createObjectProperty(baseTemplate.getCampaign(), true);
                logger.trace("op: " + op);

                op.setName("participants");
                op.setInstanceValueLimit(0);
                op.setTemplate(true);
                op.setValidatorType("object"); // TODO: ???

                baseTemplate.addProperty(op);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.domain.entity.object.ObjectProperty

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.