commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r617951 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/KeywordVariables.java
Date Sun, 03 Feb 2008 05:19:28 GMT
Author: mbenson
Date: Sat Feb  2 21:19:27 2008
New Revision: 617951

URL: http://svn.apache.org/viewvc?rev=617951&view=rev
Log:
javadoc; validate constructor arg

Modified:
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/KeywordVariables.java

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/KeywordVariables.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/KeywordVariables.java?rev=617951&r1=617950&r2=617951&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/KeywordVariables.java
(original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/KeywordVariables.java
Sat Feb  2 21:19:27 2008
@@ -30,26 +30,46 @@
     private String keyword;
     private Object object;
 
+    /**
+     * Create a new KeywordVariables.
+     * @param keyword String
+     * @param object value
+     */
     public KeywordVariables(String keyword, Object object) {
+        if (keyword == null) {
+            throw new IllegalArgumentException("keyword cannot be null");
+        }
         this.keyword = keyword;
         this.object = object;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isDeclaredVariable(String variable) {
         return variable.equals(keyword);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object getVariable(String variable) {
         return isDeclaredVariable(variable) ? object : null;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void declareVariable(String variable, Object value) {
         throw new UnsupportedOperationException(
             "Cannot declare new keyword variables.");
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void undeclareVariable(String variable) {
         throw new UnsupportedOperationException(
-            "Cannot declare new keyword variables.");
+            "Cannot undeclare keyword variables.");
     }
 }



Mime
View raw message