com.ibm.xsp.convert
Class MaskConverter

java.lang.Object
  extended by com.ibm.xsp.convert.MaskConverter
All Implemented Interfaces:
javax.faces.component.StateHolder, javax.faces.convert.Converter

public class MaskConverter
extends java.lang.Object
implements javax.faces.convert.Converter, javax.faces.component.StateHolder

The xp:convertMask tag converts data to a JSF formatted string and vice versa.

See Also:
IBM Rational Software Information Centre - Mask Converter

Field Summary
static java.lang.String CONVERTER_ID
          The converter id for this converter.
static char MASK_ALPHABET
          Mask Input Character: Any character.
static char MASK_CHARDIGIT
          Mask Character: Any character or number.
static char MASK_DIGIT
          Mask Input Character: Any valid number.
static char MASK_ESCAPE
          Mask Character: Escape
static char MASK_HEXA
          Mask Character: Any hex character (0-9, a-f or A-F).
static char MASK_LOWERCASE
          Mask Character: Any character.
static char MASK_START
          Mask Character: Anything.
static char MASK_UPPERCASE
          Mask Character: Any character.
 
Constructor Summary
MaskConverter()
           
 
Method Summary
protected  javax.faces.convert.ConverterException createFailedToConvertObjectEx()
          Return error message
 java.lang.Object getAsObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String value)
          Return value as an object
 java.lang.String getAsString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value)
          Return value as a string
 java.lang.String getMask()
          Return the mask specified by setMask(String)
 boolean isAsis()
          Return true if As Is is set using setAsis(boolean)
 boolean isTransient()
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAsis(boolean b)
          Specify whether data other than masked inputted are removed or not.
 void setMask(java.lang.String string)
          Specify an input mask pattern by using mask characters.
 void setTransient(boolean newTransientValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASK_ESCAPE

public static final char MASK_ESCAPE
Mask Character: Escape

See Also:
Constant Field Values

MASK_DIGIT

public static final char MASK_DIGIT
Mask Input Character: Any valid number.

See Also:
Constant Field Values

MASK_ALPHABET

public static final char MASK_ALPHABET
Mask Input Character: Any character.

See Also:
Constant Field Values

MASK_UPPERCASE

public static final char MASK_UPPERCASE
Mask Character: Any character. All lowercase letters are mapped to upper case.

See Also:
Constant Field Values

MASK_LOWERCASE

public static final char MASK_LOWERCASE
Mask Character: Any character. All upper case letters are mapped to lower case.

See Also:
Constant Field Values

MASK_CHARDIGIT

public static final char MASK_CHARDIGIT
Mask Character: Any character or number.

See Also:
Constant Field Values

MASK_START

public static final char MASK_START
Mask Character: Anything.

See Also:
Constant Field Values

MASK_HEXA

public static final char MASK_HEXA
Mask Character: Any hex character (0-9, a-f or A-F).

See Also:
Constant Field Values

CONVERTER_ID

public static final java.lang.String CONVERTER_ID
The converter id for this converter.

See Also:
Constant Field Values
Constructor Detail

MaskConverter

public MaskConverter()
Method Detail

createFailedToConvertObjectEx

protected javax.faces.convert.ConverterException createFailedToConvertObjectEx()
Return error message


getAsObject

public java.lang.Object getAsObject(javax.faces.context.FacesContext context,
                                    javax.faces.component.UIComponent component,
                                    java.lang.String value)
Return value as an object

Specified by:
getAsObject in interface javax.faces.convert.Converter

getAsString

public java.lang.String getAsString(javax.faces.context.FacesContext context,
                                    javax.faces.component.UIComponent component,
                                    java.lang.Object value)
Return value as a string

Specified by:
getAsString in interface javax.faces.convert.Converter

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder

isAsis

public boolean isAsis()
Return true if As Is is set using setAsis(boolean)


getMask

public java.lang.String getMask()
Return the mask specified by setMask(String)


setAsis

public void setAsis(boolean b)
Specify whether data other than masked inputted are removed or not.


setMask

public void setMask(java.lang.String string)
Specify an input mask pattern by using mask characters.


isTransient

public boolean isTransient()
Specified by:
isTransient in interface javax.faces.component.StateHolder

setTransient

public void setTransient(boolean newTransientValue)
Specified by:
setTransient in interface javax.faces.component.StateHolder