|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tuscany.sdo.helper.DataHelperImpl
public class DataHelperImpl
Data helper methods.
Field Summary |
---|
Fields inherited from interface commonj.sdo.helper.DataHelper |
---|
INSTANCE |
Constructor Summary | |
---|---|
DataHelperImpl()
|
Method Summary | |
---|---|
Object |
convert(Property property,
Object value)
Convert the specified value to an instance
of the specified property's type . |
Object |
convert(Type type,
Object value)
Convert the specified value to an instance
of the specified type. |
Date |
handleBCE(Date output)
|
Date |
handleNegative(Date output)
|
String |
obtainDurationFormats(String dateString)
|
String |
obtainSpecificFormat(String dateString)
|
Calendar |
toCalendar(String dateString)
Convert from a String representation of an SDO date type to a Calendar using the default locale. |
Calendar |
toCalendar(String dateString,
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. |
Date |
toDate(String dateString)
Convert from a String representation of an SDO date type to a Date. |
String |
toDateTime(Calendar calendar)
Convert from a Calendar to a String representation of the DateTime type. |
String |
toDateTime(Date date)
Convert from a Date to a String representation of the DateTime type. |
String |
toDay(Calendar calendar)
Convert from a Calendar to a String representation of the Day type. |
String |
toDay(Date date)
Convert from a Date to a String representation of the Day type. |
String |
toDuration(Calendar calendar)
Convert from a Calendar to a String representation of the Duration type. |
String |
toDuration(Date date)
Convert from a Date to a String representation of the Duration type. |
String |
toMonth(Calendar calendar)
Convert from a Calendar to a String representation of the Month type. |
String |
toMonth(Date date)
Convert from a Date to a String representation of the Month type. |
String |
toMonthDay(Calendar calendar)
Convert from a Calendar to a String representation of the MonthDay type. |
String |
toMonthDay(Date date)
Convert from a Date to a String representation of the MonthDay type. |
String |
toTime(Calendar calendar)
Convert from a Calendar to a String representation of the Time type. |
String |
toTime(Date date)
Convert from a Date to a String representation of the Time type. |
String |
toYear(Calendar calendar)
Convert from a Calendar to a String representation of the Year type. |
String |
toYear(Date date)
Convert from a Date to a String representation of the Year type. |
String |
toYearMonth(Calendar calendar)
Convert from a Calendar to a String representation of the YearMonth type. |
String |
toYearMonth(Date date)
Convert from a Date to a String representation of the YearMonth type. |
String |
toYearMonthDay(Calendar calendar)
Convert from a Calendar to a String representation of the YearMonthDay type. |
String |
toYearMonthDay(Date date)
Convert from a Date to a String representation of the YearMonthDay type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataHelperImpl()
Method Detail |
---|
public Date toDate(String dateString)
DataHelper
toDate
in interface DataHelper
dateString
- - Must comply to the pattern of yyyy-MM-dd'T'HH:mm:ss'.'SSS'Z'
public String obtainSpecificFormat(String dateString)
public String obtainDurationFormats(String dateString)
public Date handleNegative(Date output)
public Date handleBCE(Date output)
public Calendar toCalendar(String dateString)
DataHelper
toCalendar
in interface DataHelper
dateString
- the String representation of an SDO date type
public Calendar toCalendar(String dateString, Locale locale)
DataHelper
toCalendar
in interface DataHelper
dateString
- the String representation of an SDO date typelocale
- the locale or null for default locale.
public String toDateTime(Date date)
DataHelper
toDateTime
in interface DataHelper
date
- the date
public String toDuration(Date date)
DataHelper
toDuration
in interface DataHelper
date
- the date
public String toTime(Date date)
DataHelper
toTime
in interface DataHelper
date
- the date
public String toDay(Date date)
DataHelper
toDay
in interface DataHelper
date
- the date
public String toMonth(Date date)
DataHelper
toMonth
in interface DataHelper
date
- the date
public String toMonthDay(Date date)
DataHelper
toMonthDay
in interface DataHelper
date
- the date
public String toYear(Date date)
DataHelper
toYear
in interface DataHelper
date
- the date
public String toYearMonth(Date date)
DataHelper
toYearMonth
in interface DataHelper
date
- the date
public String toYearMonthDay(Date date)
DataHelper
toYearMonthDay
in interface DataHelper
date
- the date
public String toDateTime(Calendar calendar)
DataHelper
toDateTime
in interface DataHelper
calendar
- the calendar to convert
public String toDuration(Calendar calendar)
DataHelper
toDuration
in interface DataHelper
calendar
- the calendar to convert
public String toTime(Calendar calendar)
DataHelper
toTime
in interface DataHelper
calendar
- the calendar to convert
public String toDay(Calendar calendar)
DataHelper
toDay
in interface DataHelper
calendar
- the calendar to convert
public String toMonth(Calendar calendar)
DataHelper
toMonth
in interface DataHelper
calendar
- the calendar to convert
public String toMonthDay(Calendar calendar)
DataHelper
toMonthDay
in interface DataHelper
calendar
- the calendar to convert
public String toYear(Calendar calendar)
DataHelper
toYear
in interface DataHelper
calendar
- the calendar to convert
public String toYearMonth(Calendar calendar)
DataHelper
toYearMonth
in interface DataHelper
calendar
- the calendar to convert
public String toYearMonthDay(Calendar calendar)
DataHelper
toYearMonthDay
in interface DataHelper
calendar
- the calendar to convert
public Object convert(Type type, Object value)
DataHelper
instance
of the specified type.
Supported conversions are listed in Section 16 of the SDO specification.
convert
in interface DataHelper
type
- the target data type
.value
- the value to convert
DataHelper.convert(Property, Object)
public Object convert(Property property, Object value)
DataHelper
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 DataHelper
property
- the target data type
property.value
- the value or List of values to convert
DataHelper.convert(Type, Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |