PAJES 2.3.9

org.pajes.html.validation
Class ValidationFunction

java.lang.Object
  extended byorg.pajes.html.validation.ValidationFunction
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
IsBetween, IsChecked, IsCreditCard, IsDateTime, IsDecimal, IsEmailAddress, IsEqual, IsFormat, IsInteger, IsLength, IsMandatory, IsNumber, IsSelected, IsValid

public abstract class ValidationFunction
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

ValidationFunction is extendeded by classes that represent client-side JavaScript validation functions.

See Also:
Serialized Form

Constructor Summary
ValidationFunction()
           
 
Method Summary
 java.lang.Object clone()
          Allows the validation function to be cloned.
 java.lang.String getDisplayName()
          Retrieves the field name that will be displayed in the error message.
 InputValidation getInputField()
          Returns the field that will be validated by this validation function.
 boolean isMandatory()
          Determines if this field is mandatory.
 ValidationFunction setDisplayName(java.lang.String displayName)
          Sets the field name that will be displayed in the error message.
 ValidationFunction setInputField(InputValidation field)
          Sets the field that will be validated by this validation function.
 ValidationFunction setMandatory(boolean valueIsRequired)
          Sets validation to ensure the user enters a value in this field.
 ValidationFunction setMandatory(java.lang.String valueIsRequired)
          Sets validation to ensure the user enters a value in this field.
abstract  java.lang.String toJavaScript(Browser browser)
          Converts the validation function into a string to be returned to the browser.
 java.lang.String toString()
          Returns the name of this class as a string.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationFunction

public ValidationFunction()
Method Detail

clone

public java.lang.Object clone()
Allows the validation function to be cloned.

Returns:
the new validation function.
Throws:
java.lang.RuntimeException - if the operation threw a CloneNotSupportedException. This should never happen.

getDisplayName

public java.lang.String getDisplayName()
Retrieves the field name that will be displayed in the error message.

Returns:
the field name that will be displayed in the error message.

getInputField

public InputValidation getInputField()
Returns the field that will be validated by this validation function.

Returns:
the field that will be validated by this validation function.

isMandatory

public boolean isMandatory()
Determines if this field is mandatory.

Returns:
true if this field is mandatory, or false if it is not.

setDisplayName

public ValidationFunction setDisplayName(java.lang.String displayName)
Sets the field name that will be displayed in the error message.

Parameters:
displayName - the field name that will be displayed in the error message.
Returns:
the modified ValidationFunction object.

setInputField

public ValidationFunction setInputField(InputValidation field)
Sets the field that will be validated by this validation function.

Parameters:
field - the field that will be validated by this validation function.
Returns:
the modified ValidationFunction object.

setMandatory

public ValidationFunction setMandatory(boolean valueIsRequired)
Sets validation to ensure the user enters a value in this field.

Parameters:
valueIsRequired - true if a value is mandatory.
Returns:
the modified ValidationFunction object.

setMandatory

public ValidationFunction setMandatory(java.lang.String valueIsRequired)
Sets validation to ensure the user enters a value in this field.

Parameters:
valueIsRequired - "true" (case-insensitive) if a value is mandatory.
Returns:
the modified ValidationFunction object.

toJavaScript

public abstract java.lang.String toJavaScript(Browser browser)
Converts the validation function into a string to be returned to the browser.

Parameters:
browser - the browser to which the function will be returned.
Returns:
the string consisting of the JavaScript function that will be sent to the browser to validate the input field.

toString

public java.lang.String toString()
Returns the name of this class as a string.

Returns:
the name of this class as a string.

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.