| <?xml version="1.0"?> |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| <document> |
| |
| <properties> |
| <title>ParameterParser</title> |
| <author email="sidler@apache.org">Gabriel Sidler</author> |
| <projectfile>xdocs/view/menu.xml</projectfile> |
| </properties> |
| |
| <body> |
| |
| <section name="ParameterParser Reference Documentation"> |
| |
| <p>View tool for easy parsing of ServletRequest parameters.</p> |
| |
| <toolinfo> |
| <version>@@@version@@@, @@@date@@@</version> |
| |
| <clazz>org.apache.velocity.tools.view.tools.ParameterParser</clazz> |
| |
| <name>$params</name> |
| |
| <author>Nathan Bubna</author> |
| |
| <config-example><tool> |
| <key>params</key> |
| <scope>request</scope> |
| <class>org.apache.velocity.tools.view.tools.ParameterParser</class> |
| </tool></config-example> |
| |
| </toolinfo> |
| |
| <methods/> |
| |
| </section> |
| |
| <section name="exists()"> |
| <method name="exists()"> |
| |
| <abstract> |
| Returns <code>true</code> if a parameter for the specified key exists. |
| </abstract> |
| |
| <signature> |
| boolean exists(String key) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the parameter in question |
| </parameter> |
| </parameters> |
| |
| <returns> |
| <code>true</code> if a parameter for the specified key exists or |
| <code>false</code> if this parameter is not present or has no value. |
| </returns> |
| |
| </method> |
| </section> |
| |
| <section name="getString()"> |
| <method name="getString()"> |
| |
| <abstract> |
| Returns the specified servlet request parameter as a String |
| </abstract> |
| |
| <signature> |
| String get(String key) |
| </signature> |
| |
| <signature> |
| String getString(String key) |
| </signature> |
| |
| <signature> |
| String getString(String key, String alternate) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| <parameter name="alternate"> |
| An alternate value |
| </parameter> |
| </parameters> |
| |
| <returns> |
| The value of the parameter matching the specified key or the |
| specified alternate String if there is no matching parameter. |
| A value of <code>null</code> is returned if no alternate value |
| is defined and the desired parameter is not found. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| <section name="getBoolean()"> |
| <method name="getBoolean()"> |
| |
| <abstract> |
| Returns the specified servlet request parameter as a Boolean object or |
| a boolean primitive type |
| </abstract> |
| |
| <signature> |
| Boolean getBoolean(String key) |
| </signature> |
| |
| <signature> |
| Boolean getBoolean(String key, Boolean alternate) |
| </signature> |
| |
| <signature> |
| boolean getBoolean(String key, boolean alternate) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| <parameter name="alternate"> |
| An alternate value |
| </parameter> |
| </parameters> |
| |
| <returns> |
| A Boolean object or boolean primitive type that represents the |
| value of the servlet request parameter matching the specified key |
| or the specified alternate boolean if there is no matching parameter. |
| A value of <code>null</code> is returned if no alternate value |
| is defined and the desired parameter is not found. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| |
| <section name="getNumber()"> |
| <method name="getNumber()"> |
| |
| <abstract> |
| Returns the specified servlet request parameter as a Number object |
| </abstract> |
| |
| <signature> |
| Number getNumber(String key) |
| </signature> |
| |
| <signature> |
| Number getNumber(String key, Number alternate) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| <parameter name="alternate"> |
| An alternate value |
| </parameter> |
| </parameters> |
| |
| <returns> |
| A <code>java.lang.Number</code> object that represents the |
| value of the servlet request parameter matching the specified key |
| or the specified alternate Number if there is no matching parameter. |
| A value of <code>null</code> is returned if no alternate value |
| is defined and the desired parameter is not found. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| <section name="getInt()"> |
| <method name="getInt()"> |
| |
| <abstract> |
| Returns the specified servlet request parameter as an integer |
| </abstract> |
| |
| <signature> |
| int getInt(String key, int alternate) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| <parameter name="alternate"> |
| An alternate value |
| </parameter> |
| </parameters> |
| |
| <returns> |
| An integer that represents the |
| value of the servlet request parameter matching the specified key |
| or the specified alternate value if there is no matching parameter. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| |
| <section name="getDouble()"> |
| <method name="getDouble()"> |
| |
| <abstract> |
| Returns the specified servlet request parameter as a double |
| </abstract> |
| |
| <signature> |
| double getDouble(String key, double alternate) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| <parameter name="alternate"> |
| An alternate value |
| </parameter> |
| </parameters> |
| |
| <returns> |
| An double that represents the |
| value of the servlet request parameter matching the specified key |
| or the specified alternate value if there is no matching parameter. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| <section name="getStrings()"> |
| <method name="getStrings()"> |
| |
| <abstract> |
| Returns an array of Strings of all the values of the specified servlet |
| request parameter |
| </abstract> |
| |
| <signature> |
| String[] getStrings(String key) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| </parameters> |
| |
| <returns> |
| A array of Strings that represent all the values of the desired |
| request parameter or <code>null</code> if the parameter does not |
| exist. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| |
| <section name="getBooleans()"> |
| <method name="getBooleans()"> |
| |
| <abstract> |
| Returns an array of Booleans of all the values of the specified servlet |
| request parameter |
| </abstract> |
| |
| <signature> |
| Boolean[] getBooleans(String key) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| </parameters> |
| |
| <returns> |
| A array of <code>java.lang.Boolean</code> that represent all the |
| values of the desired request parameter or <code>null</code> if |
| the parameter does not exist. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| |
| <section name="getNumbers()"> |
| <method name="getNumbers()"> |
| |
| <abstract> |
| Returns an array of Numbers of all the values of the specified servlet |
| request parameter |
| </abstract> |
| |
| <signature> |
| Number[] getNumbers(String key) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| </parameters> |
| |
| <returns> |
| A array of <code>java.lang.Number</code> that represent all the |
| values of the desired request parameter or <code>null</code> if |
| the parameter does not exist. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| |
| <section name="getInts()"> |
| <method name="getInts()"> |
| |
| <abstract> |
| Returns an array of integers of all the values of the specified servlet |
| request parameter |
| </abstract> |
| |
| <signature> |
| int[] getInts(String key) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| </parameters> |
| |
| <returns> |
| A array of integer primitive types that represent all the |
| values of the desired request parameter or <code>null</code> if |
| the parameter does not exist. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| |
| |
| <section name="getDoubles()"> |
| <method name="getDoubles()"> |
| |
| <abstract> |
| Returns an array of doubles of all the values of the specified servlet |
| request parameter |
| </abstract> |
| |
| <signature> |
| double[] getDoubles(String key) |
| </signature> |
| |
| <parameters> |
| <parameter name="key"> |
| The key of the desired string parameter |
| </parameter> |
| |
| </parameters> |
| |
| <returns> |
| A array of double primitive types that represent all the |
| values of the desired request parameter or <code>null</code> if |
| the parameter does not exist. |
| </returns> |
| |
| </method> |
| </section> |
| |
| |
| </body> |
| </document> |
| |