V
- type of valueT
- type of itempublic class RadioButtonInput<V,T> extends java.lang.Object implements ListInput<V,T>, ParseInput<V>
ParseInput
. If the nested input does not
also implement this interface then the convert(Object)
method needs to
be able to convert the String representation of the value.Constructor and Description |
---|
RadioButtonInput(ListInput<V,T> in)
Construct a RadioButtonInput defaulting to the first selectable item
unless there is already one set in the
ListInput |
RadioButtonInput(ListInput<V,T> in,
T default_sel)
Construct a RadioButtonInput with a specified default (can be null).
|
Modifier and Type | Method and Description |
---|---|
<R> R |
accept(InputVisitor<R> vis) |
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
|
boolean |
equals(java.lang.Object obj) |
int |
getCount()
get the number of suggested items.
|
T |
getItem()
get the domain Object associated with the current value
|
T |
getItembyValue(V value)
get the domain object from the Input value if defined
|
java.util.Iterator<T> |
getItems()
get a list of domain objects that are being selected
|
java.lang.String |
getKey()
get the unique key for this selector
|
java.lang.String |
getPrettyString(V value)
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 value)
convert a value of the correct type for this input into a String.
|
java.lang.String |
getTagByItem(T item)
get an identifying tag string from the domain object
|
java.lang.String |
getTagByValue(V value)
get the tag string from the actual value of the input
|
java.lang.String |
getText(T item)
get the user presented text from the domain object
may return null if not selected
|
V |
getValue()
get the current value of the Object created by this selector.
|
int |
hashCode() |
boolean |
isValid(T item)
Test if an object of the Item type is one of the possible items.
|
V |
parseValue(java.lang.String v)
Parse a String into the correct type for this input.
|
void |
removeValidator(FieldValidator<V> val)
Remove a
FieldValidator from this input |
void |
setItem(T item)
Set the value of the input using an item
|
void |
setKey(java.lang.String key)
Set the key used by this Selector
|
V |
setValue(V v)
set the value of this selector.
|
java.lang.String |
toString() |
void |
validate()
Check the validity of the current state of the Object.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
parse
public RadioButtonInput(ListInput<V,T> in)
ListInput
in
- public java.lang.String getKey()
Input
public V getValue()
Input
public void setKey(java.lang.String key)
Input
public V setValue(V v) throws TypeError
Input
public V convert(java.lang.Object v) throws TypeError
Input
public java.lang.String getString(V value)
Input
getString
in interface Input<V>
ParseInput
public java.lang.String getPrettyString(V value)
Input
getPrettyString
in interface Input<V>
ListInput
public void validate() throws FieldException
Input
validate
in interface Input<V>
FieldException
public <R> R accept(InputVisitor<R> vis) throws java.lang.Exception
public T getItem()
ItemInput
public void setItem(T item)
ItemInput
public T getItembyValue(V value)
ItemInput
getItembyValue
in interface ItemInput<V,T>
value
- input Valuepublic java.util.Iterator<T> getItems()
SuggestedItemInput
getItems
in interface SuggestedItemInput<V,T>
public int getCount()
SuggestedItemInput
getCount
in interface SuggestedItemInput<V,T>
public java.lang.String getTagByItem(T item)
ListInput
getTagByItem
in interface ListInput<V,T>
public java.lang.String getTagByValue(V value)
ListInput
getTagByValue
in interface ListInput<V,T>
public java.lang.String getText(T item)
ListInput
public java.lang.String getString()
ParseInput
getString
in interface ParseInput<V>
public V parseValue(java.lang.String v) throws ParseException
ParseInput
Input.getString(Object)
method.parseValue
in interface ParseInput<V>
ParseException
public boolean isValid(T item)
ListInput
public void addValidator(FieldValidator<V> val)
Input
FieldValidator
to this inputaddValidator
in interface Input<V>
public void removeValidator(FieldValidator<V> val)
Input
FieldValidator
from this inputremoveValidator
in interface Input<V>
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object