jet.validation
Class ValidationRule

java.lang.Object
  extended by jet.validation.ValidationRule

public class ValidationRule
extends java.lang.Object

Class providinginterface to commons validation

Author:
markus.meisters@web.de

Field Summary
static java.lang.String AJAX
          indicates ajax validation
private  java.util.List<java.lang.String> args
          args
static java.lang.String CLIENT
          indicates client side validation
private  java.lang.String componentNameKey
          validation rule component name key
private  java.lang.String messageKey
          validation rule message key
private  java.lang.String name
          validation rule name
static java.lang.String SERVER
          indicates server side validation
 java.lang.String type
          type of validation server or client side
 
Constructor Summary
ValidationRule(java.lang.String name, java.lang.String type)
          Constructor
ValidationRule(java.lang.String name, java.lang.String componentNameKey, java.lang.String type)
          Constructor
 
Method Summary
 void addParam(java.lang.String arg)
          Method to add arguments
 java.lang.String getComponentNameKey()
          Returns the component key which we should validate (also needed to localise the field name in validation message)
 java.lang.String getMessageKey()
          Returns the message key
 java.lang.String getName()
          Get the name of the validation
 java.lang.String getParam(int i)
          Returns the argument on given pos
 java.util.List getParams()
          Returns the arguments
 java.lang.String getType()
          Get the type of the validation
 boolean hasArgs()
          Indicates if arguments exists
 boolean hasClientSideValidation()
          indicates server or client side valdiation
 boolean isAjaxValidation()
          indicates ajax valdiation
 void setMessageKey(java.lang.String messageKey)
          Sets the message key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER

public static final java.lang.String SERVER
indicates server side validation

See Also:
Constant Field Values

CLIENT

public static final java.lang.String CLIENT
indicates client side validation

See Also:
Constant Field Values

AJAX

public static final java.lang.String AJAX
indicates ajax validation

See Also:
Constant Field Values

name

private java.lang.String name
validation rule name


componentNameKey

private java.lang.String componentNameKey
validation rule component name key


messageKey

private java.lang.String messageKey
validation rule message key


type

public java.lang.String type
type of validation server or client side


args

private java.util.List<java.lang.String> args
args

Constructor Detail

ValidationRule

public ValidationRule(java.lang.String name,
                      java.lang.String type)
Constructor

Parameters:
name - name of the rule to use
type - the type

ValidationRule

public ValidationRule(java.lang.String name,
                      java.lang.String componentNameKey,
                      java.lang.String type)
Constructor

Parameters:
name - name of the rule to use
componentNameKey - the localizer key for name of component
type - the type
Method Detail

getName

public java.lang.String getName()
Get the name of the validation

Returns:
String name

getType

public java.lang.String getType()
Get the type of the validation

Returns:
String type

addParam

public void addParam(java.lang.String arg)
Method to add arguments

Parameters:
arg - argument

getParam

public java.lang.String getParam(int i)
Returns the argument on given pos

Parameters:
i - position
Returns:
String argument

getParams

public java.util.List getParams()
Returns the arguments

Returns:
List argument

hasArgs

public boolean hasArgs()
Indicates if arguments exists

Returns:
boolean arguments exists

hasClientSideValidation

public boolean hasClientSideValidation()
indicates server or client side valdiation


isAjaxValidation

public boolean isAjaxValidation()
indicates ajax valdiation


getComponentNameKey

public java.lang.String getComponentNameKey()
Returns the component key which we should validate (also needed to localise the field name in validation message)

Returns:
String component key

getMessageKey

public java.lang.String getMessageKey()
Returns the message key

Returns:
String component key

setMessageKey

public void setMessageKey(java.lang.String messageKey)
Sets the message key

Parameters:
messageKey - key used for localized message