com.j256.ormlite.field.types
Class BaseDateType

java.lang.Object
  extended by com.j256.ormlite.field.BaseFieldConverter
      extended by com.j256.ormlite.field.types.BaseDataType
          extended by com.j256.ormlite.field.types.BaseDateType
All Implemented Interfaces:
DataPersister, FieldConverter
Direct Known Subclasses:
DateLongType, DateStringType, DateType

public abstract class BaseDateType
extends BaseDataType

Base class for all of the Date class types.

Author:
graywatson

Nested Class Summary
protected static class BaseDateType.DateStringFormatConfig
           
 
Field Summary
protected static BaseDateType.DateStringFormatConfig defaultDateFormatConfig
           
 
Constructor Summary
protected BaseDateType(SqlType sqlType, Class<?>[] classes)
           
 
Method Summary
protected static BaseDateType.DateStringFormatConfig convertDateStringConfig(FieldType fieldType, BaseDateType.DateStringFormatConfig defaultDateFormatConfig)
           
 boolean isValidForField(Field field)
          Return true if the field is appropriate for this persister otherwise false.
 boolean isValidForVersion()
          Return true if this is a valid field for the DatabaseField.version().
 Object moveToNextValue(Object currentValue)
          Move the current-value to the next value.
protected static String normalizeDateString(BaseDateType.DateStringFormatConfig formatConfig, String dateStr)
           
protected static Date parseDateString(BaseDateType.DateStringFormatConfig formatConfig, String dateStr)
           
 
Methods inherited from class com.j256.ormlite.field.types.BaseDataType
convertIdNumber, dataIsEqual, generateId, getAssociatedClasses, getAssociatedClassNames, getDefaultWidth, getPrimaryClass, getSqlType, isAppropriateId, isArgumentHolderRequired, isComparable, isEscapedDefaultValue, isEscapedValue, isPrimitive, isSelfGeneratedId, isValidGeneratedType, makeConfigObject, parseDefaultString, resultStringToJava, resultToSqlArg
 
Methods inherited from class com.j256.ormlite.field.BaseFieldConverter
isStreamType, javaToSqlArg, resultToJava, sqlArgToJava
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.j256.ormlite.field.FieldConverter
isStreamType, javaToSqlArg, resultToJava, sqlArgToJava
 

Field Detail

defaultDateFormatConfig

protected static final BaseDateType.DateStringFormatConfig defaultDateFormatConfig
Constructor Detail

BaseDateType

protected BaseDateType(SqlType sqlType,
                       Class<?>[] classes)
Method Detail

convertDateStringConfig

protected static BaseDateType.DateStringFormatConfig convertDateStringConfig(FieldType fieldType,
                                                                             BaseDateType.DateStringFormatConfig defaultDateFormatConfig)

parseDateString

protected static Date parseDateString(BaseDateType.DateStringFormatConfig formatConfig,
                                      String dateStr)
                               throws ParseException
Throws:
ParseException

normalizeDateString

protected static String normalizeDateString(BaseDateType.DateStringFormatConfig formatConfig,
                                            String dateStr)
                                     throws ParseException
Throws:
ParseException

isValidForVersion

public boolean isValidForVersion()
Description copied from interface: DataPersister
Return true if this is a valid field for the DatabaseField.version().

Specified by:
isValidForVersion in interface DataPersister
Overrides:
isValidForVersion in class BaseDataType

moveToNextValue

public Object moveToNextValue(Object currentValue)
Description copied from interface: DataPersister
Move the current-value to the next value. Used for the version field.

Specified by:
moveToNextValue in interface DataPersister
Overrides:
moveToNextValue in class BaseDataType

isValidForField

public boolean isValidForField(Field field)
Description copied from interface: DataPersister
Return true if the field is appropriate for this persister otherwise false.

Specified by:
isValidForField in interface DataPersister
Overrides:
isValidForField in class BaseDataType


This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.