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)
Input
FieldValidator
to this inputaddValidator
in interface Input<V>
public final void removeValidator(FieldValidator<V> val)
Input
FieldValidator
from this inputremoveValidator
in interface Input<V>
public final java.lang.String getKey()
Input
public void setKey(java.lang.String key)
Input
public V convert(java.lang.Object v) throws TypeError
Input
public final java.lang.String getString()
public java.lang.String getString(V val)
getString
in interface Input<V>
val
- ParseInput
public java.lang.String getPrettyString(V val)
Input
getPrettyString
in interface Input<V>
ListInput
public final void validate() throws FieldException
Input
validate
in interface Input<V>
FieldException
protected void validateInner() throws FieldException
FieldException