org.zaval.lw.mask
Interface MaskValidator

All Known Implementing Classes:
BasicMaskValidator, DateMaskValidator

public interface MaskValidator

This interface is used with a masked text to perform mask validation process. The interface provides following abilities


Method Summary
 java.lang.String completeValue(MaskElement e, java.lang.String newValue)
          Completes the new value for the specified mask element.
 char getBlankChar(char tag)
          Gets the blank character for the specified mask tag.
 int getTypeByTag(char tag)
          Gets the type for the specified mask tag.
 boolean isHandledTag(char tag)
          Tests if the mask tag is handled with the validator.
 boolean isValidValue(MaskElement e, java.lang.String newValue)
          Tests if the specified value is valid for the mask element.
 

Method Detail

isHandledTag

public boolean isHandledTag(char tag)
Tests if the mask tag is handled with the validator.
Parameters:
tag - the mask tag.
Returns:
true if the mask handles the specified mask tag; otherwise false.

getTypeByTag

public int getTypeByTag(char tag)
Gets the type for the specified mask tag. The method should returns -1 type if the tag is not bound with any type.
Parameters:
tag - the mask tag.
Returns:
a type.

getBlankChar

public char getBlankChar(char tag)
Gets the blank character for the specified mask tag. The blank char is used to fill mask value for the tag.
Parameters:
tag - the mask tag.
Returns:
a blank character.

isValidValue

public boolean isValidValue(MaskElement e,
                            java.lang.String newValue)
Tests if the specified value is valid for the mask element.
Parameters:
e - the mask element.
newValue - the new value.
Returns:
true if the mask value is valid; otherwise false.

completeValue

public java.lang.String completeValue(MaskElement e,
                                      java.lang.String newValue)
Completes the new value for the specified mask element.
Parameters:
e - the mask element.
newValue - the new value.
Returns:
a new completed value.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org