org.jreform.internal
Class AbstractInputCollection
java.lang.Object
org.jreform.internal.AbstractInputCollection
- All Implemented Interfaces:
- HttpServletRequestValidator, InputCollection
- Direct Known Subclasses:
- AbstractForm, GroupImpl
abstract class AbstractInputCollection
- extends Object
- implements InputCollection
- Author:
- armandino (at) gmail.com
Method Summary |
(package private)
|
add(InputControl<T> input)
Adds the specified input to the collection. |
void |
addError(String errorKey)
|
protected void |
additionalValidate()
Perform additional validation of form data where necessary. |
|
checkbox(InputDataType<T> type,
String name,
Criterion<T>... criteria)
|
private
|
create(AbstractInputControl<T> input)
|
|
getCheckbox(String name)
|
Set<String> |
getErrors()
Returns a set of error keys describing validation errors
or an empty set if the object has not been validated or
validation was successful. |
|
getInput(String name)
|
(package private) InputControl<?> |
getInputControl(String name)
|
(package private) Map<String,InputControl<?>> |
getInputs()
|
|
getInputValue(String name)
Returns the value of the specified input. |
|
getMultiCheckbox(String name)
|
|
getMultiInputValue(String name)
Returns the list of values of the specified multi input. |
|
getMultiSelect(String name)
|
|
getRadio(String name)
|
|
getSelect(String name)
|
|
input(InputDataType<T> type,
String name,
Criterion<T>... criteria)
|
boolean |
isValid()
|
|
multiCheckbox(InputDataType<T> type,
String name,
Criterion<T>... criteria)
|
|
multiSelect(InputDataType<T> type,
String name,
Criterion<T>... criteria)
|
|
radio(InputDataType<T> type,
String name,
Criterion<T>... criteria)
|
|
select(InputDataType<T> type,
String name,
Criterion<T>... criteria)
|
(package private) void |
setValid(boolean isValid)
|
String |
toString()
|
inputs
private final Map<String,InputControl<?>> inputs
errors
private final Set<String> errors
isValid
private boolean isValid
AbstractInputCollection
AbstractInputCollection()
add
<T> void add(InputControl<T> input)
- Adds the specified input to the collection.
- Throws:
DuplicateNameException
- if there is an existing input
with the same name in this collection
getInputControl
final InputControl<?> getInputControl(String name)
getErrors
public final Set<String> getErrors()
- Description copied from interface:
HttpServletRequestValidator
- Returns a set of error keys describing validation errors
or an empty set if the object has not been validated or
validation was successful.
- Specified by:
getErrors
in interface HttpServletRequestValidator
addError
public final void addError(String errorKey)
isValid
public final boolean isValid()
getInputs
final Map<String,InputControl<?>> getInputs()
setValid
final void setValid(boolean isValid)
additionalValidate
protected void additionalValidate()
- Perform additional validation of form data where necessary.
getInputValue
public final <T> T getInputValue(String name)
- Returns the value of the specified input.
- Specified by:
getInputValue
in interface InputCollection
- Parameters:
name
- of the input.
getMultiInputValue
public final <T> List<T> getMultiInputValue(String name)
- Returns the list of values of the specified multi input.
- Specified by:
getMultiInputValue
in interface InputCollection
- Parameters:
name
- of the input.
getInput
public final <T> Input<T> getInput(String name)
- Specified by:
getInput
in interface InputCollection
getCheckbox
public final <T> Checkbox<T> getCheckbox(String name)
- Specified by:
getCheckbox
in interface InputCollection
getMultiCheckbox
public final <T> MultiCheckbox<T> getMultiCheckbox(String name)
- Specified by:
getMultiCheckbox
in interface InputCollection
getRadio
public final <T> Radio<T> getRadio(String name)
- Specified by:
getRadio
in interface InputCollection
getSelect
public final <T> Select<T> getSelect(String name)
- Specified by:
getSelect
in interface InputCollection
getMultiSelect
public final <T> MultiSelect<T> getMultiSelect(String name)
- Specified by:
getMultiSelect
in interface InputCollection
input
public final <T> InputControlModifier<T> input(InputDataType<T> type,
String name,
Criterion<T>... criteria)
- Specified by:
input
in interface InputCollection
checkbox
public final <T> InputControlModifier<T> checkbox(InputDataType<T> type,
String name,
Criterion<T>... criteria)
- Specified by:
checkbox
in interface InputCollection
multiCheckbox
public final <T> InputControlModifier<T> multiCheckbox(InputDataType<T> type,
String name,
Criterion<T>... criteria)
- Specified by:
multiCheckbox
in interface InputCollection
radio
public final <T> InputControlModifier<T> radio(InputDataType<T> type,
String name,
Criterion<T>... criteria)
- Specified by:
radio
in interface InputCollection
select
public final <T> InputControlModifier<T> select(InputDataType<T> type,
String name,
Criterion<T>... criteria)
- Specified by:
select
in interface InputCollection
multiSelect
public final <T> InputControlModifier<T> multiSelect(InputDataType<T> type,
String name,
Criterion<T>... criteria)
- Specified by:
multiSelect
in interface InputCollection
create
private <T> InputControlModifier<T> create(AbstractInputControl<T> input)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2007-2008
jReform