Ejemplo n.º 1
0
 @Override
 public VariableReference plus(Variable v) throws ScriptException {
   if (v == null) throw new ScriptException(composeMessage("Can't add a null object"));
   ConfigurationNode node = v.getConfigurationNodeValue();
   ConfigurationNode cn = new ConfigurationNode(configurationNode.getType());
   cn.setValue(configurationNode.getValue());
   Iterator<String> attIter = configurationNode.getAttributes();
   while (attIter.hasNext()) {
     String attrName = attIter.next();
     String attrValue = configurationNode.getAttributeValue(attrName);
     cn.setAttribute(attrName, attrValue);
   }
   int i = 0;
   while (i < configurationNode.getChildCount()) {
     ConfigurationNode child = configurationNode.findChild(i++);
     cn.addChild(cn.getChildCount(), child);
   }
   cn.addChild(cn.getChildCount(), node);
   return new VariableConfigurationNode(cn);
 }