|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.xsp.complex.ValueBindingObjectImpl com.ibm.xsp.validator.AbstractValidator
public abstract class AbstractValidator
Useful superclass for server-side validators. If client-side validation is also required, subclasses should implement ClientSideValidator.
Field Summary |
---|
Fields inherited from interface javax.faces.validator.Validator |
---|
NOT_IN_RANGE_MESSAGE_ID |
Constructor Summary | |
---|---|
AbstractValidator()
|
Method Summary | |
---|---|
protected void |
addInputInvalidMessage(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
javax.faces.application.FacesMessage.Severity severity,
java.lang.String message)
A utility available to be called in subclasses. |
static java.lang.NullPointerException |
createNullContextOrComponentEx()
Utility method available to validators, to create an exception for when either of first 2 arguments to Validator.validate(FacesContext, UIComponent, Object) is null. |
static javax.faces.validator.ValidatorException |
createValidatorEx(java.lang.String msg)
Util to create a ValidatorException with severity level "error",
and the given message. |
static java.lang.String |
getInvalidRangeMessage(boolean minSet,
java.lang.String minStr,
boolean maxSet,
java.lang.String maxStr)
Util giving an range error message, to use if the user has not configured their own error message. |
java.lang.String |
getMessage()
Returns the validation error message to be displayed to user |
static java.lang.String |
getNotCorrectTypeMessage()
Util error message complaining the value is not of the correct type. |
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
|
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setMessage(java.lang.String message)
Sets the validation error message to be displayed to the user |
Methods inherited from class com.ibm.xsp.complex.ValueBindingObjectImpl |
---|
getComponent, getFacesContext, getValueBinding, isTransient, setComponent, setTransient, setValueBinding |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.faces.validator.Validator |
---|
validate |
Constructor Detail |
---|
public AbstractValidator()
Method Detail |
---|
protected void addInputInvalidMessage(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.application.FacesMessage.Severity severity, java.lang.String message)
FacesMessage
with the given message, and calls
UIInput.setValid(boolean)
false.
context
- component
- severity
- message
- public java.lang.String getMessage()
public void setMessage(java.lang.String message)
public java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class ValueBindingObjectImpl
public void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class ValueBindingObjectImpl
public static java.lang.String getNotCorrectTypeMessage()
public static javax.faces.validator.ValidatorException createValidatorEx(java.lang.String msg)
ValidatorException
with severity level "error",
and the given message.
msg
-
public static java.lang.String getInvalidRangeMessage(boolean minSet, java.lang.String minStr, boolean maxSet, java.lang.String maxStr)
minSet
- minStr
- maxSet
- maxStr
-
public static java.lang.NullPointerException createNullContextOrComponentEx()
Validator.validate(FacesContext, UIComponent, Object)
is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |