|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanetj.database.Field
planetj.database.field.TimestampField
Nested Class Summary |
Nested classes inherited from class planetj.database.Field |
Field.FieldLocation |
Field Summary | |
static java.lang.String |
ISO_FORMAT
|
Fields inherited from class planetj.database.Field |
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_UNKNOWN |
Fields inherited from interface planetj.database.field.ICurrentValueField |
CURRENT_VALUE |
Fields inherited from interface planetj.dataengine.security.IGuarded |
TYPE_ID_UNKNOWN, TYPE_NAME_FIELD, TYPE_NAME_SQLOPERATION, TYPE_SECURED_BY_LEVEL, TYPE_SECURED_BY_OPERATION, TYPE_UNSECURED |
Constructor Summary | |
TimestampField()
|
Method Summary | |
Field |
cloneField()
Returns a clone of the Field. |
java.lang.Object |
createObject(java.lang.String value)
Create an object for this Field type using the given String. |
static java.sql.Timestamp |
createTimestamp(java.lang.String format,
java.lang.String value)
Create a java.utl.Date from the given format and String. |
java.lang.Object |
getAutoUpdateValue(ExecutingContext executingContext)
Get the field's auto update value as a Timestamp. |
java.lang.Object |
getCopiedValue()
Gets an independent copy of this field's value. |
java.lang.Object |
getCurrentValue(ExecutingContext ec)
Gets the default current value for this field as a String. |
java.lang.String |
getCurrentValueAsString(ExecutingContext ec)
Gets the default current value for this field as a String. |
java.lang.String |
getDefaultDatabaseValue()
Subclass must override this method and return a default value to be placed in the database when this field is Not-nullable and not required. |
java.lang.String |
getDefaultFormat()
|
java.lang.Object |
getDefaultValue(ExecutingContext executingContext)
Get the field's default value as a Timestamp. |
java.lang.String |
getDisplayFormat()
Get the display format for this Timestamp Field. |
protected java.lang.String |
getDisplayValue(java.lang.Object value)
Get the display value for this Timestamp. |
java.lang.String |
getSQLNullValue()
|
java.lang.String |
getSQLValue(boolean useOriginalValue)
Returns the Field's name and value in SQL format. |
java.lang.String |
getSQLValue(java.sql.Timestamp timestamp,
java.lang.String format,
boolean allowsNull)
Returns the field's value in the proper SQL format. |
java.lang.String |
getValidValuesString()
This method should be overriden by subclasses that want to display possible or valid values to a user Example PhoneNumber would return "Examples: (123) 456-7890, 1234567890, 123-456-78890" Creation date: (4/5/2002 2:52:46 PM) |
boolean |
getValueAsBoolean()
Subclasses must override this to detirmine what their boolean value is. |
java.lang.String |
getValueAsString()
Returns the Field's value as a String. |
static short |
guessFieldClassProbability(FieldDescriptorRow pFDRow,
RowCollection pSampleData)
Subclasses will override to take an educated guess at what the Field Class will be for this FD Row. |
boolean |
isTimestamp()
Subclasses should override to change the value |
boolean |
isUseZeroValue()
|
boolean |
isValueEqual(java.lang.Object obj)
Returns a boolean indicating if this field is equal to the supplied object. |
boolean |
isValueGreaterThan(java.lang.Object obj)
Returns a boolean indicating if this field is greater than the supplied object. |
boolean |
isValueLessThan(java.lang.Object obj)
Returns a boolean indicating if this field is less then the supplied object. |
void |
setUserZeroValue(boolean useZeroValue)
|
void |
setValue(long millis)
Sets the current value of the Field to the specified value, and also sets the old value to the previous value. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String ISO_FORMAT
Constructor Detail |
public TimestampField()
Method Detail |
public Field cloneField() throws CMException
cloneField
in class Field
CMException
public java.lang.Object createObject(java.lang.String value) throws ValidationException
createObject
in class Field
value
- String
ValidationException
public java.lang.Object getAutoUpdateValue(ExecutingContext executingContext) throws CMException
getAutoUpdateValue
in interface ICurrentValueField
getAutoUpdateValue
in class Field
CMException
public java.lang.Object getCopiedValue()
getCopiedValue
in class Field
public java.lang.Object getCurrentValue(ExecutingContext ec)
getCurrentValue
in interface ICurrentValueField
getCurrentValue
in class Field
public java.lang.String getCurrentValueAsString(ExecutingContext ec)
getCurrentValueAsString
in interface ICurrentValueField
getCurrentValueAsString
in class Field
public java.lang.String getDefaultDatabaseValue() throws CMException
Example: A SS# is not required to be filled in by users, but the database does not allow nulls in that field. SocialSecurityField must override this method and return a default value like -1; Creation date: (4/9/2002 4:33:45 PM)
getDefaultDatabaseValue
in class Field
CMException
public java.lang.String getDefaultFormat()
public java.lang.Object getDefaultValue(ExecutingContext executingContext) throws CMException
getDefaultValue
in interface ICurrentValueField
getDefaultValue
in class Field
CMException
public java.lang.String getDisplayFormat()
protected java.lang.String getDisplayValue(java.lang.Object value)
public java.lang.String getSQLNullValue()
getSQLNullValue
in class Field
public java.lang.String getSQLValue(boolean useOriginalValue) throws CMException
getSQLValue
in class Field
useOriginalValue
- If this is true then the value used will be this field's original value as it
was read from the database. Otherwise its current value is used.
CMException
public boolean isUseZeroValue()
public java.lang.String getValidValuesString()
Field
getValidValuesString
in class Field
public boolean getValueAsBoolean()
getValueAsBoolean
in class Field
public static java.sql.Timestamp createTimestamp(java.lang.String format, java.lang.String value) throws java.text.ParseException
java.text.ParseException
public static short guessFieldClassProbability(FieldDescriptorRow pFDRow, RowCollection pSampleData)
public java.lang.String getSQLValue(java.sql.Timestamp timestamp, java.lang.String format, boolean allowsNull)
public boolean isValueEqual(java.lang.Object obj)
isValueEqual
in class Field
public boolean isValueGreaterThan(java.lang.Object obj)
isValueGreaterThan
in class Field
public boolean isValueLessThan(java.lang.Object obj)
isValueLessThan
in class Field
public void setUserZeroValue(boolean useZeroValue)
public void setValue(long millis) throws CMException
Field
setValue
in class Field
CMException
public java.lang.String getValueAsString()
Field
getValueAsString
in class Field
public boolean isTimestamp()
Field
isTimestamp
in class Field
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |