PAJES 2.3.9

org.pajes.html.validation
Class IsFormat

java.lang.Object
  extended byorg.pajes.html.validation.ValidationFunction
      extended byorg.pajes.html.validation.IsFormat
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class IsFormat
extends ValidationFunction

Creates a JavaScript validation function to validate that the value entered by the user is in a format specified by a provided mask. The default mask values are:

   9 number

See Also:
Serialized Form

Constructor Summary
IsFormat()
          Creates a JavaScript validation function.
IsFormat(InputField element, java.lang.String displayName, java.lang.String formatMask, boolean mandatory)
          Creates a JavaScript validation function.
 
Method Summary
 void setFormatMask(java.lang.String formatMask)
          Sets the formatMask.
 java.lang.String toJavaScript(Browser browser)
          Converts the validation function into a string to be returned to the browser.
 
Methods inherited from class org.pajes.html.validation.ValidationFunction
clone, getDisplayName, getInputField, isMandatory, setDisplayName, setInputField, setMandatory, setMandatory, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IsFormat

public IsFormat()
Creates a JavaScript validation function.


IsFormat

public IsFormat(InputField element,
                java.lang.String displayName,
                java.lang.String formatMask,
                boolean mandatory)
Creates a JavaScript validation function.

Parameters:
element - the input field to be validated.
displayName - the name of the field that will appear in any error messages.
formatMask - the format mask with which the user input must comply.
mandatory - true if a value is required, or false if it may be left blank.
Method Detail

setFormatMask

public void setFormatMask(java.lang.String formatMask)
Sets the formatMask.

Parameters:
formatMask - the formatMask.

toJavaScript

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

Specified by:
toJavaScript in class ValidationFunction
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.

PAJES 2.3.9

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