public class DataConverter extends Object
| Modifier and Type | Field and Description |
|---|---|
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 |
| Modifier and Type | Method and Description |
|---|---|
Object |
convert(org.plasma.sdo.DataType targetDataType,
commonj.sdo.Type sourceType,
Object value) |
Object |
convert(commonj.sdo.Type targetType,
Object value) |
Object |
convert(commonj.sdo.Type targetType,
commonj.sdo.Type sourceType,
Object value) |
Object |
fromBoolean(commonj.sdo.Type targetType,
boolean value) |
Object |
fromByte(commonj.sdo.Type targetType,
byte value) |
Object |
fromBytes(org.plasma.sdo.DataType targetDataType,
byte[] value) |
Object |
fromBytes(commonj.sdo.Type targetType,
byte[] value) |
Object |
fromCharacter(commonj.sdo.Type targetType,
char value) |
Object |
fromDate(commonj.sdo.Type targetType,
Date value) |
Object |
fromDecimal(commonj.sdo.Type targetType,
BigDecimal value) |
Object |
fromDouble(commonj.sdo.Type targetType,
double value) |
Object |
fromFloat(commonj.sdo.Type targetType,
float value) |
Object |
fromInt(commonj.sdo.Type targetType,
int value) |
Object |
fromInteger(commonj.sdo.Type targetType,
BigInteger value) |
Object |
fromLong(commonj.sdo.Type targetType,
long value) |
Object |
fromShort(commonj.sdo.Type targetType,
short value) |
Object |
fromString(org.plasma.sdo.DataType targetDataType,
String value)
Converts the given string value to an object appropriate for the target
type.
|
Object |
fromString(commonj.sdo.Property targetProperty,
String value)
Converts the given string value to an object appropriate for the target
property and its type.
|
Object |
fromString(commonj.sdo.Type targetType,
String value)
Converts the given string value to an object appropriate for the target
type.
|
Object |
fromStrings(commonj.sdo.Type targetType,
List<String> value) |
Object |
fromTemporalDataType(commonj.sdo.Type targetType,
commonj.sdo.Type sourceType,
String value) |
Object |
fromUnsignedInt(commonj.sdo.Type targetType,
org.apache.jena.ext.com.google.common.primitives.UnsignedInteger value) |
Object |
fromUnsignedLong(commonj.sdo.Type targetType,
org.apache.jena.ext.com.google.common.primitives.UnsignedLong value) |
List<org.plasma.sdo.DataType> |
getAllowableTargetTypes(org.plasma.sdo.DataType dataType) |
DateFormat |
getDateFormat() |
DateFormat[] |
getDateFormats() |
DateFormat |
getDateTimeFormat() |
DateFormat |
getDayFormat() |
org.joda.time.format.PeriodFormatter |
getDurationFormat() |
DateFormat |
getMonthDayFormat() |
DateFormat |
getMonthFormat() |
DateFormat |
getTimeFormat() |
DateFormat |
getYearFormat() |
DateFormat |
getYearMonthDayFormat() |
DateFormat |
getYearMonthFormat() |
boolean |
toBoolean(commonj.sdo.Type sourceType,
Object value) |
byte |
toByte(commonj.sdo.Type sourceType,
Object value) |
byte[] |
toBytes(org.plasma.sdo.DataType sourceDataType,
Object value) |
byte[] |
toBytes(commonj.sdo.Type sourceType,
Object value) |
char |
toCharacter(commonj.sdo.Type sourceType,
Object value) |
Date |
toDate(commonj.sdo.Type sourceType,
Object value) |
BigDecimal |
toDecimal(commonj.sdo.Type sourceType,
Object value) |
double |
toDouble(commonj.sdo.Type sourceType,
Object value) |
float |
toFloat(commonj.sdo.Type sourceType,
Object value) |
int |
toInt(org.plasma.sdo.DataType sourceDataType,
Object value) |
int |
toInt(commonj.sdo.Type sourceType,
Object value) |
BigInteger |
toInteger(org.plasma.sdo.DataType sourceDataType,
Object value) |
BigInteger |
toInteger(commonj.sdo.Type sourceType,
Object value) |
long |
toLong(org.plasma.sdo.DataType sourceDataType,
Object value) |
long |
toLong(commonj.sdo.Type sourceType,
Object value) |
Class<?> |
toPrimitiveJavaClass(org.plasma.sdo.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(org.plasma.sdo.DataType sourceDataType,
Object value) |
short |
toShort(commonj.sdo.Type sourceType,
Object value) |
String |
toString(org.plasma.sdo.DataType sourceDataType,
Object value)
Converts the given value to a string.
|
String |
toString(commonj.sdo.Property property,
Object value)
Converts the given value to a string.
|
String |
toString(commonj.sdo.Type sourceType,
Object value)
Converts the given value to a string.
|
List<String> |
toStrings(commonj.sdo.Type sourceType,
Object value) |
String |
toTemporalDataType(org.plasma.sdo.DataType targetDataType,
commonj.sdo.Type sourceType,
Object value) |
String |
toTemporalDataType(commonj.sdo.Type targetType,
commonj.sdo.Type sourceType,
Object value) |
org.apache.jena.ext.com.google.common.primitives.UnsignedInteger |
toUnsignedInt(org.plasma.sdo.DataType sourceDataType,
Object value) |
org.apache.jena.ext.com.google.common.primitives.UnsignedInteger |
toUnsignedInt(commonj.sdo.Type sourceType,
Object value) |
org.apache.jena.ext.com.google.common.primitives.UnsignedLong |
toUnsignedLong(org.plasma.sdo.DataType sourceDataType,
Object value) |
org.apache.jena.ext.com.google.common.primitives.UnsignedLong |
toUnsignedLong(commonj.sdo.Type sourceType,
Object value) |
Class<?> |
toWrapperJavaClass(org.plasma.sdo.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.
|
public static volatile 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
public DateFormat[] getDateFormats()
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(commonj.sdo.Type targetType, commonj.sdo.Type sourceType, Object value)
public Object convert(org.plasma.sdo.DataType targetDataType, commonj.sdo.Type sourceType, Object value)
public boolean toBoolean(commonj.sdo.Type sourceType,
Object value)
public Object fromBoolean(commonj.sdo.Type targetType, boolean value)
public byte toByte(commonj.sdo.Type sourceType,
Object value)
public Object fromByte(commonj.sdo.Type targetType, byte value)
public byte[] toBytes(commonj.sdo.Type sourceType,
Object value)
public byte[] toBytes(org.plasma.sdo.DataType sourceDataType,
Object value)
public Object fromBytes(commonj.sdo.Type targetType, byte[] value)
public Object fromBytes(org.plasma.sdo.DataType targetDataType, byte[] value)
public char toCharacter(commonj.sdo.Type sourceType,
Object value)
public Object fromCharacter(commonj.sdo.Type targetType, char value)
public BigDecimal toDecimal(commonj.sdo.Type sourceType, Object value)
public Object fromDecimal(commonj.sdo.Type targetType, BigDecimal value)
public double toDouble(commonj.sdo.Type sourceType,
Object value)
public Object fromDouble(commonj.sdo.Type targetType, double value)
public float toFloat(commonj.sdo.Type sourceType,
Object value)
public Object fromFloat(commonj.sdo.Type targetType, float value)
public int toInt(commonj.sdo.Type sourceType,
Object value)
public int toInt(org.plasma.sdo.DataType sourceDataType,
Object value)
public Object fromInt(commonj.sdo.Type targetType, int value)
public org.apache.jena.ext.com.google.common.primitives.UnsignedInteger toUnsignedInt(commonj.sdo.Type sourceType,
Object value)
public org.apache.jena.ext.com.google.common.primitives.UnsignedInteger toUnsignedInt(org.plasma.sdo.DataType sourceDataType,
Object value)
public Object fromUnsignedInt(commonj.sdo.Type targetType, org.apache.jena.ext.com.google.common.primitives.UnsignedInteger value)
public BigInteger toInteger(commonj.sdo.Type sourceType, Object value)
public BigInteger toInteger(org.plasma.sdo.DataType sourceDataType, Object value)
public Object fromInteger(commonj.sdo.Type targetType, BigInteger value)
public long toLong(commonj.sdo.Type sourceType,
Object value)
public long toLong(org.plasma.sdo.DataType sourceDataType,
Object value)
public Object fromLong(commonj.sdo.Type targetType, long value)
public org.apache.jena.ext.com.google.common.primitives.UnsignedLong toUnsignedLong(commonj.sdo.Type sourceType,
Object value)
public org.apache.jena.ext.com.google.common.primitives.UnsignedLong toUnsignedLong(org.plasma.sdo.DataType sourceDataType,
Object value)
public Object fromUnsignedLong(commonj.sdo.Type targetType, org.apache.jena.ext.com.google.common.primitives.UnsignedLong value)
public short toShort(commonj.sdo.Type sourceType,
Object value)
public short toShort(org.plasma.sdo.DataType sourceDataType,
Object value)
public Object fromShort(commonj.sdo.Type targetType, short value)
public String toString(commonj.sdo.Type sourceType, Object value)
sourceType - the target datatypevalue - the value to convertInvalidDataConversionException - 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 specificationpublic String toString(org.plasma.sdo.DataType sourceDataType, Object value)
sourceType - the target datatypevalue - the value to convertInvalidDataConversionException - 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 specificationpublic String toString(commonj.sdo.Property property, Object value)
sourceProperty - the property type for the given propertyvalue - the value to convertInvalidDataConversionException - If an array of objects of the target type is detected for the
given value, and the given property is not a 'many' propertyIllegalArgumentException - if the given value is not the expected Java type as per the SDO
2.1 specificationIllegalArgumentException - if an array of objects of the target type is detected for the
given value, and the given property is not a 'many' propertypublic Object fromString(commonj.sdo.Type targetType, String value)
targetType - the target data typevalue - the valuepublic Object fromString(org.plasma.sdo.DataType targetDataType, String value)
targetType - the target data typevalue - the valuepublic Object fromString(commonj.sdo.Property targetProperty, String value)
targetType - the target data typevalue - the value to convert from stringIllegalArgumentException - if the given property is a 'many' property and no
java.util.Arrays formatting is detected for the given value.public String toTemporalDataType(commonj.sdo.Type targetType, commonj.sdo.Type sourceType, Object value)
public String toTemporalDataType(org.plasma.sdo.DataType targetDataType, commonj.sdo.Type sourceType, Object value)
public Object fromTemporalDataType(commonj.sdo.Type targetType, commonj.sdo.Type sourceType, String value)
public Class<?> toPrimitiveJavaClass(org.plasma.sdo.DataType dataType)
dataType - the SDO datatypepublic Class<?> toWrapperJavaClass(org.plasma.sdo.DataType dataType)
dataType - the SDO datatypepublic List<org.plasma.sdo.DataType> getAllowableTargetTypes(org.plasma.sdo.DataType dataType)
Copyright © 2021. All rights reserved.