com.flexive.shared.value.mapper
Class SelectOneInputMapper

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

public class SelectOneInputMapper
extends InputMapper<FxLargeNumber,FxSelectOne>

Maps the given ordinal input type to a select list. The select list must contain at least one element.

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

Constructor Summary
SelectOneInputMapper(FxSelectList selectList)
          Create a new select-one input mapper.
 
Method Summary
protected  FxLargeNumber doDecode(FxSelectOne value)
          Decode the mapped type.
protected  FxSelectOne doEncode(FxLargeNumber 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

SelectOneInputMapper

public SelectOneInputMapper(FxSelectList selectList)
Create a new select-one input mapper. The input mapper will select a select item of the given list based on the ordinal value of the value passed to doEncode(com.flexive.shared.value.FxLargeNumber FxLargeNumber) 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(FxLargeNumber 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<FxLargeNumber,FxSelectOne>
Parameters:
value - the value to be mapped
Returns:
the mapped type

doDecode

protected FxLargeNumber 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<FxLargeNumber,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<FxLargeNumber,FxSelectOne>
Returns:
all available value comparators available in search queries