incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1160930 - in /incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine: VariableConfiguration.java VariableConfigurationNode.java
Date Tue, 23 Aug 2011 23:20:30 GMT
Author: kwright
Date: Tue Aug 23 23:20:30 2011
New Revision: 1160930

URL: http://svn.apache.org/viewvc?rev=1160930&view=rev
Log:
Add '+' operator for configuration and configurationnode objects

Modified:
    incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java
    incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java

Modified: incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java?rev=1160930&r1=1160929&r2=1160930&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java
(original)
+++ incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfiguration.java
Tue Aug 23 23:20:30 2011
@@ -85,6 +85,8 @@ public class VariableConfiguration exten
   {
     if (index > configuration.getChildCount())
       throw new ScriptException("Insert out of bounds");
+    if (v == null)
+      throw new ScriptException("Can't insert a null object");
     configuration.addChild(index,v.getConfigurationNodeValue());
   }
 
@@ -92,9 +94,18 @@ public class VariableConfiguration exten
   public void insert(Variable v)
     throws ScriptException
   {
+    if (v == null)
+      throw new ScriptException("Can't insert a null object");
     configuration.addChild(configuration.getChildCount(),v.getConfigurationNodeValue());
   }
 
+  public VariableReference plus(Variable v)
+    throws ScriptException
+  {
+    insert(v);
+    return this;
+  }
+
   /** Delete an object from this variable at a position. */
   public void removeAt(int index)
     throws ScriptException

Modified: incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java?rev=1160930&r1=1160929&r2=1160930&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java
(original)
+++ incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java
Tue Aug 23 23:20:30 2011
@@ -83,6 +83,8 @@ public class VariableConfigurationNode e
   public void insertAt(Variable v, int index)
     throws ScriptException
   {
+    if (v == null)
+      throw new ScriptException("Can't insert a null object");
     if (index > configurationNode.getChildCount())
       throw new ScriptException("Insert out of bounds");
     ConfigurationNode insertObject = v.getConfigurationNodeValue();
@@ -93,9 +95,18 @@ public class VariableConfigurationNode e
   public void insert(Variable v)
     throws ScriptException
   {
+    if (v == null)
+      throw new ScriptException("Can't insert a null object");
     configurationNode.addChild(configurationNode.getChildCount(),v.getConfigurationNodeValue());
   }
 
+  public VariableReference plus(Variable v)
+    throws ScriptException
+  {
+    insert(v);
+    return this;
+  }
+
   /** Delete an object from this variable at a position. */
   public void removeAt(int index)
     throws ScriptException



Mime
View raw message