public class SDODataHelper
extends java.lang.Object
implements commonj.sdo.helper.DataHelper
Purpose: A helper class for performing data conversions.
| Constructor and Description |
|---|
SDODataHelper() |
SDODataHelper(commonj.sdo.helper.HelperContext aContext) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
convert(commonj.sdo.Property property,
java.lang.Object value)
Convert the specified value to an
instance of the specified property's type. |
java.lang.Object |
convert(commonj.sdo.Type type,
java.lang.Object value)
Convert the specified value to an
instance of the specified type. |
java.lang.Object |
convertFromStringValue(java.lang.String value,
java.lang.Class convertClass)
Convert a String value based to the appropriate type.
|
java.lang.Object |
convertFromStringValue(java.lang.String value,
java.lang.Class convertClass,
javax.xml.namespace.QName schemaType)
Convert a String value based to the appropriate type.
|
java.lang.Object |
convertFromStringValue(java.lang.String value,
commonj.sdo.Type sdoType)
Convert a String value based to the appropriate type.
|
java.lang.Object |
convertFromStringValue(java.lang.String value,
commonj.sdo.Type sdoType,
javax.xml.namespace.QName schemaType)
Convert a String value based to the appropriate type.
|
java.lang.String |
convertToStringValue(java.lang.Object value,
commonj.sdo.Type sdoType)
Convert to a String value based to the SDO type.
|
java.lang.Object |
convertValue(java.lang.Object value,
java.lang.Class convertClass,
javax.xml.namespace.QName schemaType)
Convert a value based to the appropriate type.
|
java.lang.Object |
convertValueToClass(commonj.sdo.Property prop,
java.lang.Object valueToConvert,
java.lang.Class convertToClass)
INTERNAL:
|
commonj.sdo.helper.HelperContext |
getHelperContext()
INTERNAL:
|
void |
setHelperContext(commonj.sdo.helper.HelperContext helperContext)
INTERNAL:
|
void |
setTimeZone(java.util.TimeZone timeZone)
The specified TimeZone will be used for all String to Date object
conversions.
|
void |
setTimeZoneQualified(boolean timeZoneQualified)
By setting this flag to true the marshalled date objects marshalled to
the XML schema types time and dateTime will be qualified by a time zone.
|
java.util.Calendar |
toCalendar(java.lang.String dateString)
Convert from a String representation of an SDO date type to a Calendar
using the default locale.
|
java.util.Calendar |
toCalendar(java.lang.String dateString,
java.util.Locale locale)
Convert from a String representation of an SDO date type to a Calendar
using the specified locale, or the default locale if the locale is null.
|
java.util.Date |
toDate(java.lang.String dateString)
Convert from a String representation of the Date type to a Date.
|
java.lang.String |
toDateTime(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the DateTime type.
|
java.lang.String |
toDateTime(java.util.Date date)
Convert from a Date to a String representation of the DateTime type.
|
java.lang.String |
toDay(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the Day type.
|
java.lang.String |
toDay(java.util.Date date)
Convert from a Date to a String representation of the Day type.
|
java.lang.String |
toDuration(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the Duration type.
|
java.lang.String |
toDuration(java.util.Date date)
Convert from a Date to a String representation of the Duration type.
|
java.lang.String |
toMonth(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the Month type.
|
java.lang.String |
toMonth(java.util.Date date)
Convert from a Date to a String representation of the Month type.
|
java.lang.String |
toMonthDay(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the MonthDay type.
|
java.lang.String |
toMonthDay(java.util.Date date)
Convert from a Date to a String representation of the MonthDay type.
|
java.lang.String |
toTime(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the Time type.
|
java.lang.String |
toTime(java.util.Date date)
Convert from a Date to a String representation of the Time type.
|
java.lang.String |
toYear(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the Year type.
|
java.lang.String |
toYear(java.util.Date date)
Convert from a Date to a String representation of the Year type.
|
java.lang.String |
toYearMonth(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the YearMonth type.
|
java.lang.String |
toYearMonth(java.util.Date date)
Convert from a Date to a String representation of the YearMonth type.
|
java.lang.String |
toYearMonthDay(java.util.Calendar calendar)
Convert from a Calendar to a String representation of the YearMonthDay
type.
|
java.lang.String |
toYearMonthDay(java.util.Date date)
Convert from a Date to a String representation of the YearMonthDay type.
|
public SDODataHelper()
public SDODataHelper(commonj.sdo.helper.HelperContext aContext)
public void setTimeZone(java.util.TimeZone timeZone)
public void setTimeZoneQualified(boolean timeZoneQualified)
public java.util.Calendar toCalendar(java.lang.String dateString)
toCalendar in interface commonj.sdo.helper.DataHelperdateString - the String representation of an SDO date typejava.lang.IllegalArgumentException - for invalid formats.public java.util.Calendar toCalendar(java.lang.String dateString,
java.util.Locale locale)
toCalendar in interface commonj.sdo.helper.DataHelperdateString - the String representation of an SDO date typelocale - the locale or null for default locale.java.lang.IllegalArgumentException - for invalid formats.public java.util.Date toDate(java.lang.String dateString)
toDate in interface commonj.sdo.helper.DataHelperdateString - a String representation of the Date typepublic java.lang.String toDateTime(java.util.Calendar calendar)
toDateTime in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.String toDateTime(java.util.Date date)
toDateTime in interface commonj.sdo.helper.DataHelperdate - the datepublic java.lang.String toDay(java.util.Calendar calendar)
toDay in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.String toDay(java.util.Date date)
toDay in interface commonj.sdo.helper.DataHelperdate - the datepublic java.lang.String toDuration(java.util.Calendar calendar)
toDuration in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.String toDuration(java.util.Date date)
toDuration in interface commonj.sdo.helper.DataHelperdate - the datepublic java.lang.String toMonth(java.util.Calendar calendar)
toMonth in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.String toMonth(java.util.Date date)
toMonth in interface commonj.sdo.helper.DataHelperdate - the datepublic java.lang.String toMonthDay(java.util.Calendar calendar)
toMonthDay in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.String toMonthDay(java.util.Date date)
toMonthDay in interface commonj.sdo.helper.DataHelperdate - the date to convertpublic java.lang.String toTime(java.util.Calendar calendar)
toTime in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.String toTime(java.util.Date date)
toTime in interface commonj.sdo.helper.DataHelperdate - the datepublic java.lang.String toYear(java.util.Calendar calendar)
toYear in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.String toYear(java.util.Date date)
toYear in interface commonj.sdo.helper.DataHelperdate - the datepublic java.lang.String toYearMonth(java.util.Date date)
toYearMonth in interface commonj.sdo.helper.DataHelperdate - the datepublic java.lang.String toYearMonthDay(java.util.Date date)
toYearMonthDay in interface commonj.sdo.helper.DataHelperdate - the datepublic java.lang.String toYearMonth(java.util.Calendar calendar)
toYearMonth in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.String toYearMonthDay(java.util.Calendar calendar)
toYearMonthDay in interface commonj.sdo.helper.DataHelpercalendar - the calendar to convertpublic java.lang.Object convertValue(java.lang.Object value,
java.lang.Class convertClass,
javax.xml.namespace.QName schemaType)
value - The value to convert.convertClass - The class to convert the value to.schemaType - The schema type if available.public java.lang.Object convertFromStringValue(java.lang.String value,
java.lang.Class convertClass)
value - The String value to convert.convertClass - The class to convert the value to.public java.lang.Object convertFromStringValue(java.lang.String value,
commonj.sdo.Type sdoType)
value - The String value to convert.sdoType - The SDO type of the value to convert the value to.public java.lang.Object convertFromStringValue(java.lang.String value,
commonj.sdo.Type sdoType,
javax.xml.namespace.QName schemaType)
value - The String value to convert.sdoType - The SDO type of the value to convert the value to.schemaType - The schema type if available.public java.lang.Object convertFromStringValue(java.lang.String value,
java.lang.Class convertClass,
javax.xml.namespace.QName schemaType)
value - The String value to convert.convertClass - The class to convert the value to.schemaType - The schema type if available.public java.lang.String convertToStringValue(java.lang.Object value,
commonj.sdo.Type sdoType)
value - The value to convert.sdoType - the SDO typepublic java.lang.Object convert(commonj.sdo.Type type,
java.lang.Object value)
instance of the specified type. Supported conversions are listed in
Section 14 of the SDO specification.convert in interface commonj.sdo.helper.DataHelpertype - the target data type.value - the value to convertjava.lang.IllegalArgumentException - if the value could not be convertedconvert(Property, Object)public java.lang.Object convert(commonj.sdo.Property property,
java.lang.Object value)
instance of the specified property's type.
The specified value must be a List if the property is
many valued. In this case, all the values in
the List are converted.convert in interface commonj.sdo.helper.DataHelperproperty - the target data type property.value - the value or List of values to convertjava.lang.IllegalArgumentException - if the value could not be convertedconvert(Type, Object)public java.lang.Object convertValueToClass(commonj.sdo.Property prop,
java.lang.Object valueToConvert,
java.lang.Class convertToClass)
public commonj.sdo.helper.HelperContext getHelperContext()
public void setHelperContext(commonj.sdo.helper.HelperContext helperContext)