public class BaseValidator extends Object implements Validator, StateHolder
Modifier and Type | Field and Description |
---|---|
static String |
BAD_PARAMETER_LONG_ID |
static String |
BAD_PARAMETER_SHORT_ID |
static String |
BAD_STRING_LONG_ID |
static String |
BAD_STRING_SHORT_ID |
static String |
BAD_TYPE_LONG_ID |
static String |
BAD_TYPE_SHORT_ID |
static String |
EMPTY_MESSAGE_ID |
protected boolean |
m_bShowCAFErrorMsg |
protected boolean |
m_bTransient |
protected Locale |
m_clientLocale |
protected String |
m_CustomMessage |
static String |
MIN_MAX_MESSAGE_ID |
static String |
NULL_PATTERN_MESSAGE_ID |
static String |
OVER_MAX_MESSAGE_ID |
static String |
UNDER_MIN_MESSAGE_ID |
NOT_IN_RANGE_MESSAGE_ID
Constructor and Description |
---|
BaseValidator() |
Modifier and Type | Method and Description |
---|---|
protected Locale |
getClientLocale(FacesContext context)
getRegion Set the locale for the validated to use.
|
String |
getCustomErrorMsg()
getCustomMsg get the user defined message for a convervion failure.
|
protected String |
getRegionAsString()
getRegion Set the locale for the validated to use.
|
boolean |
getshowCAFErrorMsg()
Show the exception cause if availible.
|
boolean |
isStringObj(Object obj)
isStringObj will check the class and see if the string is
not just full of spaces.
|
boolean |
isTransient() |
boolean |
isValue(String sValue) |
void |
restoreState(FacesContext context,
Object state) |
Object |
saveState(FacesContext context) |
void |
setCustomErrorMsg(String sMsg)
setCustomMsg Set a localized massage used if the convervion fails.
|
void |
setRegion(String region)
setRegion Set the locale for the validated to use.
|
void |
setshowCAFErrorMsg(boolean bShow)
Show the exception cause if availible.
|
void |
setTransient(boolean t) |
void |
validate(FacesContext context,
UIComponent component,
Object value) |
public static final String BAD_PARAMETER_SHORT_ID
public static final String BAD_TYPE_SHORT_ID
public static final String BAD_STRING_SHORT_ID
public static final String BAD_PARAMETER_LONG_ID
public static final String BAD_TYPE_LONG_ID
public static final String BAD_STRING_LONG_ID
public static final String OVER_MAX_MESSAGE_ID
public static final String UNDER_MIN_MESSAGE_ID
public static final String MIN_MAX_MESSAGE_ID
public static final String EMPTY_MESSAGE_ID
public static final String NULL_PATTERN_MESSAGE_ID
protected Locale m_clientLocale
protected boolean m_bShowCAFErrorMsg
protected String m_CustomMessage
protected boolean m_bTransient
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
validate
in interface Validator
ValidatorException
public void setRegion(String region)
region
- the local object to use. Null will make the
locale use the session's locale.protected String getRegionAsString()
protected Locale getClientLocale(FacesContext context)
public boolean isStringObj(Object obj)
obj
- public boolean isValue(String sValue)
public void setCustomErrorMsg(String sMsg)
sMsg
- message to display for conversion errors.public String getCustomErrorMsg()
public void setshowCAFErrorMsg(boolean bShow)
bShow
- exception cause if availible.public boolean getshowCAFErrorMsg()
public Object saveState(FacesContext context)
saveState
in interface StateHolder
public void restoreState(FacesContext context, Object state)
restoreState
in interface StateHolder
public boolean isTransient()
isTransient
in interface StateHolder
public void setTransient(boolean t)
setTransient
in interface StateHolder