com.davisor.data
Class TimestampInputType
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.TimestampInputType
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Comparator, com.davisor.core.Dupable, java.io.Serializable
- public class TimestampInputType
- extends TimestampType
TimestampInputType defines a data type that parses timestamp
strings using given localization format, but always formats them as
SQL timestamps.
- Since:
- JDK1.1
- See Also:
DateData,
DateType,
TimeType,
TimestampOutputType,
TimestampType,
Serialized Form
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
|
Field Summary |
static java.lang.String |
TYPENAME
Type name ("ITIMESTAMP"). |
|
Constructor Summary |
|
TimestampInputType()
Default constructor. |
|
TimestampInputType(java.lang.String dataName)
Creates a new default type with no identity. |
|
TimestampInputType(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 timestamp input type. |
|
TimestampInputType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
Create a new timestamp input type with localized time formatting.
|
protected |
TimestampInputType(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 timestamp input type. |
|
TimestampInputType(TimestampInputType tit)
Copy constructor. |
|
Method Summary |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
java.lang.String |
stringValue(java.util.Date value)
Formats a timestamp as a SQL timestamp string. |
| Methods inherited from class com.davisor.data.DateFormatType |
createCalendar, createCalendar, createCalendar, createCalendar, createCalendar, createCalendar, createFormatter, dateValue, getFormat, getLast, getStyle, getTimeZone, getValueClass, hashCode, setFormat, setStyle, setTimeZone, strip, 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 |
TYPENAME
public static final java.lang.String TYPENAME
- Type name ("ITIMESTAMP").
- See Also:
- Constant Field Values
TimestampInputType
public TimestampInputType()
- Default constructor.
TimestampInputType
public TimestampInputType(TimestampInputType tit)
- Copy constructor.
TimestampInputType
public TimestampInputType(java.lang.String dataName)
- Creates a new default type with no identity.
- Parameters:
dataName - data name (may be null)
TimestampInputType
public TimestampInputType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
- Create a new timestamp input type with localized time formatting.
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 - type instance name (may be nullq)id - type identity (may be nullq)format - language and country codes, separated by a single
space characters. null or an empty specification
string implies SQL time formatting.- See Also:
DateFormatType.setFormat(java.lang.String)
TimestampInputType
public TimestampInputType(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 timestamp input type.
- Parameters:
dataName - data naqme (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
TimestampInputType
protected TimestampInputType(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 timestamp input type.
- Parameters:
typeName - type namedataName - data naqme (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
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 TimestampType
stringValue
public java.lang.String stringValue(java.util.Date value)
- Formats a timestamp as a SQL timestamp string.
- Overrides:
stringValue in class DateFormatType
- Parameters:
value - timestamp value
- Returns:
- String representation of 'value', formatted according
to the JDBC SQL timestamp format.
- See Also:
LocaleType.setFormat(java.lang.String)
Copyright © 2001-2004 Davisor Oy. All Rights Reserved.