com.flexive.shared.structure
Enum FxDataType

java.lang.Object
  extended by java.lang.Enum<FxDataType>
      extended by com.flexive.shared.structure.FxDataType
All Implemented Interfaces:
SelectableObject, SelectableObjectWithName, java.io.Serializable, java.lang.Comparable<FxDataType>

public enum FxDataType
extends java.lang.Enum<FxDataType>
implements java.io.Serializable, SelectableObjectWithName

[fleXive] data types

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

Enum Constant Summary
Binary
           
Boolean
           
Date
           
DateRange
           
DateTime
           
DateTimeRange
           
Double
           
Float
           
HTML
           
InlineReference
           
LargeNumber
           
Number
           
Reference
           
SelectMany
           
SelectOne
           
String1024
           
Text
           
 
Method Summary
 long getId()
          Get the internal id
 FxString getLabel()
          Get the localized label of this data type
 java.lang.String getName()
          Get the name of this data type
 FxValue getRandomValue(java.util.Random rnd, boolean multilang)
          Get an random FxValue instance for the data type
 FxValue getRandomValue(java.util.Random rnd, FxPropertyAssignment assignment)
          Get an random FxValue instance for the assignments multilanguage and selectlist, etc.
 java.lang.Class<? extends FxValue> getValueClass()
          Returns the concrete FxValue implementation class for values of this datatype.
 void initialize(java.lang.String name, FxString label)
          Initialized this data type by assigning the name and label as stored in the database
 boolean isInitialized()
          Is this data type initialized yet (name and label known)?
 boolean isSingleRowStorage()
           
 boolean isValid(java.lang.Object value)
          Low-level validation of values.
static FxDataType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FxDataType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

HTML

public static final FxDataType HTML

String1024

public static final FxDataType String1024

Text

public static final FxDataType Text

Number

public static final FxDataType Number

LargeNumber

public static final FxDataType LargeNumber

Float

public static final FxDataType Float

Double

public static final FxDataType Double

Date

public static final FxDataType Date

DateTime

public static final FxDataType DateTime

DateRange

public static final FxDataType DateRange

DateTimeRange

public static final FxDataType DateTimeRange

Boolean

public static final FxDataType Boolean

Binary

public static final FxDataType Binary

Reference

public static final FxDataType Reference

InlineReference

public static final FxDataType InlineReference

SelectOne

public static final FxDataType SelectOne

SelectMany

public static final FxDataType SelectMany
Method Detail

values

public static FxDataType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FxDataType c : FxDataType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FxDataType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getId

public long getId()
Get the internal id

Specified by:
getId in interface SelectableObject
Returns:
internal id

getName

public java.lang.String getName()
Get the name of this data type

Specified by:
getName in interface SelectableObjectWithName
Returns:
name of this data type

getLabel

public FxString getLabel()
Get the localized label of this data type

Returns:
localized label of this data type

isInitialized

public boolean isInitialized()
Is this data type initialized yet (name and label known)?

Returns:
data type initialized yet (name and label known)?

initialize

public void initialize(java.lang.String name,
                       FxString label)
Initialized this data type by assigning the name and label as stored in the database

Parameters:
name - name
label - label

isValid

public boolean isValid(java.lang.Object value)
Low-level validation of values. Checks if the passed value may be stored in the database, but does not check other requirements which may be imposed through the property definition.

Parameters:
value - the value to be validated
Returns:
true if the given value is a valid representation for the datatype, false otherwise

isSingleRowStorage

public boolean isSingleRowStorage()

getRandomValue

public FxValue getRandomValue(java.util.Random rnd,
                              FxPropertyAssignment assignment)
Get an random FxValue instance for the assignments multilanguage and selectlist, etc. settings

Parameters:
rnd - random
assignment - assignment
Returns:
random FxValue instance for the data type

getRandomValue

public FxValue getRandomValue(java.util.Random rnd,
                              boolean multilang)
Get an random FxValue instance for the data type

Parameters:
rnd - random
multilang - multilanguage?
Returns:
random FxValue instance for the data type

getValueClass

public java.lang.Class<? extends FxValue> getValueClass()
Returns the concrete FxValue implementation class for values of this datatype.

Returns:
the concrete FxValue implementation class for values of this datatype.