|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.validation.ValidationFactory
public class ValidationFactory
Constucts validations be reading rules from a configuration file
Copyright: Copyright (c) Formaria Ltd., 2008
License: see license.txt
| Field Summary | |
|---|---|
protected static int |
changeCounter
A counter for changes to the registry. |
protected static java.util.Hashtable |
configFiles
The config files used to build the set of component adapters. |
protected Project |
currentProject
|
protected int |
localChangeCounter
Used for tracking changes to the registry spec. |
protected java.util.Hashtable |
validations
Hashtable of validation generated from the file referenced by the 'Validations' property in startup.properties |
| Constructor Summary | |
|---|---|
ValidationFactory(Project project)
Constructor which reads validations from the reader |
|
| Method Summary | |
|---|---|
static void |
addConfigFile(java.lang.String key,
java.lang.Object resource,
boolean overwrite)
Add a configuration file. |
void |
checkRegistration()
Check that all the registered components are loaded |
protected void |
doRead(java.lang.String key,
java.lang.Object configFile)
Read the component registry. |
protected void |
doRead(java.lang.String key,
java.lang.String configFile)
Read the component registry. |
protected void |
doRead(java.lang.String key,
java.net.URL configFileURL)
Read the component registry. |
Validator |
getValidation(java.lang.String validationName,
int mask,
java.lang.Object page,
XmlElement instanceConfig)
Gets the validation for the validationName. |
Validator |
getValidation(java.lang.String validationName,
java.lang.reflect.Method m,
int mask,
java.lang.Object page,
XmlElement instanceConfig)
Creates an Validation object which validates against a value returned from a function call |
protected void |
read()
Read the component registry. |
void |
read(java.lang.String key,
java.io.Reader reader)
Read the component registry. |
protected void |
read(java.lang.String key,
java.lang.String configFile)
Read the component registry. |
void |
updateConfig()
Signal that the configuration has been updated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.util.Hashtable configFiles
protected static int changeCounter
protected int localChangeCounter
protected Project currentProject
protected java.util.Hashtable validations
| Constructor Detail |
|---|
public ValidationFactory(Project project)
| Method Detail |
|---|
public Validator getValidation(java.lang.String validationName,
java.lang.reflect.Method m,
int mask,
java.lang.Object page,
XmlElement instanceConfig)
validationName - The name of the validationm - The Method to call in order to get the value to validate againstmask - The event mask to be applied to the validationpage - The page object which contains the functioninstanceConfig - the XML element which is declared in the page
public Validator getValidation(java.lang.String validationName,
int mask,
java.lang.Object page,
XmlElement instanceConfig)
page - The page object which contains the functionvalidationName - The name of the validationmask - The event mask to be applied to the validation
public static void addConfigFile(java.lang.String key,
java.lang.Object resource,
boolean overwrite)
key - the name by which the configuration file is referencedresource - the name/path of the configuration file or the URL for the fileoverwrite - true to overwrite and existing entry matching the specified keypublic void updateConfig()
protected void read()
protected void read(java.lang.String key,
java.lang.String configFile)
configFile - the name of the configuration filekey - the name by which the configuration file is referenced
protected void doRead(java.lang.String key,
java.lang.Object configFile)
configFile - the name of the configuration filekey - the name by which the configuration file is referenced
protected void doRead(java.lang.String key,
java.lang.String configFile)
configFile - the name of the configuration filekey - the name by which the configuration file is referenced
protected void doRead(java.lang.String key,
java.net.URL configFileURL)
configFileURL - the URL of the configuration filekey - the name by which the configuration file is referenced
public void read(java.lang.String key,
java.io.Reader reader)
key - the name by which the configuration file is referencedreader - the reader from which to read the filepublic void checkRegistration()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||