com.flexive.shared.value
Class FxSelectMany

java.lang.Object
  extended by com.flexive.shared.value.FxValue<SelectMany,FxSelectMany>
      extended by com.flexive.shared.value.FxSelectMany
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FxValue>

public class FxSelectMany
extends FxValue<SelectMany,FxSelectMany>
implements java.io.Serializable

FxValue implementation for FxSelectList items with many selectable items

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.flexive.shared.value.FxValue
DEFAULT_MULTILANGUAGE, defaultLanguage, emptyTranslations, multiLanguage, singleValue, translations, VALUE_NODATA
 
Constructor Summary
FxSelectMany(boolean multiLanguage, long defaultLanguage, java.util.Map<java.lang.Long,SelectMany> translations)
          Constructor
FxSelectMany(boolean multiLanguage, long defaultLanguage, SelectMany value)
          Constructor
FxSelectMany(boolean multiLanguage, java.util.Map<java.lang.Long,SelectMany> translations)
          Constructor
FxSelectMany(boolean multiLanguage, SelectMany value)
          Constructor
FxSelectMany(FxValue<SelectMany,FxSelectMany> clone)
          Constructor
FxSelectMany(long defaultLanguage, boolean multiLanguage)
          Constructor
FxSelectMany(long defaultLanguage, java.util.Map<java.lang.Long,SelectMany> translations)
          Constructor
FxSelectMany(long defaultLanguage, SelectMany value)
          Constructor
FxSelectMany(java.util.Map<java.lang.Long,SelectMany[]> translations, int pos)
          Constructor - create value from an array of translations
FxSelectMany(java.util.Map<java.lang.Long,SelectMany> translations)
          Constructor
FxSelectMany(SelectMany value)
          Constructor
 
Method Summary
 FxSelectMany copy()
          Creates a copy of the given object (useful if the actual type is unknown).
protected  SelectMany copyValue(SelectMany value)
          Implement this method for data types that return false from FxValue.isImmutableValueType().
 SelectMany fromString(java.lang.String value)
          Evaluates the given string value to an object of type SelectMany.
 SelectMany getEmptyValue()
          Returns an empty value object for this FxValue type.
 FxSelectList getSelectList()
          Get the SelectList for this SelectMany
 java.lang.String getStringValue(SelectMany value)
          Converts the given instance of T to a string that can be parsed again by FxValue.fromString(String).
 java.lang.Class<SelectMany> getValueClass()
          Return the class instance of the value type.
protected  boolean isAcceptsEmptyDefaultTranslations()
          
 void setSelectList(FxSelectList list)
          Updates the select list.
 
Methods inherited from class com.flexive.shared.value.FxValue
clearDefaultLanguage, clearValueData, compareTo, equals, fromPortableString, getBestTranslation, getBestTranslation, getBestTranslation, getBestTranslation, getDefaultLanguage, getDefaultTranslation, getErrorValue, getIsEmpty, getMaxInputLength, getPortableStringValue, getSelectedLanguage, getSqlValue, getTranslatedLanguages, getTranslation, getTranslation, getValueData, getValueDataRaw, getXPath, getXPathName, hasDefaultLanguage, hashCode, hasValueData, isDefaultLanguage, isEmpty, isImmutableValueType, isMultiLanguage, isReadOnly, isTranslationEmpty, isTranslationEmpty, isValid, isValid, isValid, removeLanguage, setChangeListener, setDefaultLanguage, setDefaultLanguage, setDefaultTranslation, setEmpty, setEmpty, setMaxInputLength, setReadOnly, setSelectedLanguage, setTranslation, setTranslation, setValue, setValueData, setXPath, setXPath, toString, translationExists
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FxSelectMany

public FxSelectMany(long defaultLanguage,
                    boolean multiLanguage)
Constructor

Parameters:
multiLanguage - multilanguage value?
defaultLanguage - the default language

FxSelectMany

public FxSelectMany(boolean multiLanguage,
                    long defaultLanguage,
                    java.util.Map<java.lang.Long,SelectMany> translations)
Constructor

Parameters:
multiLanguage - multilanguage value?
defaultLanguage - the default language
translations - HashMap containing language->translation mapping

FxSelectMany

public FxSelectMany(long defaultLanguage,
                    java.util.Map<java.lang.Long,SelectMany> translations)
Constructor

Parameters:
defaultLanguage - the default language
translations - HashMap containing language->translation mapping

FxSelectMany

public FxSelectMany(boolean multiLanguage,
                    java.util.Map<java.lang.Long,SelectMany> translations)
Constructor

Parameters:
multiLanguage - multilanguage value?
translations - HashMap containing language->translation mapping

FxSelectMany

public FxSelectMany(java.util.Map<java.lang.Long,SelectMany> translations)
Constructor

Parameters:
translations - HashMap containing language->translation mapping

FxSelectMany

public FxSelectMany(java.util.Map<java.lang.Long,SelectMany[]> translations,
                    int pos)
Constructor - create value from an array of translations

Parameters:
translations - HashMap containing language->translation mapping
pos - position (index) in the array to use

FxSelectMany

public FxSelectMany(boolean multiLanguage,
                    long defaultLanguage,
                    SelectMany value)
Constructor

Parameters:
multiLanguage - multilanguage value?
defaultLanguage - the default language
value - single initializing value

FxSelectMany

public FxSelectMany(long defaultLanguage,
                    SelectMany value)
Constructor

Parameters:
defaultLanguage - the default language
value - single initializing value

FxSelectMany

public FxSelectMany(boolean multiLanguage,
                    SelectMany value)
Constructor

Parameters:
multiLanguage - multilanguage value?
value - single initializing value

FxSelectMany

public FxSelectMany(SelectMany value)
Constructor

Parameters:
value - single initializing value

FxSelectMany

public FxSelectMany(FxValue<SelectMany,FxSelectMany> clone)
Constructor

Parameters:
clone - original FxValue to be cloned
Method Detail

getValueClass

public java.lang.Class<SelectMany> getValueClass()
Return the class instance of the value type.

Specified by:
getValueClass in class FxValue<SelectMany,FxSelectMany>
Returns:
the class instance of the value type.

getStringValue

public java.lang.String getStringValue(SelectMany value)
Converts the given instance of T to a string that can be parsed again by FxValue.fromString(String).

Overrides:
getStringValue in class FxValue<SelectMany,FxSelectMany>
Parameters:
value - the value to be converted
Returns:
a string representation of the given value that can be parsed again using FxValue.fromString(String).

fromString

public SelectMany fromString(java.lang.String value)
Evaluates the given string value to an object of type SelectMany.

Specified by:
fromString in class FxValue<SelectMany,FxSelectMany>
Parameters:
value - comma seperated list of selected entries
Returns:
the value interpreted as SelectMany

copy

public FxSelectMany copy()
Creates a copy of the given object (useful if the actual type is unknown).

Specified by:
copy in class FxValue<SelectMany,FxSelectMany>
Returns:
a copy of the given object (useful if the actual type is unknown).

copyValue

protected SelectMany copyValue(SelectMany value)
Description copied from class: FxValue
Implement this method for data types that return false from FxValue.isImmutableValueType().

The default implementation returns the argument as-is and throws an IllegalArgumentException when the container class has mutable value types.

Overrides:
copyValue in class FxValue<SelectMany,FxSelectMany>
Parameters:
value - the value to be copied (not null)
Returns:
an independent copy of value

getSelectList

public FxSelectList getSelectList()
Get the SelectList for this SelectMany

Returns:
SelectList

setSelectList

public void setSelectList(FxSelectList list)
Updates the select list.

Parameters:
list - the new select list instance

isAcceptsEmptyDefaultTranslations

protected boolean isAcceptsEmptyDefaultTranslations()

Overrides:
isAcceptsEmptyDefaultTranslations in class FxValue<SelectMany,FxSelectMany>

getEmptyValue

public SelectMany getEmptyValue()
Returns an empty value object for this FxValue type.

Specified by:
getEmptyValue in class FxValue<SelectMany,FxSelectMany>
Returns:
an empty value object for this FxValue type.