org.zaval.lw
Class LwSpinValidator

java.lang.Object
  |
  +--org.zaval.lw.mask.BasicMaskValidator
        |
        +--org.zaval.lw.LwSpinValidator
All Implemented Interfaces:
MaskValidator

public class LwSpinValidator
extends BasicMaskValidator

This class is a special mask handler that is used by the spin component to validate and represent bound integer value. On the one hand it handles spin masked text field input and on the other hand it defines mask that should be used by the mask validator, converts the integer spin value to the mask value and converts the mask value to the spin integer value.


Fields inherited from class org.zaval.lw.mask.BasicMaskValidator
LETTER_TYPE, NUMERIC_TYPE
 
Constructor Summary
LwSpinValidator()
           
 
Method Summary
protected  java.lang.String createMask()
          Creates the mask that should be set for the mask validator.
protected  java.lang.String createValue(int value, java.lang.String mask)
          Creates the value by the specified integer value.
protected  int fetchValue(java.lang.String maskValue)
          Fetches the integer value from the masked value.
 int getMaxValue()
          Gets the maximum value.
 int getMinValue()
          Gets the minimum value.
 boolean isValidValue(MaskElement e, java.lang.String value)
          Tests if the specified value is valid for the mask element.
protected  void setBound(int min, int max)
           
 
Methods inherited from class org.zaval.lw.mask.BasicMaskValidator
completeValue, getBlankChar, getTypeByTag, getValueByElement, isHandledTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LwSpinValidator

public LwSpinValidator()
Method Detail

isValidValue

public boolean isValidValue(MaskElement e,
                            java.lang.String value)
Description copied from interface: MaskValidator
Tests if the specified value is valid for the mask element.
Overrides:
isValidValue in class BasicMaskValidator
Following copied from interface: org.zaval.lw.mask.MaskValidator
Parameters:
e - the mask element.
newValue - the new value.
Returns:
true if the mask value is valid; otherwise false.

getMinValue

public int getMinValue()
Gets the minimum value.
Returns:
a minimum value.

getMaxValue

public int getMaxValue()
Gets the maximum value.
Returns:
a maximum value.

createMask

protected java.lang.String createMask()
Creates the mask that should be set for the mask validator.
Returns:
a mask.

createValue

protected java.lang.String createValue(int value,
                                       java.lang.String mask)
Creates the value by the specified integer value. The created value is acceptable for the given mask.
Parameters:
value - the specified integer value.
mask - the specified mask.
Returns:
a value is acceptable for the mask.

fetchValue

protected int fetchValue(java.lang.String maskValue)
Fetches the integer value from the masked value.
Parameters:
maskValue - the masked value.
Returns:
an integer value.

setBound

protected void setBound(int min,
                        int max)


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