com.flexive.shared.search.query
Enum PropertyValueComparator

java.lang.Object
  extended by java.lang.Enum<PropertyValueComparator>
      extended by com.flexive.shared.search.query.PropertyValueComparator
All Implemented Interfaces:
ObjectWithLabel, ValueComparator, java.io.Serializable, java.lang.Comparable<PropertyValueComparator>

public enum PropertyValueComparator
extends java.lang.Enum<PropertyValueComparator>
implements ValueComparator

Supported value comparators for FxValues.

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

Enum Constant Summary
EMPTY
           
EQ
           
GE
           
GT
           
LE
           
LIKE
           
LT
           
NE
           
NOT_EMPTY
           
 
Method Summary
static java.util.List<PropertyValueComparator> getAvailable(FxDataType dataType)
          Returns a list of value comparators applicable to the given data type.
 FxString getLabel()
          Return the label to be displayed to the user.
 java.lang.String getSql(FxAssignment assignment, FxValue value)
           
 java.lang.String getSql(FxProperty property, FxValue value)
           
 java.lang.String getSql(java.lang.String columnName, FxValue value)
           
 java.lang.String getSql(java.lang.String columnName, java.lang.Object value)
           
protected  java.lang.String getSql(java.lang.String leftHandSide, java.lang.String rightHandSide)
          Returns the SQL expression generated by combining both parameters with this comparator.
 boolean isNeedsInput()
          Returns true if the comparator needs a value ("right-hand-side").
static PropertyValueComparator valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static PropertyValueComparator[] 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

EQ

public static final PropertyValueComparator EQ

NE

public static final PropertyValueComparator NE

LT

public static final PropertyValueComparator LT

LE

public static final PropertyValueComparator LE

GT

public static final PropertyValueComparator GT

GE

public static final PropertyValueComparator GE

EMPTY

public static final PropertyValueComparator EMPTY

NOT_EMPTY

public static final PropertyValueComparator NOT_EMPTY

LIKE

public static final PropertyValueComparator LIKE
Method Detail

values

public static PropertyValueComparator[] 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 (PropertyValueComparator c : PropertyValueComparator.values())
    System.out.println(c);

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

valueOf

public static PropertyValueComparator 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

getSql

public final java.lang.String getSql(FxAssignment assignment,
                                     FxValue value)

getSql

public final java.lang.String getSql(FxProperty property,
                                     FxValue value)

getSql

public final java.lang.String getSql(java.lang.String columnName,
                                     FxValue value)

getSql

public final java.lang.String getSql(java.lang.String columnName,
                                     java.lang.Object value)

getSql

protected java.lang.String getSql(java.lang.String leftHandSide,
                                  java.lang.String rightHandSide)
Returns the SQL expression generated by combining both parameters with this comparator.

Parameters:
leftHandSide - the left-hand-side of the comparison
rightHandSide - the right-hand-side of the comparison
Returns:
the SQL query

isNeedsInput

public boolean isNeedsInput()
Returns true if the comparator needs a value ("right-hand-side"). For example, equality needs a value to compare to, while "is null" does not.

Specified by:
isNeedsInput in interface ValueComparator
Returns:
true if the comparator needs a value ("right-hand-side").

getLabel

public FxString getLabel()
Return the label to be displayed to the user.

Specified by:
getLabel in interface ObjectWithLabel
Specified by:
getLabel in interface ValueComparator
Returns:
the label to be displayed to the user.

getAvailable

public static java.util.List<PropertyValueComparator> getAvailable(FxDataType dataType)
Returns a list of value comparators applicable to the given data type.

Parameters:
dataType - the data type
Returns:
a list of value comparators applicable to the given data type.