|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectplanetj.database.Field
planetj.database.field.DateField
| Nested Class Summary |
| Nested classes inherited from class planetj.database.Field |
Field.FieldLocation |
| Field Summary | |
static java.lang.String |
ISO_FORMAT
|
static java.lang.String |
LENIENT
|
| 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 | |
DateField()
|
|
| Method Summary | |
Field |
cloneField()
Returns a clone of the Field. |
static java.util.Date |
createDate(java.lang.String format,
java.lang.String value)
Create a java.util.Date from the given format and String. |
java.lang.Object |
createObject(java.lang.String pStringValue)
Create an object for this Field type using the given String. |
static int |
getCentury(java.util.Date date)
Get the century for the given date. |
java.lang.Object |
getCopiedValue()
Gets an independent copy of this field's value. |
java.lang.String |
getCSVField()
Returns the String value of the Object, that will be written to the CSV file. |
java.lang.String |
getCSVFormat()
Returns the CSV Format Creation date: (5/11/2002 7:56:58 PM) |
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()
Get the default format for this date field from its system. |
java.lang.String |
getDisplayFormat()
Returns the Default Format Creation date: (5/11/2002 7:56:58 PM) |
protected java.lang.String |
getDisplayValue(java.lang.Object value)
Gets the display value for this date field. |
java.lang.String |
getISOFormat()
Returns the CSV Format Creation date: (5/11/2002 7:56:58 PM) |
java.lang.String |
getJulianFormat()
|
java.lang.String |
getOldValueAsString()
Gets this date field's old value as a string. |
java.lang.String |
getPossibleFormats()
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) |
java.lang.Object |
getSQLObject()
Gets this field's value as an Object in SQL format. |
java.lang.String |
getSQLValue(boolean useOriginalValue)
Returns the Field's name and value in SQL format. |
static java.lang.String |
getSQLValue(java.util.Date date,
java.lang.String format,
int sqlType,
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) |
java.lang.Object |
getValue()
Get the date field's value |
boolean |
getValueAsBoolean()
Subclasses must override this to detirmine what their boolean value is. |
java.lang.String |
getValueAsString()
Gets this date field's value as a string. |
static java.lang.String |
getYear(int c,
java.lang.String yy)
Get the 4 digit year 'yyyy' for the given century and two digit year 'cyy'. |
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 |
isDate()
Subclasses should override to change the value |
boolean |
isValidLength(ExecutingContext ec)
Validate this Field based on its max length attribute. |
boolean |
isValidValue(ExecutingContext ec)
Validate this Field value. |
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 |
setValue(long millis)
Sets the current value of the Field to the specified value, and also sets the old value to the previous value. |
void |
setValue(java.lang.Object value)
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 |
| Methods inherited from interface planetj.database.field.ICurrentValueField |
getAutoUpdateValue, getDefaultValue |
| Field Detail |
public static java.lang.String ISO_FORMAT
public static final java.lang.String LENIENT
| Constructor Detail |
public DateField()
| Method Detail |
public static java.util.Date createDate(java.lang.String format,
java.lang.String value)
throws java.text.ParseException
java.text.ParseException
public static java.lang.String getSQLValue(java.util.Date date,
java.lang.String format,
int sqlType,
boolean allowsNull)
public Field cloneField()
throws CMException
cloneField in class FieldCMException
public java.lang.Object createObject(java.lang.String pStringValue)
throws ValidationException
createObject in class FieldpStringValue - String
ValidationExceptionpublic java.lang.Object getCopiedValue()
getCopiedValue in class Fieldpublic java.lang.String getCSVField()
Character string in the format MM/DD/YYYY where MM and DD have leading zeros for values less than ten. If this is a TimeField the format is HH:mm:ss where HH, mm, and ss have leading zeros for values less than ten. The string is not enclosed by double quotation marks.
In a CMException was thrown, or there were problems, then [Invalid Field] will be returned Creation date: (4/22/2002 2:28:48 PM)
getCSVField in interface ICSVFieldgetCSVField in class Fieldpublic java.lang.String getCSVFormat()
public java.lang.Object getCurrentValue(ExecutingContext ec)
getCurrentValue in interface ICurrentValueFieldgetCurrentValue in class Fieldpublic java.lang.String getCurrentValueAsString(ExecutingContext ec)
getCurrentValueAsString in interface ICurrentValueFieldgetCurrentValueAsString 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:51:06 PM)
getDefaultDatabaseValue in class FieldCMExceptionpublic java.lang.String getDefaultFormat()
getDefaultFormat in interface IDateFieldpublic java.lang.String getDisplayFormat()
protected java.lang.String getDisplayValue(java.lang.Object value)
public java.lang.String getISOFormat()
public static int getCentury(java.util.Date date)
public static java.lang.String getYear(int c,
java.lang.String yy)
public java.lang.String getJulianFormat()
public java.lang.String getOldValueAsString()
getOldValueAsString in class Fieldpublic java.lang.String getPossibleFormats()
public java.lang.Object getSQLObject()
throws CMException
getSQLObject in class FieldCMException
public java.lang.String getSQLValue(boolean useOriginalValue)
throws CMException
getSQLValue in class FielduseOriginalValue - 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.
CMExceptionpublic java.lang.String getValidValuesString()
getValidValuesString in class Fieldpublic java.lang.Object getValue()
getValue in interface INamedgetValue in class Fieldpublic boolean getValueAsBoolean()
getValueAsBoolean in class Fieldpublic java.lang.String getValueAsString()
getValueAsString in class Field
public static short guessFieldClassProbability(FieldDescriptorRow pFDRow,
RowCollection pSampleData)
public boolean isDate()
isDate in class Fieldpublic boolean isValidLength(ExecutingContext ec)
isValidLength in class Fieldec - The current executing context, which may be null
public boolean isValidValue(ExecutingContext ec)
isValidValue in class Fieldec - The executing context, which may be null
public boolean isValueEqual(java.lang.Object obj)
isValueEqual in class Fieldpublic boolean isValueGreaterThan(java.lang.Object obj)
isValueGreaterThan in class Fieldpublic boolean isValueLessThan(java.lang.Object obj)
isValueLessThan in class Field
public void setValue(long millis)
throws CMException
Field
setValue in class FieldCMException
public void setValue(java.lang.Object value)
throws CMException
setValue in class FieldCMException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||