com.flexive.shared.value
Class FxString

java.lang.Object
  extended by com.flexive.shared.value.FxValue<java.lang.String,FxString>
      extended by com.flexive.shared.value.FxString
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FxValue>
Direct Known Subclasses:
FxHTML

public class FxString
extends FxValue<java.lang.String,FxString>
implements java.io.Serializable

A multilingual String

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

Field Summary
static java.lang.String EMPTY
           
 
Fields inherited from class com.flexive.shared.value.FxValue
DEFAULT_MULTILANGUAGE, defaultLanguage, emptyTranslations, multiLanguage, singleValue, translations
 
Constructor Summary
FxString(boolean multiLanguage, long defaultLanguage, java.util.Map<java.lang.Long,java.lang.String> translations)
           
FxString(boolean multiLanguage, long defaultLanguage, java.lang.String value)
           
FxString(boolean multiLanguage, java.util.Map<java.lang.Long,java.lang.String> translations)
           
FxString(boolean multiLanguage, java.lang.String value)
           
FxString(FxString clone)
           
FxString(long defaultLanguage, boolean multiLanguage)
          Constructor
FxString(long defaultLanguage, java.util.Map<java.lang.Long,java.lang.String> translations)
           
FxString(long defaultLanguage, java.lang.String value)
           
FxString(java.util.Map<java.lang.Long,java.lang.String[]> translations, int pos)
           
FxString(java.util.Map<java.lang.Long,java.lang.String> translations)
           
FxString(java.lang.String value)
           
 
Method Summary
 FxString copy()
          Creates a copy of the given object (useful if the actual type is unknown).
 java.lang.String fromString(java.lang.String value)
          Evaluates the given string value to an object of type T.
 java.lang.String getEmptyValue()
          Returns an empty value object for this FxValue type.
 java.lang.Class<java.lang.String> getValueClass()
          Return the class instance of the value type.
 boolean isImmutableValueType()
          Return true if T is immutable (e.g.
 
Methods inherited from class com.flexive.shared.value.FxValue
clearDefaultLanguage, compareTo, equals, getBestTranslation, getBestTranslation, getBestTranslation, getBestTranslation, getDefaultLanguage, getDefaultTranslation, getErrorValue, getIsEmpty, getMaxInputLength, getSelectedLanguage, getSqlValue, getStringValue, getTranslatedLanguages, getTranslation, getTranslation, getXPath, getXPathName, hasDefaultLanguage, hashCode, isAcceptsEmptyDefaultTranslations, isDefaultLanguage, isEmpty, isMultiLanguage, isReadOnly, isTranslationEmpty, isTranslationEmpty, isValid, removeLanguage, setDefaultLanguage, setDefaultLanguage, setDefaultTranslation, setEmpty, setEmpty, setMaxInputLength, setReadOnly, setSelectedLanguage, setTranslation, setTranslation, setValue, setXPath, toString, translationExists
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final java.lang.String EMPTY
See Also:
Constant Field Values
Constructor Detail

FxString

public FxString(long defaultLanguage,
                boolean multiLanguage)
Constructor

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

FxString

public FxString(boolean multiLanguage,
                java.util.Map<java.lang.Long,java.lang.String> translations)

FxString

public FxString(boolean multiLanguage,
                long defaultLanguage,
                java.util.Map<java.lang.Long,java.lang.String> translations)

FxString

public FxString(boolean multiLanguage,
                long defaultLanguage,
                java.lang.String value)

FxString

public FxString(boolean multiLanguage,
                java.lang.String value)

FxString

public FxString(java.util.Map<java.lang.Long,java.lang.String[]> translations,
                int pos)

FxString

public FxString(FxString clone)

FxString

public FxString(java.util.Map<java.lang.Long,java.lang.String> translations)

FxString

public FxString(long defaultLanguage,
                java.util.Map<java.lang.Long,java.lang.String> translations)

FxString

public FxString(long defaultLanguage,
                java.lang.String value)

FxString

public FxString(java.lang.String value)
Method Detail

copy

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

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

fromString

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

Specified by:
fromString in class FxValue<java.lang.String,FxString>
Parameters:
value - string value to be evaluated
Returns:
the value interpreted as T

isImmutableValueType

public boolean isImmutableValueType()
Return true if T is immutable (e.g. java.lang.String). This prevents cloning of the translations in copy constructors.

Overrides:
isImmutableValueType in class FxValue<java.lang.String,FxString>
Returns:
true if T is immutable (e.g. java.lang.String)

getValueClass

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

Specified by:
getValueClass in class FxValue<java.lang.String,FxString>
Returns:
the class instance of the value type.

getEmptyValue

public java.lang.String getEmptyValue()
Returns an empty value object for this FxValue type.

Specified by:
getEmptyValue in class FxValue<java.lang.String,FxString>
Returns:
an empty value object for this FxValue type.