public final class DataTypeUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
count |
static java.util.ResourceBundle |
resourceBundle |
Constructor and Description |
---|
DataTypeUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
convert(java.lang.Object source,
java.lang.Class toTypeClass)
convert a object to given class
Classes supported:
Integer.class
BigDecimal.class
Boolean.class
Time.class
Date.class
Double.class
String.class
Blob.class
|
static java.lang.Object |
convert(java.lang.Object source,
int toType)
convert an object to given type
Types supported:
DataType.INTEGER_TYPE
DataType.DECIMAL_TYPE
DataType.BOOLEAN_TYPE
DataType.DATE_TYPE
DataType.DOUBLE_TYPE
DataType.STRING_TYPE
DataType.BLOB_TYPE
DataType.SQL_DATE_TYPE
DataType.SQL_TIME_TYPE
|
static int |
toApiDataType(java.lang.Class clazz)
Converts a Java class to its corresponding data type constant
defined in DataType
|
static int |
toApiDataType(int odaDataTypeCode)
Converts an ODA data type code to its
corresponding Data Engine API data type constant
defined in DataType.
|
static java.lang.Object |
toAutoValue(java.lang.Object evaValue)
Convert object to a suitable type from its value
Object -> Integer -> Double -> BigDecimal -> Date -> String
|
static java.math.BigDecimal |
toBigDecimal(java.lang.Object source)
Boolean -> BigDecimal
true -> 1
others -> 0
Date -> BigDecimal
Date.getTime();
String -> BigDecimal
new BigDecimal(String);
|
static java.sql.Blob |
toBlob(java.lang.Object source)
Converting Blob to/from other types is not currently supported
|
static java.lang.Boolean |
toBoolean(java.lang.Object source)
Number -> Boolean
0 -> false
others -> true
String -> Boolean
"true" -> true (ignore case)
"false" -> false (ignore case)
other string will throw an exception
Date -> Boolean
throw exception
|
static byte[] |
toBytes(java.lang.Object source) |
static java.util.Date |
toDate(java.lang.Object source)
Number -> Date
new Date((long)Number)
String -> Date
toDate(String)
|
static java.util.Date |
toDate(java.lang.String source,
java.util.Locale locale)
A temp solution to the adoption of ICU4J to BIRT.
|
static java.util.Date |
toDate(java.lang.String source,
TimeZone timeZone)
Convert a string to a Date instance according to the TimeZone value
|
static java.util.Date |
toDate(java.lang.String source,
ULocale locale)
convert String with the specified locale to java.util.Date
|
static java.util.Date |
toDate(java.lang.String source,
ULocale locale,
TimeZone timeZone) |
static java.util.Date |
toDateWithCheck(java.lang.String source,
java.util.Locale locale)
A temp solution to the adoption of ICU4J in BIRT.
|
static java.util.Date |
toDateWithCheck(java.lang.String source,
ULocale locale)
Convert string to date with check.
|
static java.lang.Double |
toDouble(java.lang.Object source)
Boolean -> Double
true -> 1
others -> 0
Date -> Double
Date.getTime();
String -> Double
Double.valueOf(String);
|
static java.lang.Double |
toDouble(java.lang.Object source,
java.util.Locale locale) |
static java.lang.Double |
toDouble(java.lang.Object source,
ULocale locale) |
static java.lang.Integer |
toInteger(java.lang.Object source)
Boolean -> Integer
true -> 1
others -> 0
Date -> Integer
Date.getTime();
String -> Integer
Integer.valueOf();
|
static java.lang.Integer |
toIntegerValue(java.lang.Object evaValue)
convert object to Integer.
|
static java.lang.String |
toLocaleNeutralString(java.lang.Object source)
Convert an object to an locale neutral String value.
|
static int |
toOdaDataType(java.lang.Class odiTypeClass)
Converts an ODI type class to its corresponding
ODA data type code.
|
static java.lang.Class |
toOdiTypeClass(int odaDataTypeCode)
Converts an ODA data type code to the Java class
of its corresponding Data Engine ODI data type.
|
static java.sql.Date |
toSqlDate(java.lang.Object source)
Date -> Time
String -> Time
|
static java.sql.Time |
toSqlTime(java.lang.Object source)
Date -> Time
String -> Time
|
static java.lang.String |
toString(java.lang.Object source)
Number -> String
Number.toString()
Boolean -> String
Boolean.toString()
Date -> String
toString(Date)
|
static java.lang.String |
toString(java.lang.Object source,
java.util.Locale locale)
A temp solution to the adoption of ICU4J.
|
static java.lang.String |
toString(java.lang.Object source,
ULocale locale)
Number -> String
Number.toString()
Boolean -> String
Boolean.toString()
Date -> String
toString(Date,locale)
|
static java.sql.Timestamp |
toTimestamp(java.lang.Object source) |
public static java.util.ResourceBundle resourceBundle
public static long count
public static java.lang.Object convert(java.lang.Object source, int toType) throws BirtException
source
- toType
- BirtException
public static java.lang.Object convert(java.lang.Object source, java.lang.Class toTypeClass) throws BirtException
source
- toTypeClass
- BirtException
public static java.lang.Integer toInteger(java.lang.Object source) throws BirtException
source
- BirtException
public static java.math.BigDecimal toBigDecimal(java.lang.Object source) throws BirtException
source
- BirtException
public static java.lang.Boolean toBoolean(java.lang.Object source) throws BirtException
source
- BirtException
public static java.util.Date toDate(java.lang.Object source) throws BirtException
source
- BirtException
public static java.sql.Timestamp toTimestamp(java.lang.Object source) throws BirtException
source
- BirtException
public static java.sql.Time toSqlTime(java.lang.Object source) throws BirtException
source
- BirtException
public static java.sql.Date toSqlDate(java.lang.Object source) throws BirtException
source
- BirtException
public static java.util.Date toDate(java.lang.String source, java.util.Locale locale) throws BirtException
source
- the String to be convertlocate
- the locate of the stringBirtException
public static java.util.Date toDate(java.lang.String source, ULocale locale) throws BirtException
source
- the String to be convertlocate
- the locate of the stringBirtException
public static java.util.Date toDate(java.lang.String source, ULocale locale, TimeZone timeZone) throws BirtException
source
- locale
- timeZone
- BirtException
public static java.util.Date toDate(java.lang.String source, TimeZone timeZone) throws BirtException
source
- timeZone
- BirtException
public static java.util.Date toDateWithCheck(java.lang.String source, java.util.Locale locale) throws BirtException
source
- locale
- BirtException
public static java.util.Date toDateWithCheck(java.lang.String source, ULocale locale) throws BirtException
source
- locale
- BirtException
public static java.lang.Double toDouble(java.lang.Object source, java.util.Locale locale) throws CoreException
CoreException
public static java.lang.Double toDouble(java.lang.Object source, ULocale locale) throws CoreException
CoreException
public static java.lang.Double toDouble(java.lang.Object source) throws BirtException
source
- BirtException
public static java.lang.String toString(java.lang.Object source) throws BirtException
source
- BirtException
public static java.lang.String toString(java.lang.Object source, java.util.Locale locale) throws BirtException
source
- BirtException
public static java.lang.String toLocaleNeutralString(java.lang.Object source) throws BirtException
source
- BirtException
public static java.lang.String toString(java.lang.Object source, ULocale locale) throws BirtException
source
- BirtException
public static java.sql.Blob toBlob(java.lang.Object source) throws BirtException
source
- BirtException
public static byte[] toBytes(java.lang.Object source) throws BirtException
source
- BirtException
public static int toApiDataType(java.lang.Class clazz)
public static int toApiDataType(int odaDataTypeCode) throws BirtException
odaDataTypeCode
- an ODA data type codeBirtException
- if the specified ODA data type code
is not a supported typepublic static java.lang.Object toAutoValue(java.lang.Object evaValue)
public static java.lang.Integer toIntegerValue(java.lang.Object evaValue)
public static java.lang.Class toOdiTypeClass(int odaDataTypeCode) throws BirtException
odaDataTypeCode
- an ODA data type codeBirtException
- if the specified ODA data type is not a supported typepublic static int toOdaDataType(java.lang.Class odiTypeClass)
odiTypeClass
- a type class used by the Data Engine ODI componentCopyright © 2014 OpenText Corp. All rights reserved.