toolbox.web.validation
Interface Field

Package class diagram package Field
All Known Implementing Classes:
AbstractField, BooleanField, DateField, NumberField, RegexField, RSAIdentityNumberField, StringField

public interface Field

Interface defining a form field. The interface defines the set of base properties and operations that each field must implement.


Method Summary
 java.lang.String getDefault()
          Return string representation of the default value of this field
 java.lang.String getName()
          Return the name of this field.
 java.util.regex.Pattern getPattern()
          Return the pattern used to identify this field.
 java.util.Properties getProperties()
          Return all the field specific properties.
 java.lang.String getProperty(java.lang.String name)
          Return a field specific property.
 java.lang.String getResourceKey()
          Return the resource key used to lookup the display value of this field.
 boolean isRequired()
          Indicates whether this field is required or not.
 void setDefault(java.lang.String value)
          Set string representation of the default value of this field.
 void setName(java.lang.String name)
          Set the name of this field.
 void setPattern(java.util.regex.Pattern pattern)
          Set the pattern used to identify this field.
 void setProperties(java.util.Properties props)
          Set any field specific properties.
 void setRequired(java.lang.Boolean required)
          Set the required flag of this field.
 void setResourceKey(java.lang.String key)
          Set the value of the resource key used to look up the display value of this field.
 java.lang.Object validate(java.lang.String value, java.util.ResourceBundle bundle)
          Perform validation of the given String value and return target type of this field.
 

Method Detail

getName

java.lang.String getName()
Return the name of this field.

Returns:
String containing the name of this field.

setName

void setName(java.lang.String name)
Set the name of this field.

Parameters:
name - String indicating the name of this field.

getResourceKey

java.lang.String getResourceKey()
Return the resource key used to lookup the display value of this field.

Returns:
String containing the resource key of this field.

setResourceKey

void setResourceKey(java.lang.String key)
Set the value of the resource key used to look up the display value of this field.

Parameters:
key - String containing resource key.

getPattern

java.util.regex.Pattern getPattern()
Return the pattern used to identify this field.

Returns:
Pattern containing regex pattern used to identify this field.

setPattern

void setPattern(java.util.regex.Pattern pattern)
Set the pattern used to identify this field.

Parameters:
pattern - Pattern containing the regex pattern used to identify this field.

isRequired

boolean isRequired()
Indicates whether this field is required or not.

Returns:
boolean indicating whether this field is required.

setRequired

void setRequired(java.lang.Boolean required)
Set the required flag of this field.

Parameters:
required - Flag to indicate whether this field is required.

getDefault

java.lang.String getDefault()
Return string representation of the default value of this field

Returns:
String containing default value.

setDefault

void setDefault(java.lang.String value)
                throws ValidationException
Set string representation of the default value of this field.

Parameters:
value - String representation of default value.
Throws:
ValidationException - if the default value cannot be created.

setProperties

void setProperties(java.util.Properties props)
Set any field specific properties.

Parameters:
props - Field specific properties.

getProperty

java.lang.String getProperty(java.lang.String name)
Return a field specific property.

Parameters:
name - Property name.
Returns:
String containing the value of the field specific property.

getProperties

java.util.Properties getProperties()
Return all the field specific properties.

Returns:
Properties instance containing all field specific properties.

validate

java.lang.Object validate(java.lang.String value,
                          java.util.ResourceBundle bundle)
                          throws ValidationException
Perform validation of the given String value and return target type of this field.

Parameters:
value - String value that must be validated.
bundle - ResourceBundle to use for messages.
Returns:
Object containing the result of the validation.
Throws:
ValidationException - if the field cannot be validated.