nbubna      2003/03/19 21:55:09

  Modified:    src/java/org/apache/velocity/tools/view/tools
                        ParameterParser.java
  Log:
  add exists(String) method for convenience
  
  Revision  Changes    Path
  1.2       +14 -1     
jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/tools/ParameterParser.java
  
  Index: ParameterParser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/tools/ParameterParser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParameterParser.java      5 Mar 2003 06:13:03 -0000       1.1
  +++ ParameterParser.java      20 Mar 2003 05:55:09 -0000      1.2
  @@ -156,6 +156,19 @@
   
   
       /**
  +     * Convenience method for checking whether a certain parameter exists.
  +     *
  +     * @param key the parameter's key
  +     * @return <code>true</code> if a parameter exists for the specified
  +     *         key; otherwise, returns <code>false</code>.
  +     */
  +    public boolean exists(String key)
  +    {
  +        return (getString(key) != null);
  +    }
  +
  +
  +    /**
        * Convenience method for use in Velocity templates.
        * This allows for easy "dot" access to parameters.
        *
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to