org.apache.shale.validator.util
Class ShaleValidatorAction

java.lang.Object
  extended by org.apache.shale.validator.util.ShaleValidatorAction

public final class ShaleValidatorAction
extends Object

Custom wrapper around a Commons Validator ValidatorAction that precalculates as many of the introspective lookup operations as possible. This ensures that runtime operation of the validator checks can proceed as quickly as possible.


Constructor Summary
ShaleValidatorAction(ValidatorResources resources, ValidatorAction action)
          Create a new instance of ShaleValidatorAction that wraps the specified ValidatorAction.
 
Method Summary
 ValidatorAction getAction()
          Return the ValidatorAction instance we are wrapping.
 Object getInstance()
          Return an instance of the requested validator class, if the requested validation method is not static.
 Arg[] getMessageArgs()
          Return an array of argument metadata describing subtitution values for error messages emitted by this validator type.
 String getMessageKey()
          Return the lookup key for the error message template to be used if this validation fails.
 Method getMethod()
          Return the validation Method to be called for this action.
 Arg[] getParameterArgs()
          Return an array of argument metadata describing the parameter values to be sent to the validation method for this validator type.
 Class[] getSignature()
          Return the parameter signature for the validation method to be called for this action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShaleValidatorAction

public ShaleValidatorAction(ValidatorResources resources,
                            ValidatorAction action)

Create a new instance of ShaleValidatorAction that wraps the specified ValidatorAction.

Parameters:
resources - ValidatorResources for this application
action - The ValidatorAction to be wrapped
Throws:
IllegalArgumentException - if configuration data is missing or incorrect
Method Detail

getAction

public ValidatorAction getAction()

Return the ValidatorAction instance we are wrapping.


getInstance

public Object getInstance()

Return an instance of the requested validator class, if the requested validation method is not static. If the method is static, return null instead.


getMessageArgs

public Arg[] getMessageArgs()

Return an array of argument metadata describing subtitution values for error messages emitted by this validator type.


getMessageKey

public String getMessageKey()

Return the lookup key for the error message template to be used if this validation fails.


getMethod

public Method getMethod()

Return the validation Method to be called for this action.


getParameterArgs

public Arg[] getParameterArgs()

Return an array of argument metadata describing the parameter values to be sent to the validation method for this validator type.


getSignature

public Class[] getSignature()

Return the parameter signature for the validation method to be called for this action.



Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.