com.opensymphony.xwork2.validator
Class DefaultValidatorFactory

java.lang.Object
  extended by com.opensymphony.xwork2.validator.DefaultValidatorFactory
All Implemented Interfaces:
ValidatorFactory

public class DefaultValidatorFactory
extends java.lang.Object
implements ValidatorFactory

Default validator factory

Version:
$Date: 2009-12-27 19:18:29 +0100 (Sun, 27 Dec 2009) $ $Id: DefaultValidatorFactory.java 894090 2009-12-27 18:18:29Z martinc $
Author:
Jason Carreira, James House

Field Summary
protected  ObjectFactory objectFactory
           
protected  ValidatorFileParser validatorFileParser
           
protected  java.util.Map<java.lang.String,java.lang.String> validators
           
 
Constructor Summary
DefaultValidatorFactory(ObjectFactory objectFactory, ValidatorFileParser parser)
           
 
Method Summary
 Validator getValidator(ValidatorConfig cfg)
          Get a Validator that matches the given configuration.
 java.lang.String lookupRegisteredValidatorType(java.lang.String name)
          Lookup to get the FQ classname of the given validator name.
 void registerValidator(java.lang.String name, java.lang.String className)
          Registers the given validator to the existing map of validators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validators

protected java.util.Map<java.lang.String,java.lang.String> validators

objectFactory

protected ObjectFactory objectFactory

validatorFileParser

protected ValidatorFileParser validatorFileParser
Constructor Detail

DefaultValidatorFactory

public DefaultValidatorFactory(ObjectFactory objectFactory,
                               ValidatorFileParser parser)
Method Detail

getValidator

public Validator getValidator(ValidatorConfig cfg)
Description copied from interface: ValidatorFactory
Get a Validator that matches the given configuration.

Specified by:
getValidator in interface ValidatorFactory
Parameters:
cfg - the configurator.
Returns:
the validator.

registerValidator

public void registerValidator(java.lang.String name,
                              java.lang.String className)
Description copied from interface: ValidatorFactory
Registers the given validator to the existing map of validators. This will add to the existing list.

Specified by:
registerValidator in interface ValidatorFactory
Parameters:
name - name of validator to add.
className - the FQ classname of the validator.

lookupRegisteredValidatorType

public java.lang.String lookupRegisteredValidatorType(java.lang.String name)
Description copied from interface: ValidatorFactory
Lookup to get the FQ classname of the given validator name.

Specified by:
lookupRegisteredValidatorType in interface ValidatorFactory
Parameters:
name - name of validator to lookup.
Returns:
the found FQ classname


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.