|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flexive.shared.value.mapper.InputMapper<BaseType,MappedType>
BaseType - the source value to be mapped (must extend FxValue).MappedType - the target type of the mapping (must extend FxValue).public abstract class InputMapper<BaseType extends FxValue,MappedType extends FxValue>
InputMapper introduces another level of abstraction for the FxValue input components.
When rendering the input component, encode(FxValue) is
called and may wrap the given value in another object. For example, an ordinal
FxLargeNumber like the ACL ID may be mapped
to a FxSelectOne value for input rendering.
When decoding the value submitted from the input form, decode(com.flexive.shared.value.FxValue)
is called with an instance of the mapped type. In the example given above,
the decode method would store the element ID of the
FxSelectOne value in a
FxLargeNumber instance.
Use getInstance(FxProperty) to retrieve a new InputMapper for the given
structure property, which for example allows to select ACLs with a select list
instead of a numeric input field.
You may also implement your own input mapper and supply it to the FxValueInput component or attach it to a search query node.
| Constructor Summary | |
|---|---|
InputMapper()
|
|
| Method Summary | |
|---|---|
protected void |
buildAutocompleteHandler(java.lang.String jsonRpcQuery,
java.lang.String... args)
Build an autocomplete handler for the given JSON/RPC query call. |
BaseType |
decode(MappedType value)
Decode the mapped type. |
protected abstract BaseType |
doDecode(MappedType value)
Decode the mapped type. |
protected abstract MappedType |
doEncode(BaseType value)
Map the given value to the destination FxValue type. |
MappedType |
encode(BaseType value)
Map the given value to the destination FxValue type. |
java.lang.String |
getAutocompleteHandler()
Return an (optional) autocomplete handler for the input component, for example: new flexive.yui.AutoCompleteHandler(). |
java.util.List<? extends ValueComparator> |
getAvailableValueComparators()
Returns all available value comparators available in search queries. |
static InputMapper |
getInstance(FxProperty property)
Return a new input mapper instance for the given structure property. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InputMapper()
| Method Detail |
|---|
public final MappedType encode(BaseType value)
value - the value to be mapped
public final BaseType decode(MappedType value)
value - the mapped value type, possibly modified by the user
protected abstract MappedType doEncode(BaseType value)
value - the value to be mapped
protected abstract BaseType doDecode(MappedType value)
value - the mapped value type, possibly modified by the user
public java.lang.String getAutocompleteHandler()
new flexive.yui.AutoCompleteHandler().
public java.util.List<? extends ValueComparator> getAvailableValueComparators()
public static InputMapper getInstance(FxProperty property)
property - the property for which values will be mapped
protected final void buildAutocompleteHandler(java.lang.String jsonRpcQuery,
java.lang.String... args)
jsonRpcQuery - the query method, for example:AutoCompleteProvider.userQueryargs - additional parameters for the javascript function. The first parameter is always
the query string.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||