|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.plasma.sdo.helper.DataConverter
public class DataConverter
| Field Summary | |
|---|---|
static String |
FORMAT_PATTERN_DATE
|
static String |
FORMAT_PATTERN_DATETIME
|
static String |
FORMAT_PATTERN_DAY
|
static String |
FORMAT_PATTERN_MONTH
|
static String |
FORMAT_PATTERN_MONTHDAY
|
static String |
FORMAT_PATTERN_TIME
|
static String |
FORMAT_PATTERN_YEAR
|
static String |
FORMAT_PATTERN_YEARMONTH
|
static String |
FORMAT_PATTERN_YEARMONTHDAY
|
static DataConverter |
INSTANCE
|
| Method Summary | |
|---|---|
Object |
convert(Type targetType,
Object value)
|
Object |
convert(Type targetType,
Type sourceType,
Object value)
|
Object |
fromBoolean(Type targetType,
boolean value)
|
Object |
fromByte(Type targetType,
byte value)
|
Object |
fromBytes(Type targetType,
byte[] value)
|
Object |
fromCharacter(Type targetType,
char value)
|
Object |
fromDate(Type targetType,
Date value)
|
Object |
fromDecimal(Type targetType,
BigDecimal value)
|
Object |
fromDouble(Type targetType,
double value)
|
Object |
fromFloat(Type targetType,
float value)
|
Object |
fromInt(Type targetType,
int value)
|
Object |
fromInteger(Type targetType,
BigInteger value)
|
Object |
fromLong(Type targetType,
long value)
|
Object |
fromShort(Type targetType,
short value)
|
Object |
fromString(Type targetType,
String value)
Converts the given string value to an object appropriate for the target type. |
Object |
fromStrings(Type targetType,
List<String> value)
|
Object |
fromTemporalDataType(Type targetType,
Type sourceType,
String value)
|
List<DataType> |
getAllowableTargetTypes(DataType dataType)
|
DateFormat |
getDateFormat()
|
DateFormat |
getDateTimeFormat()
|
DateFormat |
getDayFormat()
|
org.joda.time.format.PeriodFormatter |
getDurationFormat()
|
DateFormat |
getMonthDayFormat()
|
DateFormat |
getMonthFormat()
|
DateFormat |
getTimeFormat()
|
DateFormat |
getYearFormat()
|
DateFormat |
getYearMonthDayFormat()
|
DateFormat |
getYearMonthFormat()
|
boolean |
toBoolean(Type sourceType,
Object value)
|
byte |
toByte(Type sourceType,
Object value)
|
byte[] |
toBytes(Type sourceType,
Object value)
|
char |
toCharacter(Type sourceType,
Object value)
|
Date |
toDate(Type sourceType,
Object value)
|
BigDecimal |
toDecimal(Type sourceType,
Object value)
|
double |
toDouble(Type sourceType,
Object value)
|
float |
toFloat(Type sourceType,
Object value)
|
int |
toInt(Type sourceType,
Object value)
|
BigInteger |
toInteger(Type sourceType,
Object value)
|
long |
toLong(Type sourceType,
Object value)
|
Class<?> |
toPrimitiveJavaClass(DataType dataType)
Returns a primitive Java class, wherever possible, for the given SDO data-type (as per the SDO Specification 2.10 Section 8.1), and where no primitive exists for the give SDO datatype, the appropriate class is returned. |
short |
toShort(Type sourceType,
Object value)
|
String |
toString(Type sourceType,
Object value)
Converts the given value to a string. |
List<String> |
toStrings(Type sourceType,
Object value)
|
String |
toTemporalDataType(Type targetType,
Type sourceType,
Object value)
|
Class<?> |
toWrapperJavaClass(DataType dataType)
Returns a primitive wrapper Java class, wherever possible, for the given SDO data-type (as per the SDO Specification 2.10 Section 8.1), and where no primitive exists for the give SDO datatype, the appropriate class is returned. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static DataConverter INSTANCE
public static final String FORMAT_PATTERN_TIME
public static final String FORMAT_PATTERN_DATE
public static final String FORMAT_PATTERN_DATETIME
public static final String FORMAT_PATTERN_DAY
public static final String FORMAT_PATTERN_MONTH
public static final String FORMAT_PATTERN_MONTHDAY
public static final String FORMAT_PATTERN_YEAR
public static final String FORMAT_PATTERN_YEARMONTH
public static final String FORMAT_PATTERN_YEARMONTHDAY
| Method Detail |
|---|
public DateFormat getDateTimeFormat()
public DateFormat getTimeFormat()
public DateFormat getDateFormat()
public org.joda.time.format.PeriodFormatter getDurationFormat()
public DateFormat getDayFormat()
public DateFormat getMonthFormat()
public DateFormat getMonthDayFormat()
public DateFormat getYearFormat()
public DateFormat getYearMonthFormat()
public DateFormat getYearMonthDayFormat()
public Object convert(Type targetType,
Object value)
public Object convert(Type targetType,
Type sourceType,
Object value)
public boolean toBoolean(Type sourceType,
Object value)
public Object fromBoolean(Type targetType,
boolean value)
public byte toByte(Type sourceType,
Object value)
public Object fromByte(Type targetType,
byte value)
public byte[] toBytes(Type sourceType,
Object value)
public Object fromBytes(Type targetType,
byte[] value)
public char toCharacter(Type sourceType,
Object value)
public Object fromCharacter(Type targetType,
char value)
public BigDecimal toDecimal(Type sourceType,
Object value)
public Object fromDecimal(Type targetType,
BigDecimal value)
public double toDouble(Type sourceType,
Object value)
public Object fromDouble(Type targetType,
double value)
public float toFloat(Type sourceType,
Object value)
public Object fromFloat(Type targetType,
float value)
public int toInt(Type sourceType,
Object value)
public Object fromInt(Type targetType,
int value)
public BigInteger toInteger(Type sourceType,
Object value)
public Object fromInteger(Type targetType,
BigInteger value)
public long toLong(Type sourceType,
Object value)
public Object fromLong(Type targetType,
long value)
public short toShort(Type sourceType,
Object value)
public Object fromShort(Type targetType,
short value)
public String toString(Type sourceType,
Object value)
sourceType - the property type for the given propertyvalue - the value to convert
InvalidDataConversionException - if the given source
type cannot be converted to string as per the SDO 2.1
datatype conversion table.
IllegalArgumentException - if the given value is not
the expected Java type as per the SDO 2.1 specification
public Object fromString(Type targetType,
String value)
targetType - the target data typevalue - the value
public List<String> toStrings(Type sourceType,
Object value)
public Object fromStrings(Type targetType,
List<String> value)
public Date toDate(Type sourceType,
Object value)
public Object fromDate(Type targetType,
Date value)
public String toTemporalDataType(Type targetType,
Type sourceType,
Object value)
public Object fromTemporalDataType(Type targetType,
Type sourceType,
String value)
public Class<?> toPrimitiveJavaClass(DataType dataType)
dataType - the SDO datatype
public Class<?> toWrapperJavaClass(DataType dataType)
dataType - the SDO datatype
public List<DataType> getAllowableTargetTypes(DataType dataType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||