|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.text.Format
com.davisor.data.Type
com.davisor.data.LocaleType
com.davisor.data.FormatType
com.davisor.data.DateFormatType
com.davisor.data.TimestampType
com.davisor.data.DateType
DateType defines a data type that formats and parses date
strings. Date strings are not expected to contain any time-of-day
information, as opposed to the more general date interpretation
used by the Java Date class.
DateFormatType superclass. However, date types are expected to be
handle only date and no time related information.
CalendarFieldType,
CalendarType,
DateData,
TimeType,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
| Field Summary | |
static DateType |
DEFAULT
Default date type. |
static java.lang.String |
TYPENAME
Type name ("DATE"). |
| Fields inherited from class com.davisor.data.DateFormatType |
GMT, LOCAL, M_style, M_timeZone |
| Fields inherited from class com.davisor.data.FormatType |
M_pattern, M_sample |
| Fields inherited from class com.davisor.data.LocaleType |
DEFAULT_LOCALE, M_locale |
| Fields inherited from class com.davisor.data.Type |
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS |
| Constructor Summary | |
|
DateType()
Default constructor. |
|
DateType(DateType dt)
Copy constructor. |
|
DateType(java.lang.String dataName)
Creates a new default type with no identity. |
|
DateType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
int style,
java.util.TimeZone timeZone)
Creates a new date type. |
|
DateType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
Create a new date type with localized date formatting. |
protected |
DateType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
int style,
java.util.TimeZone timeZone)
Creates a new date type. |
| Method Summary | |
protected java.text.Format |
createFormatter()
Creates a new date format instance suitable for the purposes of this class. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
boolean |
equals(java.lang.Object o)
Tests if this object is equal with another object. |
int |
getSQLCode()
Gets the SQL type code, as defined by java.sql.Types. |
java.lang.String |
stringValue(java.util.Date value)
Formats a date as a date string. |
void |
strip(java.util.Calendar calendar)
Clears all time information from the given calendar. |
DataValue |
toData(java.sql.CallableStatement statement,
int column)
Converts a callable statement variable to a data value. |
DataValue |
toData(java.sql.ResultSet resultSet,
int column)
Converts a result set column value to a data value. |
| Methods inherited from class com.davisor.data.TimestampType |
zero |
| Methods inherited from class com.davisor.data.DateFormatType |
createCalendar, createCalendar, createCalendar, createCalendar, createCalendar, createCalendar, dateValue, getFormat, getLast, getStyle, getTimeZone, getValueClass, hashCode, setFormat, setStyle, setTimeZone, toData, toData, toData, toData |
| Methods inherited from class com.davisor.data.FormatType |
clearFormatter, getFormatter, getPattern, getSample, setFormat, setLocale, setPattern, setSample |
| Methods inherited from class com.davisor.data.LocaleType |
getLocale, setLocale |
| Methods inherited from class com.davisor.data.Type |
ceil, check, check, compare, create, create, create, create, create, dup, floor, format, getCompatibility, getDataName, getId, getID, getMetaData, getMetaData, getSpecs, getSQLName, getSQLName, getTypeName, isNull, parseObject, register, register, setDataName, setId, setID, setMetaData, setMetaData, setSpecs, toString, toXML, xmlEnd, xmlStart |
| Methods inherited from class java.text.Format |
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final DateType DEFAULT
public static final java.lang.String TYPENAME
| Constructor Detail |
public DateType()
public DateType(DateType dt)
public DateType(java.lang.String dataName)
dataName - data name (may be null)
public DateType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
This is the constructor the SQL type mapper Type.create(Integer,String,String,String) method will call to
create a type that matches given SQL type.
dataName - data name (may be null)id - type identity (may be null)format - date format (may be null)DateFormatType.setFormat(java.lang.String)
public DateType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
int style,
java.util.TimeZone timeZone)
dataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)style - java.text.DateFormat style codetimeZone - date format time zoneFormatType.setLocale(java.util.Locale),
FormatType.setPattern(java.lang.String),
FormatType.setSample(java.lang.Object),
DateFormatType.setStyle(int),
DateFormatType.setTimeZone(java.util.TimeZone)
protected DateType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample,
int style,
java.util.TimeZone timeZone)
typeName - type namedataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)style - java.text.DateFormat style codetimeZone - date format time zoneFormatType.setLocale(java.util.Locale),
FormatType.setPattern(java.lang.String),
FormatType.setSample(java.lang.Object),
DateFormatType.setStyle(int),
DateFormatType.setTimeZone(java.util.TimeZone)| Method Detail |
public void strip(java.util.Calendar calendar)
The following calendar fields are cleared:
strip in class DateFormatTypecalendar - calendar to be strippedTimeType.strip(java.util.Calendar)public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class TimestampTypeprotected java.text.Format createFormatter()
This particular implementation returns a
java.text.DateFormat date instance that is expected
to format dates so that they contain only date and no time
information. Current pattern is applied to it only if it is also
a SimpleDateFormat instance. The format time zone is
set to the system default time zone.
createFormatter in class DateFormatTypeDateFormatType.getTimeZone(),
TimeType.createFormatter(),
DateFormatType.createFormatter()public boolean equals(java.lang.Object o)
Date types are equal if their super-classes are.
equals in interface java.util.Comparatorequals in class TimestampTypepublic java.lang.String stringValue(java.util.Date value)
FormatType.getFormatter(). If the
current format is null, java.sql.Date
formatting is used.
stringValue in class DateFormatTypevalue - date value
value. If
the value is null or the time of value is
TimestampData.NaT, the return value is an empty string.FormatType.getFormatter()public int getSQLCode()
getSQLCode in class TimestampType
public DataValue toData(java.sql.CallableStatement statement,
int column)
throws InvalidDataException,
java.sql.SQLException
Gets statement date value, and returns a corresponding
DateData value.
toData in class TimestampTypestatement - statement holding the data value to be convertedcolumn - SQL column index for the data value to be converted
InvalidDataException - if given object value could not be parsed
java.sql.SQLException - if a SQL error occurstoData(ResultSet,int),
DataValue.toString(),
DateData
public DataValue toData(java.sql.ResultSet resultSet,
int column)
throws InvalidDataException,
java.sql.SQLException
Gets result set column date value, and returns a corresponding
DateData value.
toData in class TimestampTyperesultSet - resultSet holding the data value to be convertedcolumn - SQL column index for the data value to be converted
InvalidDataException - if given object value could not be parsed
java.sql.SQLException - if a SQL error occurstoData(CallableStatement,int),
DataValue.toString(),
DateData
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||