com.flexive.shared.value
Class FxBinary

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

public class FxBinary
extends FxValue<BinaryDescriptor,FxBinary>
implements java.io.Serializable

A multilingual Binary

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

Field Summary
static BinaryDescriptor EMPTY
           
 
Fields inherited from class com.flexive.shared.value.FxValue
DEFAULT_MULTILANGUAGE, defaultLanguage, emptyTranslations, multiLanguage, singleValue, translations
 
Constructor Summary
FxBinary(BinaryDescriptor value)
          Constructor
FxBinary(boolean multiLanguage, BinaryDescriptor value)
          Constructor
FxBinary(boolean multiLanguage, long defaultLanguage, BinaryDescriptor value)
          Constructor
FxBinary(boolean multiLanguage, long defaultLanguage, java.util.Map<java.lang.Long,BinaryDescriptor> translations)
          Constructor
FxBinary(boolean multiLanguage, java.util.Map<java.lang.Long,BinaryDescriptor> translations)
          Constructor
FxBinary(FxValue<BinaryDescriptor,FxBinary> clone)
          Constructor
FxBinary(long defaultLanguage, BinaryDescriptor value)
          Constructor
FxBinary(long defaultLanguage, boolean multiLanguage)
          Constructor
FxBinary(long defaultLanguage, java.util.Map<java.lang.Long,BinaryDescriptor> translations)
          Constructor
FxBinary(java.util.Map<java.lang.Long,BinaryDescriptor[]> translations, int pos)
          Constructor - create value from an array of translations
FxBinary(java.util.Map<java.lang.Long,BinaryDescriptor> translations)
          Constructor
 
Method Summary
 void _replaceHandle(java.lang.String handle, BinaryDescriptor replacement)
          Replace all occurances of handle with the replacement BinaryDescriptor
 FxBinary copy()
          Creates a copy of the given object (useful if the actual type is unknown).
 BinaryDescriptor fromString(java.lang.String value)
          Evaluates the given string value to an object of type T.
 BinaryDescriptor getEmptyValue()
          Returns an empty value object for this FxValue type.
 java.lang.String getStringValue(BinaryDescriptor value)
          Converts the given instance of T to a string that can be parsed again by FxValue.fromString(String).
 java.lang.Class<BinaryDescriptor> 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, 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 BinaryDescriptor EMPTY
Constructor Detail

FxBinary

public FxBinary(long defaultLanguage,
                boolean multiLanguage)
Constructor

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

FxBinary

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

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

FxBinary

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

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

FxBinary

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

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

FxBinary

public FxBinary(java.util.Map<java.lang.Long,BinaryDescriptor> translations)
Constructor

Parameters:
translations - HashMap containing language->translation mapping

FxBinary

public FxBinary(java.util.Map<java.lang.Long,BinaryDescriptor[]> 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

FxBinary

public FxBinary(boolean multiLanguage,
                long defaultLanguage,
                BinaryDescriptor value)
Constructor

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

FxBinary

public FxBinary(long defaultLanguage,
                BinaryDescriptor value)
Constructor

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

FxBinary

public FxBinary(boolean multiLanguage,
                BinaryDescriptor value)
Constructor

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

FxBinary

public FxBinary(BinaryDescriptor value)
Constructor

Parameters:
value - single initializing value

FxBinary

public FxBinary(FxValue<BinaryDescriptor,FxBinary> clone)
Constructor

Parameters:
clone - original FxValue to be cloned
Method Detail

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<BinaryDescriptor,FxBinary>
Returns:
true if T is immutable (e.g. java.lang.String)

fromString

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

Specified by:
fromString in class FxValue<BinaryDescriptor,FxBinary>
Parameters:
value - string value to be evaluated
Returns:
the value interpreted as T

getStringValue

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

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

copy

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

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

_replaceHandle

public void _replaceHandle(java.lang.String handle,
                           BinaryDescriptor replacement)
Replace all occurances of handle with the replacement BinaryDescriptor

Parameters:
handle - the handle to replace
replacement - the replacement

getValueClass

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

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

getEmptyValue

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

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