Class BaseValidator
java.lang.Object
com.webmethods.caf.faces.validator.BaseValidator
- All Implemented Interfaces:
EventListener
,StateHolder
,Validator
- Direct Known Subclasses:
BaseFormattedNumberValidator
,CreditCardValidator
,EmailValidator
,EqualValidator
,ExactRegExp
,FileValidator
,FormattedDateRange
,MwsUrlValidator
,OneOfValidator
,RegExpValidator
Created by IntelliJ IDEA.
Date: Jan 3, 2006
Time: 6:01:33 PM
To change this template use File | Settings | File Templates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
protected boolean
protected boolean
protected Locale
protected String
static final String
static final String
static final String
static final String
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Locale
getClientLocale
(FacesContext context) getRegion Set the locale for the validated to use.getCustomMsg get the user defined message for a convervion failure.protected String
getRegion Set the locale for the validated to use.boolean
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
boolean
void
restoreState
(FacesContext context, Object state) saveState
(FacesContext context) void
setCustomErrorMsg
(String sMsg) setCustomMsg Set a localized massage used if the convervion fails.void
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)
-
Field Details
-
BAD_PARAMETER_SHORT_ID
- See Also:
-
BAD_TYPE_SHORT_ID
- See Also:
-
BAD_STRING_SHORT_ID
- See Also:
-
BAD_PARAMETER_LONG_ID
- See Also:
-
BAD_TYPE_LONG_ID
- See Also:
-
BAD_STRING_LONG_ID
- See Also:
-
OVER_MAX_MESSAGE_ID
- See Also:
-
UNDER_MIN_MESSAGE_ID
- See Also:
-
MIN_MAX_MESSAGE_ID
- See Also:
-
EMPTY_MESSAGE_ID
- See Also:
-
NULL_PATTERN_MESSAGE_ID
- See Also:
-
m_clientLocale
-
m_bShowCAFErrorMsg
protected boolean m_bShowCAFErrorMsg -
m_CustomMessage
-
m_bTransient
protected boolean m_bTransient
-
-
Constructor Details
-
BaseValidator
public BaseValidator()
-
-
Method Details
-
validate
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException - Specified by:
validate
in interfaceValidator
- Throws:
ValidatorException
-
setRegion
setRegion Set the locale for the validated to use.- Parameters:
region
- the local object to use. Null will make the locale use the session's locale.
-
getRegionAsString
getRegion Set the locale for the validated to use. returns the Locale.toString(). the Construct a locale from a language code. Null or spaces will make the locale use the session's locale. also see java.util.Locale -
getClientLocale
getRegion Set the locale for the validated to use. returns the Locale.toString(). the Construct a locale from a language code. Null or spaces will make the locale use the session's locale. also see java.util.Locale -
isStringObj
isStringObj will check the class and see if the string is not just full of spaces.- Parameters:
obj
-- Returns:
- true if the object is a non-empty string, false otherwise
-
isValue
-
setCustomErrorMsg
setCustomMsg Set a localized massage used if the convervion fails.- Parameters:
sMsg
- message to display for conversion errors.
-
getCustomErrorMsg
getCustomMsg get the user defined message for a convervion failure.- Returns:
- String user defined error message.
-
setshowCAFErrorMsg
public void setshowCAFErrorMsg(boolean bShow) Show the exception cause if availible.- Parameters:
bShow
- exception cause if availible.
-
getshowCAFErrorMsg
public boolean getshowCAFErrorMsg()Show the exception cause if availible.- Returns:
- boolean show exception if availible.
-
saveState
- Specified by:
saveState
in interfaceStateHolder
-
restoreState
- Specified by:
restoreState
in interfaceStateHolder
-
isTransient
public boolean isTransient()- Specified by:
isTransient
in interfaceStateHolder
-
setTransient
public void setTransient(boolean t) - Specified by:
setTransient
in interfaceStateHolder
-