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, setValue
addValidator, getKey, getPrettyString, getString, getString, removeValidator, validate, validateInner
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addValidator, getKey, getPrettyString, getString, getValue, isEmpty, removeValidator, setKey, setValue, validate
public 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)
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 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 java.lang.String convert(java.lang.Object v) throws TypeError
Input
public T getItem()
ItemInput
public void setItem(T item)
ItemInput
public <R> R accept(InputVisitor<R> vis) throws java.lang.Exception