Java Doc for Field.java in  » Library » Apache-commons-validator-1.3.1-src » org » apache » commons » validator » 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 » Library » Apache commons validator 1.3.1 src » org.apache.commons.validator 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.validator.Field

Field
public class Field implements Cloneable,Serializable(Code)
This contains the list of pluggable validators to run on a field and any message information and variables to perform the validations and generate error messages. Instances of this class are configured with a <field> xml element.

The use of FastHashMap is deprecated and will be replaced in a future release.


version:
   $Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $
See Also:   org.apache.commons.validator.Form


Field Summary
final protected static  StringTOKEN_END
     The end of a token.
final public static  StringTOKEN_INDEXED
     This indicates an indexed property is being referenced.
final protected static  StringTOKEN_START
     The start of a token.
final protected static  StringTOKEN_VAR
     A Vriable token.
protected  Map[]args
     Holds Maps of arguments.
protected  Stringdepends
     A comma separated list of validator's this field depends on.
protected  intfieldOrder
     The order of the Field in the Form.
protected  FastHashMaphMsgs
    
protected  FastHashMaphVars
    
protected  StringindexedListProperty
     The Field's indexed list property name.
protected  StringindexedProperty
     The Field's indexed property name.
protected  Stringkey
     The Field's unique key.
protected  intpage
    
protected  Stringproperty
     The Field's property name.


Method Summary
public  voidaddArg(Arg arg)
     Add an Arg to the replacement argument list.
public  voidaddMsg(Msg msg)
     Add a Msg to the Field.
public  voidaddVar(Var v)
     Add a Var to the Field.
public  voidaddVar(String name, String value, String jsType)
     Add a Var, based on the values passed in, to the Field.
public  Objectclone()
     Creates and returns a copy of this object.
public  voidgenerateKey()
     Generate correct key value.
public  ArggetArg(int position)
     Gets the default Arg object at the given position.
Parameters:
  position - Validation message argument's position.
public  ArggetArg(String key, int position)
     Gets the Arg object at the given position.
public  Arg[]getArgs(String key)
     Retrieves the Args for the given validator name.
Parameters:
  key - The validator's args to retrieve.
public  ListgetDependencyList()
     Gets an unmodifiable List of the dependencies in the same order they were defined in parameter passed to the setDepends() method.
public  StringgetDepends()
     Gets the validation rules for this field as a comma separated list.
public  intgetFieldOrder()
     Gets the position of the Field in the validation list.
public  StringgetIndexedListProperty()
     Gets the indexed property name of the field.
public  StringgetIndexedProperty()
     Gets the indexed property name of the field.
 Object[]getIndexedProperty(Object bean)
     Returns an indexed property from the object we're validating.
public  StringgetKey()
     Gets a unique key based on the property and indexedProperty fields.
public  MsggetMessage(String key)
     Retrieve a message object.
since:
   Validator 1.1.4
Parameters:
  key - Validation key.
public  MapgetMessages()
     The Field's messages are returned as an unmodifiable Map.
public  StringgetMsg(String key)
     Retrieve a message value.
Parameters:
  key - Validation key.
protected  MapgetMsgMap()
     Returns a Map of String Msg names to Msg objects.
public  intgetPage()
     Gets the page value that the Field is associated with for validation.
public  StringgetProperty()
     Gets the property name of the field.
public  VargetVar(String mainKey)
     Retrieve a variable.
protected  MapgetVarMap()
     Returns a Map of String Var names to Var objects.
public  StringgetVarValue(String mainKey)
     Retrieve a variable's value.
public  MapgetVars()
     The Field's variables are returned as an unmodifiable Map.
public  booleanisDependency(String validatorName)
     Checks if the validator is listed as a dependency.
Parameters:
  validatorName - Name of the validator to check.
public  booleanisIndexed()
     If there is a value specified for the indexedProperty field then true will be returned.
 voidprocess(Map globalConstants, Map constants)
     Replace constants with values in fields and process the depends field to create the dependency Map.
public  voidsetDepends(String depends)
     Sets the validation rules for this field as a comma separated list.
public  voidsetFieldOrder(int fieldOrder)
     Sets the position of the Field in the validation list.
public  voidsetIndexedListProperty(String indexedListProperty)
     Sets the indexed property name of the field.
public  voidsetIndexedProperty(String indexedProperty)
     Sets the indexed property name of the field.
public  voidsetKey(String key)
     Sets a unique key for the field.
public  voidsetPage(int page)
     Sets the page value that the Field is associated with for validation.
public  voidsetProperty(String property)
     Sets the property name of the field.
public  StringtoString()
     Returns a string representation of the object.
public  ValidatorResultsvalidate(Map params, Map actions)
     Run the configured validations on this field.

Field Detail
TOKEN_END
final protected static String TOKEN_END(Code)
The end of a token.



TOKEN_INDEXED
final public static String TOKEN_INDEXED(Code)
This indicates an indexed property is being referenced.



TOKEN_START
final protected static String TOKEN_START(Code)
The start of a token.



TOKEN_VAR
final protected static String TOKEN_VAR(Code)
A Vriable token.



args
protected Map[] args(Code)
Holds Maps of arguments. args[0] returns the Map for the first replacement argument. Start with a 0 length array so that it will only grow to the size of the highest argument position.
since:
   Validator 1.1



depends
protected String depends(Code)
A comma separated list of validator's this field depends on.



fieldOrder
protected int fieldOrder(Code)
The order of the Field in the Form.



hMsgs
protected FastHashMap hMsgs(Code)



hVars
protected FastHashMap hVars(Code)



indexedListProperty
protected String indexedListProperty(Code)
The Field's indexed list property name.



indexedProperty
protected String indexedProperty(Code)
The Field's indexed property name.



key
protected String key(Code)
The Field's unique key.



page
protected int page(Code)
The Page Number



property
protected String property(Code)
The Field's property name.





Method Detail
addArg
public void addArg(Arg arg)(Code)
Add an Arg to the replacement argument list.
since:
   Validator 1.1
Parameters:
  arg - Validation message's argument.



addMsg
public void addMsg(Msg msg)(Code)
Add a Msg to the Field.
Parameters:
  msg - A validation message.



addVar
public void addVar(Var v)(Code)
Add a Var to the Field.
Parameters:
  v - The Validator Argument.



addVar
public void addVar(String name, String value, String jsType)(Code)
Add a Var, based on the values passed in, to the Field.
Parameters:
  name - Name of the validation.
Parameters:
  value - The Argument's value.
Parameters:
  jsType - The Javascript type.



clone
public Object clone()(Code)
Creates and returns a copy of this object. A copy of the Field.



generateKey
public void generateKey()(Code)
Generate correct key value.



getArg
public Arg getArg(int position)(Code)
Gets the default Arg object at the given position.
Parameters:
  position - Validation message argument's position. The default Arg or null if not found.
since:
   Validator 1.1



getArg
public Arg getArg(String key, int position)(Code)
Gets the Arg object at the given position. If the key finds a null value then the default value will be retrieved.
Parameters:
  key - The name the Arg is stored under. If not found, the default Arg for the given position (if any) will be retrieved.
Parameters:
  position - The Arg number to find. The Arg with the given name and position or null if not found.
since:
   Validator 1.1



getArgs
public Arg[] getArgs(String key)(Code)
Retrieves the Args for the given validator name.
Parameters:
  key - The validator's args to retrieve. An Arg[] sorted by the Args' positions (i.e. the Arg at index 0has a position of 0).
since:
   Validator 1.1.1



getDependencyList
public List getDependencyList()(Code)
Gets an unmodifiable List of the dependencies in the same order they were defined in parameter passed to the setDepends() method. A list of the Field's dependancies.



getDepends
public String getDepends()(Code)
Gets the validation rules for this field as a comma separated list. A comma separated list of validator names.



getFieldOrder
public int getFieldOrder()(Code)
Gets the position of the Field in the validation list. The field position.



getIndexedListProperty
public String getIndexedListProperty()(Code)
Gets the indexed property name of the field. This is the method name that will return an array or a Collection used to retrieve the list and then loop through the list performing the specified validations. The field's indexed List property name.



getIndexedProperty
public String getIndexedProperty()(Code)
Gets the indexed property name of the field. This is the method name that can take an int as a parameter for indexed property value retrieval. The field's indexed property name.



getIndexedProperty
Object[] getIndexedProperty(Object bean) throws ValidatorException(Code)
Returns an indexed property from the object we're validating.
Parameters:
  bean - The bean to extract the indexed values from.
throws:
  ValidatorException - If there's an error looking up the property or, the property found is not indexed.



getKey
public String getKey()(Code)
Gets a unique key based on the property and indexedProperty fields. a unique key for the field.



getMessage
public Msg getMessage(String key)(Code)
Retrieve a message object.
since:
   Validator 1.1.4
Parameters:
  key - Validation key. A validation message for a specified validator.



getMessages
public Map getMessages()(Code)
The Field's messages are returned as an unmodifiable Map.
since:
   Validator 1.1.4 Map of validation messages for the field.



getMsg
public String getMsg(String key)(Code)
Retrieve a message value.
Parameters:
  key - Validation key. A validation message for a specified validator.



getMsgMap
protected Map getMsgMap()(Code)
Returns a Map of String Msg names to Msg objects.
since:
   Validator 1.2.0 A Map of the Field's messages.



getPage
public int getPage()(Code)
Gets the page value that the Field is associated with for validation. The page number.



getProperty
public String getProperty()(Code)
Gets the property name of the field. The field's property name.



getVar
public Var getVar(String mainKey)(Code)
Retrieve a variable.
Parameters:
  mainKey - The Variable's key the Variable



getVarMap
protected Map getVarMap()(Code)
Returns a Map of String Var names to Var objects.
since:
   Validator 1.2.0 A Map of the Field's variables.



getVarValue
public String getVarValue(String mainKey)(Code)
Retrieve a variable's value.
Parameters:
  mainKey - The Variable's key the Variable's value



getVars
public Map getVars()(Code)
The Field's variables are returned as an unmodifiable Map. the Map of Variable's for a Field.



isDependency
public boolean isDependency(String validatorName)(Code)
Checks if the validator is listed as a dependency.
Parameters:
  validatorName - Name of the validator to check. Whether the field is dependant on a validator.



isIndexed
public boolean isIndexed()(Code)
If there is a value specified for the indexedProperty field then true will be returned. Otherwise it will be false. Whether the Field is indexed.



process
void process(Map globalConstants, Map constants)(Code)
Replace constants with values in fields and process the depends field to create the dependency Map.



setDepends
public void setDepends(String depends)(Code)
Sets the validation rules for this field as a comma separated list.
Parameters:
  depends - A comma separated list of validator names.



setFieldOrder
public void setFieldOrder(int fieldOrder)(Code)
Sets the position of the Field in the validation list.
Parameters:
  fieldOrder - The field position.



setIndexedListProperty
public void setIndexedListProperty(String indexedListProperty)(Code)
Sets the indexed property name of the field.
Parameters:
  indexedListProperty - The field's indexed List property name.



setIndexedProperty
public void setIndexedProperty(String indexedProperty)(Code)
Sets the indexed property name of the field.
Parameters:
  indexedProperty - The field's indexed property name.



setKey
public void setKey(String key)(Code)
Sets a unique key for the field. This can be used to change the key temporarily to have a unique key for an indexed field.
Parameters:
  key - a unique key for the field



setPage
public void setPage(int page)(Code)
Sets the page value that the Field is associated with for validation.
Parameters:
  page - The page number.



setProperty
public void setProperty(String property)(Code)
Sets the property name of the field.
Parameters:
  property - The field's property name.



toString
public String toString()(Code)
Returns a string representation of the object. A string representation of the object.



validate
public ValidatorResults validate(Map params, Map actions) throws ValidatorException(Code)
Run the configured validations on this field. Run all validations in the depends clause over each item in turn, returning when the first one fails.
Parameters:
  params - A Map of parameter class names to parameter values to passinto validation methods.
Parameters:
  actions - A Map of validator names to ValidatorAction objects. A ValidatorResults object containing validation messages for this field.
throws:
  ValidatorException - If an error occurs during validation.



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.