T - type of itempublic class SetInput<T> extends ParseAbstractInput<java.lang.String> implements ListInput<java.lang.String,T>
validators| Constructor and Description |
|---|
SetInput() |
SetInput(java.util.Collection<T> items) |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
accept(InputVisitor<R> vis) |
void |
addChoice(java.lang.String tag,
java.lang.String label,
T item)
Add an item to the set.
|
void |
addChoice(java.lang.String label,
T item)
Add an item using the same String value for both
the label and the tab.
|
void |
addChoice(T item)
add an item to the set using default rules for
tags and labels.
|
java.lang.String |
convert(java.lang.Object v)
Perform any supported type conversions to to generate a value of the
target type
|
int |
getCount()
get the number of suggested items.
|
T |
getItem()
get the domain Object associated with the current value
|
T |
getItembyValue(java.lang.String 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 |
getPrettyString(java.lang.String val)
Convert a value into a user friendly string.
|
java.lang.String |
getString(java.lang.String val)
get a String representation of an Object that is compatible with the way
the input is parsed
|
java.lang.String |
getTagByItem(T item)
get an identifying tag string from the domain object
|
java.lang.String |
getTagByValue(java.lang.String 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
|
boolean |
isCaseInsensative() |
boolean |
isValid(T item)
Test if an object of the Item type is one of the possible items.
|
java.lang.String |
makeDefaultTag(T item) |
java.lang.String |
parseValue(java.lang.String v)
Parse a String into the correct type for this input.
|
void |
setCaseInsensative(boolean case_insensative) |
void |
setItem(T item)
Set the value of the input using an item
|
getBoxWidth, getMaxResultLength, getSingle, setBoxWidth, setMaxResultLength, setSinglegetValue, setKey, setValueaddValidator, getKey, getString, removeValidator, validate, validateInnerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddValidator, getKey, getValue, isEmpty, removeValidator, setKey, setValue, validategetString, parsepublic SetInput()
public SetInput(java.util.Collection<T> items)
public void addChoice(java.lang.String label,
T item)
label - String value used as both value and label.item - Item associated with the tagpublic void addChoice(java.lang.String tag,
java.lang.String label,
T item)
tag - key value generated by inputlabel - test presented to the useritem - item associated with key.public void addChoice(T item)
item - public T getItembyValue(java.lang.String value)
ItemInputgetItembyValue in interface ItemInput<java.lang.String,T>value - input Valuepublic java.util.Iterator<T> getItems()
SuggestedItemInputgetItems in interface SuggestedItemInput<java.lang.String,T>public int getCount()
SuggestedItemInputgetCount in interface SuggestedItemInput<java.lang.String,T>public java.lang.String makeDefaultTag(T item)
public java.lang.String getTagByItem(T item)
ListInputgetTagByItem in interface ListInput<java.lang.String,T>public java.lang.String getTagByValue(java.lang.String value)
ListInputgetTagByValue in interface ListInput<java.lang.String,T>public java.lang.String getText(T item)
ListInputpublic T getItem()
ItemInputpublic void setItem(T item)
ItemInputpublic java.lang.String parseValue(java.lang.String v)
throws ParseException
ParseInputInput.getString(Object) method.parseValue in interface ParseInput<java.lang.String>ParseExceptionpublic <R> R accept(InputVisitor<R> vis) throws java.lang.Exception
accept in interface Input<java.lang.String>accept in class ParseAbstractInput<java.lang.String>java.lang.Exceptionpublic boolean isValid(T item)
ListInputpublic boolean isCaseInsensative()
public void setCaseInsensative(boolean case_insensative)
case_insensative - the case_insensative to setpublic java.lang.String getString(java.lang.String val)
BaseInputgetString in interface Input<java.lang.String>getString in class BaseInput<java.lang.String>ParseInputpublic java.lang.String convert(java.lang.Object v)
throws TypeError
Inputpublic java.lang.String getPrettyString(java.lang.String val)
InputgetPrettyString in interface Input<java.lang.String>getPrettyString in class BaseInput<java.lang.String>ListInput