Java Doc for ValidatorAction.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.ValidatorAction

ValidatorAction
public class ValidatorAction implements Serializable(Code)
Contains the information to dynamically create and run a validation method. This is the class representation of a pluggable validator that can be defined in an xml file with the <validator> element. Note: The validation method is assumed to be thread safe.
version:
   $Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $




Method Summary
 booleanexecuteValidationMethod(Field field, Map params, ValidatorResults results, int pos)
     Dynamically runs the validation method for this validator and returns true if the data is valid.
public  StringgetClassname()
     Gets the class of the validator action.
public  ListgetDependencyList()
     Returns the dependent validator names as an unmodifiable List.
public  StringgetDepends()
     Gets the dependencies of the validator action as a comma separated list of validator names.
public  StringgetJavascript()
     Gets the Javascript equivalent of the java class and method associated with this action.
public  StringgetJsFunctionName()
     Gets the Javascript function name.
public  StringgetMethod()
     Gets the name of method being called for the validator action.
public  StringgetMethodParams()
     Gets the method parameters for the method.
public  StringgetMsg()
     Gets the message associated with the validator action.
public  StringgetName()
     Gets the name of the validator action.
protected  voidinit()
     Initialize based on set.
public  booleanisDependency(String validatorName)
     Checks whether or not the value passed in is in the depends field.
Parameters:
  validatorName - Name of the dependency to check.
protected synchronized  voidloadJavascriptFunction()
     Load the javascript function specified by the given path.
public  voidsetClassname(String classname)
     Sets the class of the validator action.
public  voidsetDepends(String depends)
     Sets the dependencies of the validator action.
public  voidsetJavascript(String javascript)
     Sets the Javascript equivalent of the java class and method associated with this action.
public  voidsetJsFunction(String jsFunction)
     Sets the fully qualified class path of the Javascript function.

This is optional and can be used instead of the setJavascript(). Attempting to call both setJsFunction and setJavascript will result in an IllegalStateException being thrown.

public  voidsetJsFunctionName(String jsFunctionName)
     Sets the Javascript function name.
public  voidsetMethod(String method)
     Sets the name of method being called for the validator action.
public  voidsetMethodParams(String methodParams)
     Sets the method parameters for the method.
public  voidsetMsg(String msg)
     Sets the message associated with the validator action.
public  voidsetName(String name)
     Sets the name of the validator action.
public  StringtoString()
     Returns a string representation of the object.



Method Detail
executeValidationMethod
boolean executeValidationMethod(Field field, Map params, ValidatorResults results, int pos) throws ValidatorException(Code)
Dynamically runs the validation method for this validator and returns true if the data is valid.
Parameters:
  field -
Parameters:
  params - A Map of class names to parameter values.
Parameters:
  results -
Parameters:
  pos - The index of the list property to validate if it's indexed.
throws:
  ValidatorException -



getClassname
public String getClassname()(Code)
Gets the class of the validator action. Class name of the validator Action.



getDependencyList
public List getDependencyList()(Code)
Returns the dependent validator names as an unmodifiable List. List of the validator action's depedents.



getDepends
public String getDepends()(Code)
Gets the dependencies of the validator action as a comma separated list of validator names. The validator action's dependencies.



getJavascript
public String getJavascript()(Code)
Gets the Javascript equivalent of the java class and method associated with this action. The Javascript validation.



getJsFunctionName
public String getJsFunctionName()(Code)
Gets the Javascript function name. This is optional and can be used instead of validator action name for the name of the Javascript function/object. The Javascript function name.



getMethod
public String getMethod()(Code)
Gets the name of method being called for the validator action. The method name.



getMethodParams
public String getMethodParams()(Code)
Gets the method parameters for the method. Method's parameters.



getMsg
public String getMsg()(Code)
Gets the message associated with the validator action. The message for the validator action.



getName
public String getName()(Code)
Gets the name of the validator action. Validator Action name.



init
protected void init()(Code)
Initialize based on set.



isDependency
public boolean isDependency(String validatorName)(Code)
Checks whether or not the value passed in is in the depends field.
Parameters:
  validatorName - Name of the dependency to check. Whether the named validator is a dependant.



loadJavascriptFunction
protected synchronized void loadJavascriptFunction()(Code)
Load the javascript function specified by the given path. For this implementation, the jsFunction property should contain a fully qualified package and script name, separated by periods, to be loaded from the class loader that created this instance. TODO if the path begins with a '/' the path will be intepreted as absolute, and remain unchanged. If this fails then it will attempt to treat the path as a file path. It is assumed the script ends with a '.js'.



setClassname
public void setClassname(String classname)(Code)
Sets the class of the validator action.
Parameters:
  classname - Class name of the validator Action.



setDepends
public void setDepends(String depends)(Code)
Sets the dependencies of the validator action.
Parameters:
  depends - A comma separated list of validator names.



setJavascript
public void setJavascript(String javascript)(Code)
Sets the Javascript equivalent of the java class and method associated with this action.
Parameters:
  javascript - The Javascript validation.



setJsFunction
public void setJsFunction(String jsFunction)(Code)
Sets the fully qualified class path of the Javascript function.

This is optional and can be used instead of the setJavascript(). Attempting to call both setJsFunction and setJavascript will result in an IllegalStateException being thrown.

If neither setJsFunction or setJavascript is set then validator will attempt to load the default javascript definition.

 Examples
 If in the validator.xml :
 #1:
 <validator name="tire"
 jsFunction="com.yourcompany.project.tireFuncion">
 Validator will attempt to load com.yourcompany.project.validateTireFunction.js from
 its class path.
 #2:
 <validator name="tire">
 Validator will use the name attribute to try and load
 org.apache.commons.validator.javascript.validateTire.js
 which is the default javascript definition.
 

Parameters:
  jsFunction - The Javascript function's fully qualified class path.



setJsFunctionName
public void setJsFunctionName(String jsFunctionName)(Code)
Sets the Javascript function name. This is optional and can be used instead of validator action name for the name of the Javascript function/object.
Parameters:
  jsFunctionName - The Javascript function name.



setMethod
public void setMethod(String method)(Code)
Sets the name of method being called for the validator action.
Parameters:
  method - The method name.



setMethodParams
public void setMethodParams(String methodParams)(Code)
Sets the method parameters for the method.
Parameters:
  methodParams - A comma separated list of parameters.



setMsg
public void setMsg(String msg)(Code)
Sets the message associated with the validator action.
Parameters:
  msg - The message for the validator action.



setName
public void setName(String name)(Code)
Sets the name of the validator action.
Parameters:
  name - Validator Action name.



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



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.