com.flexive.shared.value.mapper
Class FxPkSelectOneInputMapper

java.lang.Object
  extended by com.flexive.shared.value.mapper.InputMapper<FxReference,FxSelectOne>
      extended by com.flexive.shared.value.mapper.FxPkSelectOneInputMapper

public class FxPkSelectOneInputMapper
extends InputMapper<FxReference,FxSelectOne>

Input mapper for mapping a FxReference property to a select list. The select list item IDs must match the FxPK id values of the select list.

Version:
$Rev: 623 $
Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Constructor Summary
FxPkSelectOneInputMapper(FxSelectList selectList)
          Create a new select-one input mapper.
 
Method Summary
protected  FxReference doDecode(FxSelectOne value)
          Decode the mapped type.
protected  FxSelectOne doEncode(FxReference value)
          Map the given value to the destination FxValue type.
 java.util.List<? extends ValueComparator> getAvailableValueComparators()
          Returns all available value comparators available in search queries.
 
Methods inherited from class com.flexive.shared.value.mapper.InputMapper
buildAutocompleteHandler, decode, encode, getAutocompleteHandler, getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxPkSelectOneInputMapper

public FxPkSelectOneInputMapper(FxSelectList selectList)
Create a new select-one input mapper. The input mapper will select a select item of the given list based on the PK value of the value passed to doEncode(com.flexive.shared.value.FxReference FxReference) and return the appropriate FxSelectOne object. If no valid value is selected, the first select list value will be used.

Parameters:
selectList - the select list. If null or empty, a RuntimeException will be trhown.
Method Detail

doEncode

protected FxSelectOne doEncode(FxReference value)
Map the given value to the destination FxValue type. The resulting object will be used for rendering the input element for the given value.

Specified by:
doEncode in class InputMapper<FxReference,FxSelectOne>
Parameters:
value - the value to be mapped
Returns:
the mapped type

doDecode

protected FxReference doDecode(FxSelectOne value)
Decode the mapped type. Called after the mapped type has been updated in the user form.

Specified by:
doDecode in class InputMapper<FxReference,FxSelectOne>
Parameters:
value - the mapped value type, possibly modified by the user
Returns:
the corresponding base type

getAvailableValueComparators

public java.util.List<? extends ValueComparator> getAvailableValueComparators()
Returns all available value comparators available in search queries. If the returned list is empty, it is ignored.

Overrides:
getAvailableValueComparators in class InputMapper<FxReference,FxSelectOne>
Returns:
all available value comparators available in search queries