|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jreform.internal.AbstractInputControl<T>
abstract class AbstractInputControl<T>
Base class for single- and multi-value input controls. Validation rules are implemented by subclasses.
Field Summary | |
---|---|
private Criterion<T>[] |
criteria
|
private boolean |
isGroupInput
|
private boolean |
isRequired
|
private boolean |
isValid
|
private String |
messageOnError
|
private String |
name
|
private InputDataType<T> |
type
|
Constructor Summary | |
---|---|
AbstractInputControl(InputDataType<T> type,
String name,
Criterion<T>... criteria)
Constructor. |
Method Summary | |
---|---|
protected Criterion<T>[] |
getCriteria()
|
String |
getInputName()
Returns this input's name attribute. |
String |
getOnError()
Returns a message describing an error or an empty string if there was no error. |
InputDataType<T> |
getType()
Returns this input's data type. |
(package private) boolean |
isGroupInput()
Returns true if this input belongs to a group. |
boolean |
isRequired()
Returns true if this input must have a value. |
boolean |
isValid()
Returns true if this input's data is valid. |
(package private) void |
setGroupInput(boolean isGroupInput)
|
void |
setOnError(String message)
Sets a message to be displayed on error. |
(package private) void |
setRequired(boolean isRequired)
|
(package private) void |
setValid(boolean isValid)
|
(package private) abstract boolean |
validate(javax.servlet.http.HttpServletRequest req)
Validates this input's value attribute(s). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jreform.InputControl |
---|
getStringValue |
Field Detail |
---|
private InputDataType<T> type
private String name
private String messageOnError
private boolean isRequired
private boolean isValid
private boolean isGroupInput
private Criterion<T>[] criteria
Constructor Detail |
---|
AbstractInputControl(InputDataType<T> type, String name, Criterion<T>... criteria)
type
- of this input's data.name
- of this input.isRequired
- is this a required or optional input field.criteria
- this input's data must satisfy.Method Detail |
---|
abstract boolean validate(javax.servlet.http.HttpServletRequest req)
public final InputDataType<T> getType()
InputControl
getType
in interface InputControl<T>
public final String getInputName()
InputControl
getInputName
in interface InputControl<T>
public final String getOnError()
MessageOnError
getOnError
in interface MessageOnError
public final void setOnError(String message)
MessageOnError
setOnError
in interface MessageOnError
public final boolean isRequired()
InputControl
true
if this input must have a value.
isRequired
in interface InputControl<T>
final void setRequired(boolean isRequired)
public final boolean isValid()
InputControl
true
if this input's data is valid.
isValid
in interface InputControl<T>
final void setValid(boolean isValid)
final boolean isGroupInput()
true
if this input belongs to a group.
final void setGroupInput(boolean isGroupInput)
protected final Criterion<T>[] getCriteria()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |