T - public class ConstructedObjectInput<T> extends AbstractInput<java.lang.String> implements ListInput<java.lang.String,T>
AppContext.makeObject(Class, String)
The target object is further constrained to be assignable to a specific type.
For security reasons its important that this class cannot be forced to generate a class other than
than those specified.validators| Constructor and Description |
|---|
ConstructedObjectInput(AppContext c,
java.lang.Class<T> target)
Construct input for all dynamically created types assignable to target
|
ConstructedObjectInput(AppContext c,
java.lang.Class<T> target,
java.util.Map<java.lang.String,java.lang.Class> map)
Constructor for filtered values.
|
| Modifier and Type | Method and Description |
|---|---|
<R> R |
accept(InputVisitor<R> vis) |
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 |
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 |
isValid(T item)
Test if an object of the Item type is one of the possible items.
|
void |
setItem(T item)
Set the value of the input using an item
|
getValue, setKey, setValueaddValidator, getKey, getPrettyString, getString, getString, removeValidator, validate, validateInnerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddValidator, getKey, getPrettyString, getString, getValue, isEmpty, removeValidator, setKey, setValue, validatepublic ConstructedObjectInput(AppContext c, java.lang.Class<T> target)
c - target - public ConstructedObjectInput(AppContext c, java.lang.Class<T> target, java.util.Map<java.lang.String,java.lang.Class> map)
AppContext.getClassMap(Class)c - target - map - 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 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 java.lang.String convert(java.lang.Object v)
throws TypeError
Inputpublic T getItem()
ItemInputpublic void setItem(T item)
ItemInputpublic <R> R accept(InputVisitor<R> vis) throws java.lang.Exception