V - public abstract class BaseInput<V> extends java.lang.Object implements Input<V>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<FieldValidator<V>> |
validators |
| Constructor and Description |
|---|
BaseInput() |
| Modifier and Type | Method and Description |
|---|---|
void |
addValidator(FieldValidator<V> val)
Add a
FieldValidator to this input |
V |
convert(java.lang.Object v)
Perform any supported type conversions to to generate a value of the
target type
|
java.lang.String |
getKey()
get the unique key for this selector
|
java.lang.String |
getPrettyString(V val)
Convert a value into a user friendly string.
|
java.lang.String |
getString()
get a String representation of the value in a form that is compatible
with the way the input is parsed.
|
java.lang.String |
getString(V val)
get a String representation of an Object that is compatible with the way
the input is parsed
|
void |
removeValidator(FieldValidator<V> val)
Remove a
FieldValidator from this input |
void |
setKey(java.lang.String key)
Set the key used by this Selector
|
void |
validate()
Check the validity of the current state of the Object.
|
protected void |
validateInner()
Extension point to add validation to sub-class specific inner-state
|
protected java.util.Set<FieldValidator<V>> validators
public final void addValidator(FieldValidator<V> val)
InputFieldValidator to this inputaddValidator in interface Input<V>public final void removeValidator(FieldValidator<V> val)
InputFieldValidator from this inputremoveValidator in interface Input<V>public final java.lang.String getKey()
Inputpublic void setKey(java.lang.String key)
Inputpublic V convert(java.lang.Object v) throws TypeError
Inputpublic final java.lang.String getString()
public java.lang.String getString(V val)
getString in interface Input<V>val - ParseInputpublic java.lang.String getPrettyString(V val)
InputgetPrettyString in interface Input<V>ListInputpublic final void validate()
throws FieldException
Inputvalidate in interface Input<V>FieldExceptionprotected void validateInner()
throws FieldException
FieldException