Java Doc for BaseValueParser.java in  » Web-Framework » TURBINE » org » apache » turbine » util » parser » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » TURBINE » org.apache.turbine.util.parser 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.turbine.util.pool.RecyclableSupport
      org.apache.turbine.util.parser.BaseValueParser

All known Subclasses:   org.apache.turbine.util.parser.DefaultCookieParser,  org.apache.turbine.util.parser.DefaultParameterParser,
BaseValueParser
public class BaseValueParser extends RecyclableSupport implements ValueParser(Code)
BaseValueParser is a base class for classes that need to parse name/value Parameters, for example GET/POST data or Cookies (DefaultParameterParser and DefaultCookieParser).

It can also be used standalone, for an example see DataStreamParser.

NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value pairs if the names match:

 ValueParser vp = new BaseValueParser();
 vp.add("ERROR",1);
 vp.add("eRrOr",2);
 int result = vp.getInt("ERROR");
 
In the above example, result is 2.
author:
   Ilkka Priha
author:
   Jon S. Stevens
author:
   Sean Legassick
author:
   Jason van Zyl
author:
   Scott Eade
author:
   Henning P. Schmiedehausen
author:
   Quinton McCombs
version:
   $Id: BaseValueParser.java 534527 2007-05-02 16:10:59Z tv $



Constructor Summary
public  BaseValueParser()
    
public  BaseValueParser(String characterEncoding)
    

Method Summary
public  voidadd(String name, double value)
     Add a name/value pair into this object.
public  voidadd(String name, int value)
     Add a name/value pair into this object.
public  voidadd(String name, Integer value)
     Add a name/value pair into this object.
public  voidadd(String name, long value)
     Add a name/value pair into this object.
public  voidadd(String name, String value)
     Add a name/value pair into this object.
public  voidadd(String name, String[] value)
     Add an array of Strings for a key.
public  voidappend(String name, String value)
     Add a String parameters.
public  voidclear()
     Clear all name/value pairs out of this object.
public  booleancontainsDateSelectorKeys(String key)
     Check for existence of key_day, key_month and key_year parameters (as returned by DateSelector generated HTML).
Parameters:
  key - A String with the selector name.
public  booleancontainsKey(Object key)
     Determine whether a given key has been inserted.
public  booleancontainsTimeSelectorKeys(String key)
     Check for existence of key_hour, key_minute and key_second parameters (as returned by TimeSelector generated HTML).
Parameters:
  key - A String with the selector name.
public  Stringconvert(String value)
     Trims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING.
public static  StringconvertAndTrim(String value)
     A static version of the convert method, which trims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING.
public  voiddispose()
     Disposes the parser.
public  Stringget(String name)
     Return a String for the given name.
public  BigDecimalgetBigDecimal(String name, BigDecimal defaultValue)
     Return a BigDecimal for the given name.
public  BigDecimalgetBigDecimal(String name)
     Return a BigDecimal for the given name.
public  BigDecimal[]getBigDecimals(String name)
     Return an array of BigDecimals for the given name.
public  BooleangetBool(String name, boolean defaultValue)
     Return a Boolean for the given name.
public  BooleangetBool(String name)
     Return a Boolean for the given name.
public  booleangetBoolean(String name, boolean defaultValue)
     Return a boolean for the given name.
public  booleangetBoolean(String name)
     Return a boolean for the given name.
public  BooleangetBooleanObject(String name)
     Returns a Boolean object for the given name.
public  BooleangetBooleanObject(String name, Boolean defaultValue)
     Returns a Boolean object for the given name.
public  bytegetByte(String name, byte defaultValue)
     Return a byte for the given name.
public  bytegetByte(String name)
     Return a byte for the given name.
public  BytegetByteObject(String name, Byte defaultValue)
     Return a byte for the given name.
public  BytegetByteObject(String name)
     Return a byte for the given name.
public  byte[]getBytes(String name)
     Return an array of bytes for the given name.
public  StringgetCharacterEncoding()
     Get the character encoding that will be used by this ValueParser.
public  DategetDate(String name, DateFormat df, Date defaultValue)
     Returns a java.util.Date object.
public  DategetDate(String name)
     Returns a java.util.Date object.
public  DategetDate(String name, DateFormat df)
     Returns a java.util.Date object.
public  doublegetDouble(String name, double defaultValue)
     Return a double for the given name.
public  doublegetDouble(String name)
     Return a double for the given name.
public  DoublegetDoubleObject(String name, Double defaultValue)
     Return a Double for the given name.
public  DoublegetDoubleObject(String name)
     Return a Double for the given name.
public  Double[]getDoubleObjects(String name)
     Return an array of doubles for the given name.
public  double[]getDoubles(String name)
     Return an array of doubles for the given name.
public  floatgetFloat(String name, float defaultValue)
     Return a float for the given name.
public  floatgetFloat(String name)
     Return a float for the given name.
public  FloatgetFloatObject(String name, Float defaultValue)
     Return a Float for the given name.
public  FloatgetFloatObject(String name)
     Return a float for the given name.
public  Float[]getFloatObjects(String name)
     Return an array of floats for the given name.
public  float[]getFloats(String name)
     Return an array of floats for the given name.
public  intgetInt(String name, int defaultValue)
     Return an int for the given name.
public  intgetInt(String name)
     Return an int for the given name.
public  IntegergetIntObject(String name, Integer defaultValue)
     Return an Integer for the given name.
public  IntegergetIntObject(String name)
     Return an Integer for the given name.
public  Integer[]getIntObjects(String name)
     Return an array of Integers for the given name.
public  IntegergetInteger(String name, int defaultValue)
     Return an Integer for the given name.
public  IntegergetInteger(String name, Integer def)
     Return an Integer for the given name.
public  IntegergetInteger(String name)
     Return an Integer for the given name.
public  Integer[]getIntegers(String name)
     Return an array of Integers for the given name.
public  int[]getInts(String name)
     Return an array of ints for the given name.
public  Object[]getKeys()
     Returns all the available parameter names.
public  longgetLong(String name, long defaultValue)
     Return a long for the given name.
public  longgetLong(String name)
     Return a long for the given name.
public  LonggetLongObject(String name)
     Return a Long for the given name.
public  LonggetLongObject(String name, Long defaultValue)
     Return a Long for the given name.
public  Long[]getLongObjects(String name)
     Return an array of Longs for the given name.
public  long[]getLongs(String name)
     Return an array of longs for the given name.
public  NumberKeygetNumberKey(String name)
     Return an NumberKey for the given name.
public  ObjectgetObject(String name)
     Return an Object for the given name.
public  Object[]getObjects(String name)
     Return an array of Objects for the given name.
protected  String[]getParam(String name)
     fetches a key from the parameters map.
public  StringgetString(String name)
     Return a String for the given name.
public  StringgetString(String name, String defaultValue)
     Return a String for the given name.
public  StringKeygetStringKey(String name)
     Return an StringKey for the given name.
public  String[]getStrings(String name)
     Return an array of Strings for the given name.
public  String[]getStrings(String name, String[] defaultValue)
     Return an array of Strings for the given name.
protected  Object[]getToStringParam(String name)
    
public  SetkeySet()
    
public  Enumerationkeys()
     Get an enumerator for the parameter keys.
protected  voidputParam(String name, String[] value)
     Puts a key into the parameters map.
public  voidrecycle(String characterEncoding)
     Recycles the parser with a character encoding.
public  Objectremove(String name)
     Removes the named parameter from the contained hashtable.
public  voidsetCharacterEncoding(String s)
     Set the character encoding that will be used by this ValueParser.
public  voidsetProperties(Object bean)
     Uses bean introspection to set writable properties of bean from the parameters, where a (case-insensitive) name match between the bean property and the parameter is looked for.
protected  voidsetProperty(Object bean, PropertyDescriptor prop)
     Set the property 'prop' in the bean to the value of the corresponding parameters.
public  voidsetString(String name, String value)
     Set a parameter to a specific value.
public  voidsetStrings(String name, String[] values)
     Set a parameter to a specific value.
public  StringtoString()
     Simple method that attempts to get a textual representation of this object's name/value pairs.


Constructor Detail
BaseValueParser
public BaseValueParser()(Code)
Default constructor



BaseValueParser
public BaseValueParser(String characterEncoding)(Code)
Constructor that takes a character encoding




Method Detail
add
public void add(String name, double value)(Code)
Add a name/value pair into this object.
Parameters:
  name - A String with the name.
Parameters:
  value - A double with the value.



add
public void add(String name, int value)(Code)
Add a name/value pair into this object.
Parameters:
  name - A String with the name.
Parameters:
  value - An int with the value.



add
public void add(String name, Integer value)(Code)
Add a name/value pair into this object.
Parameters:
  name - A String with the name.
Parameters:
  value - An Integer with the value.



add
public void add(String name, long value)(Code)
Add a name/value pair into this object.
Parameters:
  name - A String with the name.
Parameters:
  value - A long with the value.



add
public void add(String name, String value)(Code)
Add a name/value pair into this object.
Parameters:
  name - A String with the name.
Parameters:
  value - A long with the value.



add
public void add(String name, String[] value)(Code)
Add an array of Strings for a key. This is simply adding all the elements in the array one by one.
Parameters:
  name - A String with the name.
Parameters:
  value - A String Array.



append
public void append(String name, String value)(Code)
Add a String parameters. If there are any Strings already associated with the name, append to the array. This is used for handling parameters from multipart POST requests.
Parameters:
  name - A String with the name.
Parameters:
  value - A String with the value.



clear
public void clear()(Code)
Clear all name/value pairs out of this object.



containsDateSelectorKeys
public boolean containsDateSelectorKeys(String key)(Code)
Check for existence of key_day, key_month and key_year parameters (as returned by DateSelector generated HTML).
Parameters:
  key - A String with the selector name. True if keys are found.



containsKey
public boolean containsKey(Object key)(Code)
Determine whether a given key has been inserted. All keys are stored in lowercase strings, so override method to account for this.
Parameters:
  key - An Object with the key to search for. True if the object is found.



containsTimeSelectorKeys
public boolean containsTimeSelectorKeys(String key)(Code)
Check for existence of key_hour, key_minute and key_second parameters (as returned by TimeSelector generated HTML).
Parameters:
  key - A String with the selector name. True if keys are found.



convert
public String convert(String value)(Code)
Trims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING. It returns a new string so that it does not destroy the value data.
Parameters:
  value - A String to be processed. A new String converted to lowercase and trimmed.



convertAndTrim
public static String convertAndTrim(String value)(Code)
A static version of the convert method, which trims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING. It returns a new string so that it does not destroy the value data.
Parameters:
  value - A String to be processed. A new String converted to lowercase and trimmed.



dispose
public void dispose()(Code)
Disposes the parser.



get
public String get(String name)(Code)
Return a String for the given name. If the name does not exist, return null. It is the same as the getString() method however has been added for simplicity when working with template tools such as Velocity which allow you to do something like this: $data.Parameters.form_variable_name
Parameters:
  name - A String with the name. A String.



getBigDecimal
public BigDecimal getBigDecimal(String name, BigDecimal defaultValue)(Code)
Return a BigDecimal for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A BigDecimal.



getBigDecimal
public BigDecimal getBigDecimal(String name)(Code)
Return a BigDecimal for the given name. If the name does not exist, return 0.0.
Parameters:
  name - A String with the name. A BigDecimal.



getBigDecimals
public BigDecimal[] getBigDecimals(String name)(Code)
Return an array of BigDecimals for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A BigDecimal[].



getBool
public Boolean getBool(String name, boolean defaultValue)(Code)
Return a Boolean for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A Boolean.BaseValueParser.getBooleanObject



getBool
public Boolean getBool(String name)(Code)
Return a Boolean for the given name. If the name does not exist, return false.
Parameters:
  name - A String with the name. A Boolean.BaseValueParser.getBooleanObject(String)



getBoolean
public boolean getBoolean(String name, boolean defaultValue)(Code)
Return a boolean for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A boolean.



getBoolean
public boolean getBoolean(String name)(Code)
Return a boolean for the given name. If the name does not exist, return false.
Parameters:
  name - A String with the name. A boolean.



getBooleanObject
public Boolean getBooleanObject(String name)(Code)
Returns a Boolean object for the given name. If the parameter does not exist or can not be parsed as a boolean, null is returned.

Valid values for true: true, on, 1, yes
Valid values for false: false, off, 0, no

The string is compared without reguard to case.
Parameters:
  name - A String with the name. A Boolean.




getBooleanObject
public Boolean getBooleanObject(String name, Boolean defaultValue)(Code)
Returns a Boolean object for the given name. If the parameter does not exist or can not be parsed as a boolean, null is returned.

Valid values for true: true, on, 1, yes
Valid values for false: false, off, 0, no

The string is compared without reguard to case.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A Boolean.




getByte
public byte getByte(String name, byte defaultValue)(Code)
Return a byte for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A byte.



getByte
public byte getByte(String name)(Code)
Return a byte for the given name. If the name does not exist, return 0.
Parameters:
  name - A String with the name. A byte.



getByteObject
public Byte getByteObject(String name, Byte defaultValue)(Code)
Return a byte for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A byte.



getByteObject
public Byte getByteObject(String name)(Code)
Return a byte for the given name. If the name does not exist, return 0.
Parameters:
  name - A String with the name. A byte.



getBytes
public byte[] getBytes(String name) throws UnsupportedEncodingException(Code)
Return an array of bytes for the given name. If the name does not exist, return null. The array is returned according to the HttpRequest's character encoding.
Parameters:
  name - A String with the name. A byte[].
exception:
  UnsupportedEncodingException -



getCharacterEncoding
public String getCharacterEncoding()(Code)
Get the character encoding that will be used by this ValueParser.



getDate
public Date getDate(String name, DateFormat df, Date defaultValue)(Code)
Returns a java.util.Date object. String is parsed by supplied DateFormat. If the name does not exist or the value could not be parsed into a date return the defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  df - A DateFormat.
Parameters:
  defaultValue - The default value. A Date.



getDate
public Date getDate(String name)(Code)
Returns a java.util.Date object. If there are DateSelector or TimeSelector style parameters then these are used. If not and there is a parameter 'name' then this is parsed by DateFormat. If the name does not exist, return null.
Parameters:
  name - A String with the name. A Date.



getDate
public Date getDate(String name, DateFormat df)(Code)
Returns a java.util.Date object. String is parsed by supplied DateFormat. If the name does not exist, return null.
Parameters:
  name - A String with the name.
Parameters:
  df - A DateFormat. A Date.



getDouble
public double getDouble(String name, double defaultValue)(Code)
Return a double for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A double.



getDouble
public double getDouble(String name)(Code)
Return a double for the given name. If the name does not exist, return 0.0.
Parameters:
  name - A String with the name. A double.



getDoubleObject
public Double getDoubleObject(String name, Double defaultValue)(Code)
Return a Double for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A double.



getDoubleObject
public Double getDoubleObject(String name)(Code)
Return a Double for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A double.



getDoubleObjects
public Double[] getDoubleObjects(String name)(Code)
Return an array of doubles for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A double[].



getDoubles
public double[] getDoubles(String name)(Code)
Return an array of doubles for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A double[].



getFloat
public float getFloat(String name, float defaultValue)(Code)
Return a float for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A float.



getFloat
public float getFloat(String name)(Code)
Return a float for the given name. If the name does not exist, return 0.0.
Parameters:
  name - A String with the name. A float.



getFloatObject
public Float getFloatObject(String name, Float defaultValue)(Code)
Return a Float for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A Float.



getFloatObject
public Float getFloatObject(String name)(Code)
Return a float for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A Float.



getFloatObjects
public Float[] getFloatObjects(String name)(Code)
Return an array of floats for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A float[].



getFloats
public float[] getFloats(String name)(Code)
Return an array of floats for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A float[].



getInt
public int getInt(String name, int defaultValue)(Code)
Return an int for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. An int.



getInt
public int getInt(String name)(Code)
Return an int for the given name. If the name does not exist, return 0.
Parameters:
  name - A String with the name. An int.



getIntObject
public Integer getIntObject(String name, Integer defaultValue)(Code)
Return an Integer for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. An Integer.



getIntObject
public Integer getIntObject(String name)(Code)
Return an Integer for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. An Integer.



getIntObjects
public Integer[] getIntObjects(String name)(Code)
Return an array of Integers for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. An Integer[].



getInteger
public Integer getInteger(String name, int defaultValue)(Code)
Return an Integer for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. An Integer.BaseValueParser.getIntObject



getInteger
public Integer getInteger(String name, Integer def)(Code)
Return an Integer for the given name. If the name does not exist, return defaultValue. You cannot pass in a null here for the default value.
Parameters:
  name - A String with the name.
Parameters:
  def - The default value. An Integer.BaseValueParser.getIntObject



getInteger
public Integer getInteger(String name)(Code)
Return an Integer for the given name. If the name does not exist, return 0.
Parameters:
  name - A String with the name. An Integer.BaseValueParser.getIntObject



getIntegers
public Integer[] getIntegers(String name)(Code)
Return an array of Integers for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. An Integer[].BaseValueParser.getIntObjects



getInts
public int[] getInts(String name)(Code)
Return an array of ints for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. An int[].



getKeys
public Object[] getKeys()(Code)
Returns all the available parameter names. A object array with the keys.



getLong
public long getLong(String name, long defaultValue)(Code)
Return a long for the given name. If the name does not exist, return defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A long.



getLong
public long getLong(String name)(Code)
Return a long for the given name. If the name does not exist, return 0.
Parameters:
  name - A String with the name. A long.



getLongObject
public Long getLongObject(String name)(Code)
Return a Long for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A Long.



getLongObject
public Long getLongObject(String name, Long defaultValue)(Code)
Return a Long for the given name. If the name does not exist, return the default value.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A Long.



getLongObjects
public Long[] getLongObjects(String name)(Code)
Return an array of Longs for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A Long[].



getLongs
public long[] getLongs(String name)(Code)
Return an array of longs for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A long[].



getNumberKey
public NumberKey getNumberKey(String name)(Code)
Return an NumberKey for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A NumberKey, or null if unparsable.



getObject
public Object getObject(String name)(Code)
Return an Object for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. An Object.



getObjects
public Object[] getObjects(String name)(Code)
Return an array of Objects for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. An Object[].



getParam
protected String[] getParam(String name)(Code)
fetches a key from the parameters map. Makes sure that the name is always mapped correctly.
Parameters:
  name - A string with the name the value object array or null if not set



getString
public String getString(String name)(Code)
Return a String for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A String or null if the key is unknown.



getString
public String getString(String name, String defaultValue)(Code)
Return a String for the given name. If the name does not exist, return the defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A String.



getStringKey
public StringKey getStringKey(String name)(Code)
Return an StringKey for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A StringKey, or null if unparsable.



getStrings
public String[] getStrings(String name)(Code)
Return an array of Strings for the given name. If the name does not exist, return null.
Parameters:
  name - A String with the name. A String[].



getStrings
public String[] getStrings(String name, String[] defaultValue)(Code)
Return an array of Strings for the given name. If the name does not exist, return the defaultValue.
Parameters:
  name - A String with the name.
Parameters:
  defaultValue - The default value. A String[].



getToStringParam
protected Object[] getToStringParam(String name)(Code)
This method is only used in toString() and can be used by derived classes to add their local parameters to the toString()
Parameters:
  name - A string with the name the value object array or null if not set



keySet
public Set keySet()(Code)
Gets the set of keys A Set of the keys.



keys
public Enumeration keys()(Code)
Get an enumerator for the parameter keys. An enumerator of the keys.BaseValueParser.keySet



putParam
protected void putParam(String name, String[] value)(Code)
Puts a key into the parameters map. Makes sure that the name is always mapped correctly. This method also enforces the usage of arrays for the parameters.
Parameters:
  name - A String with the name.
Parameters:
  value - An array of Objects with the values.



recycle
public void recycle(String characterEncoding)(Code)
Recycles the parser with a character encoding.
Parameters:
  characterEncoding - the character encoding.



remove
public Object remove(String name)(Code)
Removes the named parameter from the contained hashtable. Wraps to the contained Map.remove(). The value that was mapped to the key (a String[])or null if the key was not mapped.



setCharacterEncoding
public void setCharacterEncoding(String s)(Code)
Set the character encoding that will be used by this ValueParser.



setProperties
public void setProperties(Object bean) throws Exception(Code)
Uses bean introspection to set writable properties of bean from the parameters, where a (case-insensitive) name match between the bean property and the parameter is looked for.
Parameters:
  bean - An Object.
exception:
  Exception - a generic exception.



setProperty
protected void setProperty(Object bean, PropertyDescriptor prop) throws Exception(Code)
Set the property 'prop' in the bean to the value of the corresponding parameters. Supports all types supported by getXXX methods plus a few more that come for free because primitives have to be wrapped before being passed to invoke anyway.
Parameters:
  bean - An Object.
Parameters:
  prop - A PropertyDescriptor.
exception:
  Exception - a generic exception.



setString
public void setString(String name, String value)(Code)
Set a parameter to a specific value. This is useful if you want your action to override the values of the parameters for the screen to use.
Parameters:
  name - The name of the parameter.
Parameters:
  value - The value to set.



setStrings
public void setStrings(String name, String[] values)(Code)
Set a parameter to a specific value. This is useful if you want your action to override the values of the parameters for the screen to use.
Parameters:
  name - The name of the parameter.
Parameters:
  values - The value to set.



toString
public String toString()(Code)
Simple method that attempts to get a textual representation of this object's name/value pairs. String[] handling is currently a bit rough. A textual representation of the parsed name/value pairs.



Methods inherited from org.apache.turbine.util.pool.RecyclableSupport
public void Recyclable()(Code)(Java Doc)
public void dispose()(Code)(Java Doc)
protected boolean doDispose()(Code)(Java Doc)
public boolean isDisposed()(Code)(Java Doc)
public void recycle()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.