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, setSingle
getValue, setKey, setValue
addValidator, getKey, getString, removeValidator, validate, validateInner
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addValidator, getKey, getValue, isEmpty, removeValidator, setKey, setValue, validate
getString, parse
public 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)
ItemInput
getItembyValue
in interface ItemInput<java.lang.String,T>
value
- input Valuepublic java.util.Iterator<T> getItems()
SuggestedItemInput
getItems
in interface SuggestedItemInput<java.lang.String,T>
public int getCount()
SuggestedItemInput
getCount
in interface SuggestedItemInput<java.lang.String,T>
public java.lang.String makeDefaultTag(T item)
public java.lang.String getTagByItem(T item)
ListInput
getTagByItem
in interface ListInput<java.lang.String,T>
public java.lang.String getTagByValue(java.lang.String value)
ListInput
getTagByValue
in interface ListInput<java.lang.String,T>
public java.lang.String getText(T item)
ListInput
public T getItem()
ItemInput
public void setItem(T item)
ItemInput
public java.lang.String parseValue(java.lang.String v) throws ParseException
ParseInput
Input.getString(Object)
method.parseValue
in interface ParseInput<java.lang.String>
ParseException
public <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.Exception
public boolean isValid(T item)
ListInput
public boolean isCaseInsensative()
public void setCaseInsensative(boolean case_insensative)
case_insensative
- the case_insensative to setpublic java.lang.String getString(java.lang.String val)
BaseInput
getString
in interface Input<java.lang.String>
getString
in class BaseInput<java.lang.String>
ParseInput
public java.lang.String convert(java.lang.Object v) throws TypeError
Input
public java.lang.String getPrettyString(java.lang.String val)
Input
getPrettyString
in interface Input<java.lang.String>
getPrettyString
in class BaseInput<java.lang.String>
ListInput