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

All known Subclasses:   org.apache.commons.validator.custom.CustomValidatorResources,
ValidatorResources
public class ValidatorResources implements Serializable(Code)

General purpose class for storing FormSet objects based on their associated Locale. Instances of this class are usually configured through a validation.xml file that is parsed in a constructor.

Note - Classes that extend this class must be Serializable so that instances may be used in distributable application server environments.

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


version:
   $Revision: 478473 $ $Date: 2006-11-23 05:42:30 +0000 (Thu, 23 Nov 2006) $


Field Summary
protected  FormSetdefaultFormSet
     This is the default FormSet (without locale).
protected static  LocaledefaultLocale
     The default locale on our server.
protected  FastHashMaphActions
     Map of ValidatorActions with the name of the ValidatorAction as the key.
protected  FastHashMaphConstants
     Map of global constant values with the name of the constant as the key.
protected  FastHashMaphFormSets
     Map of FormSets stored under a Locale key.

Constructor Summary
public  ValidatorResources()
     Create an empty ValidatorResources object.
public  ValidatorResources(InputStream in)
     Create a ValidatorResources object from an InputStream.
Parameters:
  in - InputStream to a validation.xml configuration file.
public  ValidatorResources(InputStream[] streams)
     Create a ValidatorResources object from an InputStream.
public  ValidatorResources(String uri)
     Create a ValidatorResources object from an uri
Parameters:
  uri - The location of a validation.xml configuration file.
public  ValidatorResources(String[] uris)
    
public  ValidatorResources(URL url)
     Create a ValidatorResources object from a URL.
public  ValidatorResources(URL[] urls)
     Create a ValidatorResources object from several URL.

Method Summary
public  voidaddConstant(String name, String value)
     Add a global constant to the resource.
public  voidaddFormSet(FormSet fs)
     Add a FormSet to this ValidatorResources object.
public  voidaddValidatorAction(ValidatorAction va)
     Add a ValidatorAction to the resource.
protected  StringbuildKey(FormSet fs)
     Builds a key to store the FormSet under based on it's language, country, and variant values.
Parameters:
  fs - The Form Set.
protected  MapgetActions()
     Returns a Map of String ValidatorAction names to their ValidatorAction.
protected  MapgetConstants()
     Returns a Map of String constant names to their String values.
public  FormgetForm(Locale locale, String formKey)
    

Gets a Form based on the name of the form and the Locale that most closely matches the Locale passed in.

public  FormgetForm(String language, String country, String variant, String formKey)
    

Gets a Form based on the name of the form and the Locale that most closely matches the Locale passed in.

 FormSetgetFormSet(String language, String country, String variant)
    

Gets a FormSet based on the language, country and variant.


Parameters:
  language - The locale's language.
Parameters:
  country - The locale's country.
Parameters:
  variant - The locale's language variant.
protected  MapgetFormSets()
     Returns a Map of String locale keys to Lists of their FormSets.
public  ValidatorActiongetValidatorAction(String key)
     Get a ValidatorAction based on it's name.
Parameters:
  key - The validator action key.
public  MapgetValidatorActions()
     Get an unmodifiable Map of the ValidatorActions.
public  voidprocess()
     Process the ValidatorResources object.

Field Detail
defaultFormSet
protected FormSet defaultFormSet(Code)
This is the default FormSet (without locale). (We probably don't need the defaultLocale anymore.)



defaultLocale
protected static Locale defaultLocale(Code)
The default locale on our server.



hActions
protected FastHashMap hActions(Code)
Map of ValidatorActions with the name of the ValidatorAction as the key.



hConstants
protected FastHashMap hConstants(Code)
Map of global constant values with the name of the constant as the key.



hFormSets
protected FastHashMap hFormSets(Code)
Map of FormSets stored under a Locale key.




Constructor Detail
ValidatorResources
public ValidatorResources()(Code)
Create an empty ValidatorResources object.



ValidatorResources
public ValidatorResources(InputStream in) throws IOException, SAXException(Code)
Create a ValidatorResources object from an InputStream.
Parameters:
  in - InputStream to a validation.xml configuration file. It's the client'sresponsibility to close this stream.
throws:
  IOException -
throws:
  SAXException - if the validation XML files are not valid or wellformed.
throws:
  IOException - if an I/O error occurs processing the XML files
since:
   Validator 1.1



ValidatorResources
public ValidatorResources(InputStream[] streams) throws IOException, SAXException(Code)
Create a ValidatorResources object from an InputStream.
Parameters:
  streams - An array of InputStreams to several validation.xmlconfiguration files that will be read in order and merged into this object.It's the client's responsibility to close these streams.
throws:
  IOException -
throws:
  SAXException - if the validation XML files are not valid or wellformed.
throws:
  IOException - if an I/O error occurs processing the XML files
since:
   Validator 1.1



ValidatorResources
public ValidatorResources(String uri) throws IOException, SAXException(Code)
Create a ValidatorResources object from an uri
Parameters:
  uri - The location of a validation.xml configuration file.
throws:
  IOException -
throws:
  SAXException - if the validation XML files are not valid or wellformed.
throws:
  IOException - if an I/O error occurs processing the XML files
since:
   Validator 1.2



ValidatorResources
public ValidatorResources(String[] uris) throws IOException, SAXException(Code)
Create a ValidatorResources object from several uris
Parameters:
  uris - An array of uris to several validation.xmlconfiguration files that will be read in order and merged into this object.
throws:
  IOException -
throws:
  SAXException - if the validation XML files are not valid or wellformed.
throws:
  IOException - if an I/O error occurs processing the XML files
since:
   Validator 1.2



ValidatorResources
public ValidatorResources(URL url) throws IOException, SAXException(Code)
Create a ValidatorResources object from a URL.
Parameters:
  url - The URL for the validation.xmlconfiguration file that will be read into this object.
throws:
  IOException -
throws:
  SAXException - if the validation XML file are not valid or wellformed.
throws:
  IOException - if an I/O error occurs processing the XML files
since:
   Validator 1.3.1



ValidatorResources
public ValidatorResources(URL[] urls) throws IOException, SAXException(Code)
Create a ValidatorResources object from several URL.
Parameters:
  urls - An array of URL to several validation.xmlconfiguration files that will be read in order and merged into this object.
throws:
  IOException -
throws:
  SAXException - if the validation XML files are not valid or wellformed.
throws:
  IOException - if an I/O error occurs processing the XML files
since:
   Validator 1.3.1




Method Detail
addConstant
public void addConstant(String name, String value)(Code)
Add a global constant to the resource.
Parameters:
  name - The constant name.
Parameters:
  value - The constant value.



addFormSet
public void addFormSet(FormSet fs)(Code)
Add a FormSet to this ValidatorResources object. It will be associated with the Locale of the FormSet.
Parameters:
  fs - The form set to add.
since:
   Validator 1.1



addValidatorAction
public void addValidatorAction(ValidatorAction va)(Code)
Add a ValidatorAction to the resource. It also creates an instance of the class based on the ValidatorActions classname and retrieves the Method instance and sets them in the ValidatorAction.
Parameters:
  va - The validator action.



buildKey
protected String buildKey(FormSet fs)(Code)
Builds a key to store the FormSet under based on it's language, country, and variant values.
Parameters:
  fs - The Form Set. generated key for a formset.



getActions
protected Map getActions()(Code)
Returns a Map of String ValidatorAction names to their ValidatorAction. Map of Validator Actions
since:
   Validator 1.2.0



getConstants
protected Map getConstants()(Code)
Returns a Map of String constant names to their String values. Map of Constants
since:
   Validator 1.2.0



getForm
public Form getForm(Locale locale, String formKey)(Code)

Gets a Form based on the name of the form and the Locale that most closely matches the Locale passed in. The order of Locale matching is:

  1. language + country + variant
  2. language + country
  3. language
  4. default locale

Parameters:
  locale - The Locale.
Parameters:
  formKey - The key for the Form. The validator Form.
since:
   Validator 1.1



getForm
public Form getForm(String language, String country, String variant, String formKey)(Code)

Gets a Form based on the name of the form and the Locale that most closely matches the Locale passed in. The order of Locale matching is:

  1. language + country + variant
  2. language + country
  3. language
  4. default locale

Parameters:
  language - The locale's language.
Parameters:
  country - The locale's country.
Parameters:
  variant - The locale's language variant.
Parameters:
  formKey - The key for the Form. The validator Form.
since:
   Validator 1.1



getFormSet
FormSet getFormSet(String language, String country, String variant)(Code)

Gets a FormSet based on the language, country and variant.


Parameters:
  language - The locale's language.
Parameters:
  country - The locale's country.
Parameters:
  variant - The locale's language variant. The FormSet for a locale.
since:
   Validator 1.2



getFormSets
protected Map getFormSets()(Code)
Returns a Map of String locale keys to Lists of their FormSets. Map of Form sets
since:
   Validator 1.2.0



getValidatorAction
public ValidatorAction getValidatorAction(String key)(Code)
Get a ValidatorAction based on it's name.
Parameters:
  key - The validator action key. The validator action.



getValidatorActions
public Map getValidatorActions()(Code)
Get an unmodifiable Map of the ValidatorActions. Map of validator actions.



process
public void process()(Code)
Process the ValidatorResources object. Currently sets the FastHashMap s to the 'fast' mode and call the processes all other resources. Note : The framework calls this automatically when ValidatorResources is created from an XML file. If you create an instance of this class by hand you must call this method when finished.



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.