|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectru.sstu.web.jsf.JsfValidator<T>
T - type of input valuepublic class JsfValidator<T>
JsfValidator class is most common JSF validator.
| Constructor Summary | |
|---|---|
JsfValidator(javax.faces.context.FacesContext context,
javax.faces.component.UIInput input,
T value)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsfValidator(javax.faces.context.FacesContext context,
javax.faces.component.UIInput input,
T value)
context - contextinput - inputvalue - value| Method Detail |
|---|
public boolean checkEquals(T object,
String resourceId)
object - required valueresourceId - message id
true if check is successful
public boolean checkEquals(T object,
String resourceId,
Object... parameters)
object - required valueresourceId - message idparameters - message parameters
true if check is successful
public boolean checkExists(Object object,
Object dbObject,
String resourceId)
object - changed objectdbObject - existing objectresourceId - message id
true if check is successful
public boolean checkExists(Object object,
Object dbObject,
String resourceId,
Object... parameters)
object - changed objectdbObject - existing objectresourceId - message idparameters - message parameters
true if check is successfulpublic void sendError(String resourceId)
resourceId - message resource id
public 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||