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, waitparsepublic RadioButtonInput(ListInput<V,T> in)
ListInputin - public java.lang.String getKey()
Inputpublic V getValue()
Inputpublic void setKey(java.lang.String key)
Inputpublic V setValue(V v) throws TypeError
Inputpublic V convert(java.lang.Object v) throws TypeError
Inputpublic java.lang.String getString(V value)
InputgetString in interface Input<V>ParseInputpublic java.lang.String getPrettyString(V value)
InputgetPrettyString in interface Input<V>ListInputpublic void validate()
throws FieldException
Inputvalidate in interface Input<V>FieldExceptionpublic <R> R accept(InputVisitor<R> vis) throws java.lang.Exception
public T getItem()
ItemInputpublic void setItem(T item)
ItemInputpublic T getItembyValue(V value)
ItemInputgetItembyValue in interface ItemInput<V,T>value - input Valuepublic java.util.Iterator<T> getItems()
SuggestedItemInputgetItems in interface SuggestedItemInput<V,T>public int getCount()
SuggestedItemInputgetCount in interface SuggestedItemInput<V,T>public java.lang.String getTagByItem(T item)
ListInputgetTagByItem in interface ListInput<V,T>public java.lang.String getTagByValue(V value)
ListInputgetTagByValue in interface ListInput<V,T>public java.lang.String getText(T item)
ListInputpublic java.lang.String getString()
ParseInputgetString in interface ParseInput<V>public V parseValue(java.lang.String v) throws ParseException
ParseInputInput.getString(Object) method.parseValue in interface ParseInput<V>ParseExceptionpublic boolean isValid(T item)
ListInputpublic void addValidator(FieldValidator<V> val)
InputFieldValidator to this inputaddValidator in interface Input<V>public void removeValidator(FieldValidator<V> val)
InputFieldValidator from this inputremoveValidator in interface Input<V>public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object