com.davisor.data
Class DateOutputType
java.lang.Object
java.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
com.davisor.data.DateOutputType
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Comparator, com.davisor.core.Dupable, java.io.Serializable
- public class DateOutputType
- extends DateType
DateOutputType defines a data type that formats date strings using
given localization format, but always parses them as SQL dates or
timestamps.
- Since:
- JDK1.1
- See Also:
DateData,
DateInputType,
DateType,
TimeOutputType,
Serialized Form
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
|
Field Summary |
static java.lang.String |
TAG
Type name ("ODATE"). |
|
Constructor Summary |
|
DateOutputType()
Default constructor. |
|
DateOutputType(DateOutputType dot)
Copy constructor. |
|
DateOutputType(java.lang.String dataName)
Creates a new default type with no identity. |
|
DateOutputType(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 output type. |
|
DateOutputType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
Create a new date output type with localized date parsing.
|
protected |
DateOutputType(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 output type. |
|
Method Summary |
java.util.Date |
dateValue(java.lang.String value)
Parse a date string as a SQL date, regardless of the current type
specifications. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
| 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.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 |
TAG
public static final java.lang.String TAG
- Type name ("ODATE").
- See Also:
- Constant Field Values
DateOutputType
public DateOutputType()
- Default constructor.
DateOutputType
public DateOutputType(DateOutputType dot)
- Copy constructor.
DateOutputType
public DateOutputType(java.lang.String dataName)
- Creates a new default type with no identity.
- Parameters:
dataName - data name (may be null)
DateOutputType
public DateOutputType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
- Create a new date output type with localized date parsing.
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.
- Parameters:
dataName - data name (may be null)id - type identity (may be null)format - language and country codes, separated by single
space characters. null or an empty specification
string implies SQL date formatting.- See Also:
DateFormatType.setFormat(java.lang.String)
DateOutputType
public DateOutputType(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 output type.
- Parameters:
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 - date format style as defined by the DateFormat classtimeZone - date format time zone
DateOutputType
protected DateOutputType(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 output type.
- Parameters:
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 - date format style as defined by the DateFormat classtimeZone - date format time zone
dateValue
public java.util.Date dateValue(java.lang.String value)
throws NullDataException
- Parse a date string as a SQL date, regardless of the current type
specifications. Even a SQL timestamp will do.
- Parameters:
value - a SQL date string
- Returns:
- Date object corresponding 'value'.
- Throws:
NullDataException - the 'value' is null or empty.- See Also:
Date.valueOf(java.lang.String)
dup
public com.davisor.core.Dupable dup()
- Makes a deep copy of this object.
- Specified by:
dup in interface com.davisor.core.Dupable- Overrides:
dup in class DateType
Copyright © 2001-2004 Davisor Oy. All Rights Reserved.