T - type of input valuepublic class JsfValidator<T> extends Object
JsfValidator class is most common JSF validator.| Constructor and Description |
|---|
JsfValidator(javax.faces.context.FacesContext context,
javax.faces.component.UIInput input,
T value) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkEquals(T object,
String resourceId)
Checks if field value equals to required value.
|
boolean |
checkEquals(T object,
String resourceId,
Object... parameters)
Checks if field value equals to required value.
|
boolean |
checkExists(Object object,
Object dbObject,
String resourceId)
Checks if object with given name is already exists.
|
boolean |
checkExists(Object object,
Object dbObject,
String resourceId,
Object... parameters)
Checks if object with given name is already exists.
|
protected javax.faces.context.FacesContext |
getContext() |
protected javax.faces.component.UIInput |
getInput() |
protected JsfMessages |
getMessages() |
protected T |
getValue() |
void |
sendError(String resourceId)
Sets validation error.
|
void |
sendError(String resourceId,
Object... parameters)
Sets validation error.
|
public JsfValidator(javax.faces.context.FacesContext context,
javax.faces.component.UIInput input,
T value)
context - contextinput - inputvalue - valuepublic boolean checkEquals(T object, String resourceId)
object - required valueresourceId - message idtrue if check is successfulpublic boolean checkEquals(T object, String resourceId, Object... parameters)
object - required valueresourceId - message idparameters - message parameterstrue if check is successfulpublic boolean checkExists(Object object, Object dbObject, String resourceId)
object - changed objectdbObject - existing objectresourceId - message idtrue if check is successfulpublic boolean checkExists(Object object, Object dbObject, String resourceId, Object... parameters)
object - changed objectdbObject - existing objectresourceId - message idparameters - message parameterstrue if check is successfulpublic void sendError(String resourceId)
resourceId - message resource idpublic void sendError(String resourceId, Object... parameters)
resourceId - message resource idparameters - message parametersprotected JsfMessages getMessages()
protected javax.faces.context.FacesContext getContext()
protected javax.faces.component.UIInput getInput()
protected T getValue()
Copyright © 2013 TFI branch of Engels Instutute of Technology. All Rights Reserved.