toolbox.web.validation
Class ValidatorFactory

Package class diagram package ValidatorFactory
java.lang.Object
  extended by toolbox.web.validation.ValidatorFactory

public class ValidatorFactory
extends java.lang.Object

Factory to create Validator instances.


Constructor Summary
ValidatorFactory()
          Default constructor
ValidatorFactory(XMLProperties xmlProps, javax.servlet.ServletContext context)
          Initialise this factory by creating and caching all Validator instances specified in the given XML configuration.
 
Method Summary
 void destroy()
          Destroy this factory by destroying the validator cache.
 Validator getValidator(java.lang.String name)
          Return the named validator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatorFactory

public ValidatorFactory()
Default constructor


ValidatorFactory

public ValidatorFactory(XMLProperties xmlProps,
                        javax.servlet.ServletContext context)
                 throws ValidationException
Initialise this factory by creating and caching all Validator instances specified in the given XML configuration.

Parameters:
xmlProps - XML configuration properties.
context - The context where this factory is being used.
Throws:
ValidationException - if the factory cannot be created.
Method Detail

getValidator

public Validator getValidator(java.lang.String name)
Return the named validator

Parameters:
name - String containing the name of the validator to return.
Returns:
Validator with the given name.

destroy

public void destroy()
Destroy this factory by destroying the validator cache.