TypesHelper Class
DEPRECATED Use com.bea.p13n.expression.Expression
and subclasses instead.
- public class TypesHelper
extends Object
A helper with constants for the various types and operators for
configurable entity properties.
In general, there are 6 types of properties for configurable entities,
represented by constants on this class. Each of those types corresponds to
a Java object type as follows:
Constant Name | Constant Value | Class |
BOOLEAN | 0 | java.lang.Boolean |
INTEGER | 1 | java.lang.Long |
FLOAT | 2 | java.lang.Double |
TEXT | 3 | java.lang.String |
DATETIME | 4 | java.sql.Timestamp |
USER_DEFINED | 5 |
java.lang.Object |
Additionally, a property can also be multi-valued, in which case the value
will be a java.util.Collection
of objects of the property's
type (e.g. java.lang.String's).
This class provides utility methods to get string representations of the
type names, to determine a type from a java.sql.Type, and to get the list
of comparision operators for a certain type.
Related Topics
ExpressionHelper
-
Hierarchy
-
Object
TypesHelper
public static final String |
-
AND
- The "and" (
&& ) logical operator.
|
public static final int |
-
BOOLEAN
- The constant for a boolean type (0).
|
public static final String |
-
CONTAINS
- The contains ("
contains ") comparator constant.
|
public static final String |
-
CONTAINS_ALL
- The contains all ("
containsall ") comparator constant.
|
public static final int |
-
DATETIME
- The constant for a datetime type (4).
|
public static final String |
-
EQUALS
- The equals (
== ) comparator constant.
|
public static final int |
-
FLOAT
- The constant for the floating-point numeric type (2).
|
public static final String |
-
GREATER_THAN
- The greater than (
> ) comparator constant.
|
public static final String |
-
GREATER_THAN_EQUALS
- The greater than or equals (
>= ) comparator constant.
|
public static final int |
-
INTEGER
- The constant for a numeric type (1).
|
public static final String |
-
LESS_THAN
- The less than (
< ) comparator constant.
|
public static final String |
-
LESS_THAN_EQUALS
- The less than or equals (
<= ) comparator constant.
|
public static final String |
-
LIKE
- The wildcard pattern ("
like ") comparator constant.
|
public static final String |
-
LIKE_IGNORECASE
- The wildcard pattern ("
likeignorecase ") comparator constant.
|
public static final int |
-
MULTI_VALUED
- The constant for a multivalued type (6).
|
public static final String |
-
NOT_EQUALS
- The not equals (
!
|
public static final String |
-
OR
- The "or" (
|| ) logical operator.
|
public static final int |
-
TEXT
- The constant for a text type (3).
|
public static final int |
-
USER_DEFINED
- The constant for a user defined type (5).
|
public static int |
-
fromSQLType (int sqlType)
- Convert a java.sql.Types constant into one of ours.
|
public static List |
-
getComparators (int type)
- Get the list of comparators for a given attribute type.
|
public static String |
-
getDisplayName (String comparator)
- Get the display name for the given comparator.
|
public static String |
-
getTypeName (int type)
- Get the descriptive type name from the type.
|
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AND
public static final String
AND
- The "and" (
&&
) logical operator.
BOOLEAN
public static final int BOOLEAN
- The constant for a boolean type (0).
CONTAINS
public static final String
CONTAINS
- The contains ("
contains
") comparator constant.
CONTAINS_ALL
public static final String
CONTAINS_ALL
- The contains all ("
containsall
") comparator constant.
DATETIME
public static final int DATETIME
- The constant for a datetime type (4).
EQUALS
public static final String
EQUALS
- The equals (
==
) comparator constant.
FLOAT
public static final int FLOAT
- The constant for the floating-point numeric type (2).
GREATER_THAN
public static final String
GREATER_THAN
- The greater than (
>
) comparator constant.
GREATER_THAN_EQUALS
public static final String
GREATER_THAN_EQUALS
- The greater than or equals (
>=
) comparator constant.
INTEGER
public static final int INTEGER
- The constant for a numeric type (1).
LESS_THAN
public static final String
LESS_THAN
- The less than (
<
) comparator constant.
LESS_THAN_EQUALS
public static final String
LESS_THAN_EQUALS
- The less than or equals (
<=
) comparator constant.
LIKE
public static final String
LIKE
- The wildcard pattern ("
like
") comparator constant.
LIKE_IGNORECASE
public static final String
LIKE_IGNORECASE
- The wildcard pattern ("
likeignorecase
") comparator constant.
MULTI_VALUED
public static final int MULTI_VALUED
- The constant for a multivalued type (6).
NOT_EQUALS
public static final String
NOT_EQUALS
- The not equals (
!=
) comparator constant.
OR
public static final String
OR
- The "or" (
||
) logical operator.
TEXT
public static final int TEXT
- The constant for a text type (3).
USER_DEFINED
public static final int USER_DEFINED
- The constant for a user defined type (5).
TypesHelper
public TypesHelper()
fromSQLType(int) Method
public static int fromSQLType(int sqlType)
Convert a java.sql.Types constant into one of ours.
Parameters
-
sqlType
- value from java.sql.Types.
Returns
- the corresponding attribute type (BOOLEAN, NUMERIC, TEXT,
DATETIME, MULTI_VALUED, or USER_DEFINED).
getComparators(int) Method
public static List
getComparators(int type)
Get the list of comparators for a given attribute type.
Returns
- an unmodifiable List of comparators represented by the
constants in this class.
getDisplayName(String) Method
public static String
getDisplayName(String
comparator)
Get the display name for the given comparator.
getTypeName(int) Method
public static String
getTypeName(int type)
Get the descriptive type name from the type.
Parameters
-
type
- the type (BOOLEAN, NUMERIC, TEXT, DATETIME, MULTI_VALUED,
USER_DEFINED).
Returns
- the type name as a String.