planetj.database
Class Field

java.lang.Object
  |
  +--planetj.database.Field
All Implemented Interfaces:
Cloneable, ICSVField, IExternallyNamed, IFDFObject, IGuarded, INamed, IXMLObject, Serializable
Direct Known Subclasses:
BlobField, DateField, LogicalField, SQLOperationField, StringOrNumberField, TempField, TimestampField

public abstract class Field
extends Object
implements Cloneable, IGuarded, ICSVField, Serializable, IXMLObject, IFDFObject, IExternallyNamed

Represents a value in a database. A field is associated with a particular library, table, row, and column in the database. Every field has an associated FieldDescriptor which contains metadata about that Field (such as its name, type, length, etc).

All subclasses should have a default constructor.

See Also:
Serialized Form

Nested Class Summary
static class Field.FieldLocation
           
 
Field Summary
 
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
Field()
           
 
Method Summary
static void addFieldClassForDataClass(Class pDataClass, Class pFieldClass)
          Maps a data class to a field class, so that future invocations of the getFieldClassForDataClass() method with the data class as the argument will return the field class.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a listener which is informed when this field has its value changed.
static StringBuffer appendSQLColumnDefinition(FieldDescriptorRow pFieldDescriptor, DBSystem targetSystem, StringBuffer sb)
          This method should append all of the necessary information to create this field within a CREATE TABLE SQL statement.
 StringBuffer appendSQLNameAndValue(boolean pUseOriginalValue, StringBuffer sb)
          Appends the field's name and value in SQL format to the StringBuffer.
 StringBuffer appendSQLNameAndValue(boolean pUseOriginalValue, String pOperator, StringBuffer sb)
          Appends the field's name and value in SQL format to the StringBuffer.
 void clearValidationExceptions()
          Clears any validation exceptions that may have previously been set on this Field.
 Field cloneField()
          Returns a clone of the Field.
 void commitValue()
          Clears out all old values and save point values to commits current values.
 String concat(String[] parts)
          Concatenate the field values.
static Field create(String pName, Class pFieldType)
          Create and return a new Field
static Field create(String pName, int pSQLType)
          Create and return a new Field
static Field createFromDataType(String pName, Class pDataType)
          Create and return a new Field, based on the type of data the field should hold.
abstract  Object createObject(String pStringValue)
          Create an object for this Field type using the given String.
 Double divide(String[] fieldNames)
          Divide the two field values.
 boolean equals(Object otherField)
          Tests if another field is equal to this field.
 Object executeGetterMethod(String methodString)
           
 Object executeSetterMethod(String methodString, Object value)
           
 Operation getAssociationOperation()
          Gets the data Operation of this Field's FieldDescriptor.
 Object getAttribute(Object key)
          Get an attribute about the Field for the given key.
 Object getAutoUpdateValue(ExecutingContext executingContext)
          Get the field's auto update value as a String.
 int getColumnSpan(boolean isDetails)
          Get the number of columns this field should take up.
 Object getConfigProperty(String key, ExecutingContext executingContext)
          Get a config property for the given row.
abstract  Object getCopiedValue()
          Gets an independent copy of this field's value.
 String getCSVField()
          Returns the String value of the Object, that will be written to the CSV file.
 Object getCurrentValue(ExecutingContext ec)
          Returns a value that may be retrieved from a database, current time, calculation or other source that that is dynamic.
 String getCurrentValueAsString(ExecutingContext ec)
          Returns the value of this field as a String.
 Operation getDataSQLOperation()
          Deprecated. replaced with getAssociationOperation()
 Date getDate(String[] fields)
          Returns a Date that represents the Date of the 3 values passed in as a String[].
abstract  String getDefaultDatabaseValue()
          Subclass must override this method and return a default value to be placed in the database when this field is Non-nullable and not required.
static String getDefaultExternalName(String pClassName)
          Returns an the default external name to use, or null if none is specified.
static Integer getDefaultUsageId(String pClassName)
          Returns an the default usage id as an Integer or null Creation date: (6/26/2002 3:25:15 PM)
 Object getDefaultValue(ExecutingContext pContext)
          Get the field's default value as a String.
 int getDisplayHeight()
          Gets the Field's display height.
 int getDisplayLength()
          Deprecated. replaced with getDisplayWidth() to keep consistent with what a user sees when they view the field (e.g. width and height of a field)
 int getDisplayOrder()
          Returns the display order This information is stored in the FieldDescriptor Creation date: (6/5/2002 2:39:33 PM)
 String getDisplayValue()
          Returns the display value of this Field as a String
 int getDisplayWidth()
          Gets the Field's display width.
 String getExternalName()
           
 String getExternalValidationKey()
          Get the key that may be used to uniquely identify Field subclasses for external validation.
 StringBuffer getFDFData(StringBuffer pFDFData)
          This returns a StringBuffer containing all necessary FDF data for this object.
static Class getFieldClassForDataClass(Class pDataClass)
          Gets the type of Field that is registered to hold a type of data
 FieldDescriptorRow getFieldDescriptor()
          Returns the FieldDescriptorRow associated with this field.
 String getFieldDescriptorSource()
          Gets the field descriptor source location of this field.
 IFieldIncrementor getFieldIncrementor()
          By default, Fields will use the same incrementor for their values.
 int getIndex()
          Returns the index of this Field within the Row the Field belongs to.
 Library getLibrary()
          Returns the Library of the Table this Field belongs to.
 String getLibraryName()
          Returns the name of the library this Field's table belongs to.
 int getMaxLength()
          Returns the max length of this field.
 int getMaxLength(FileDescriptor fled)
          Returns the max length of this field.
 String getMetaDataSystemAlias()
          Gets the alias of the system this Field's Table's Library's DBSystem uses for retrieving its meta data.
 String getName()
           
 Object getOldValue()
          Returns the previous value the Field use to have.
 String getOldValueAsString()
          Returns the Field's old value as a String (or the field's current value as a String if it doesn't have an old value).
 RowCollection getPossibleValues()
          Returns a RowCollection containing the possible values for the Field.
 RowCollection getPossibleValues(Field fld)
          Returns a RowCollection containing the possible values for the Field.
 int getPreferredDisplayLength()
          Gets the column's preferred display size.
static Class getPreferredJavaDataType(int pSQLType)
          Gets the preferred Java class for the SQL type.
 Row getRow()
          Returns the Row this Field belongs to.
 int getSecuredTypeId()
          Gets the id of the secured type.
 String getSecuredTypeName()
          Gets the secured type name for this Field.
 int getSecurityType()
          Gets the security type of this Field.
 String getSQLColumnDefinition()
          This method should return all of the necessary information to create this field within a CREATE TABLE SQL statement.
static String getSQLColumnDefinition(FieldDescriptorRow pFieldDescriptor, DBSystem targetSystem)
          This method should return all of the necessary information to create this field within a CREATE TABLE SQL statement.
 String getSQLNameAndDefaultValue()
          Gets the Field's name and value in SQL format: "-NAME- = -VALUE-" where -NAME- is the name of this field and -VALUE- is this field's default value getDefaultDatabaseValue().
 String getSQLNameAndValue()
          Gets the Field's name and value in SQL format: "-NAME- = -VALUE-" where -NAME- is the name of this field and -VALUE- is this field's value.
 String getSQLNameAndValue(boolean pUseOriginalValue)
          Gets the Field's name and value in SQL format: "-NAME- = -VALUE-" where -NAME- is the name of this field and -VALUE- is this field's value.
 Object getSQLObject()
          Gets this field's value as an Object in SQL format.
 int getSQLType()
          Gets the SQL type of the described fields.
static int getSQLType(String sqlTypeName)
           
 String getSQLTypeName()
          getSQLTypeName method comment.
static String getSQLTypeName(int sqlType)
           
 String getSQLValue()
          Returns the Field's value in SQL format.
abstract  String getSQLValue(boolean pUseOriginalValue)
          Returns the Field's value in SQL format.
 String getSQLValue(boolean useOriginalValue, boolean includeQuotes)
          This method is a temporary solution to getting the field's value without appending single quote marks at the beginning and end of the field's value if it normally would have quotes.
 Object getStaticAttribute(Object key)
           
 String getStyleClass(ExecutingContext ec)
          Get a Field's style.
 String getStyleClass(String value, String displayValue, ExecutingContext ec)
          Get a Field's style.
 DBSystem getSystem()
          Returns the DBSystem this Fields Table belongs to (its Table gets its DBSystem from its Library).
 String getSystemAlias()
          Returns the system alias for the Field's Table.
 String getSystemURL()
          Returns the system url this Fields Table's DBSystem has (its Table gets the system url from the Library which gets it from the DBSystem).
 Table getTable()
          Returns the Table to which this Field belongs.
 String getTableName()
          Returns the name of the Table this Field belongs to.
 ValidationExceptionCollection getValidationExceptions()
          This is lazy inited so if you want to see if this field has any ValidationException, you must check the size() of this List Creation date: (4/5/2002 2:01:13 PM)
 String getValidationInvalidLengthString()
          This method will return the long description of why this field's length is invalid and possible actions or examples we could put in this field.
 String getValidationInvalidMinLengthString()
          This method will return the long description of why this field's minimum length is invalid and possible actions or examples we could put in this field.
 String getValidationInvalidValueString()
          This method will return the long description of why this field's value is invalid and possible actions or examples we could put in this field.
 String getValidationInvalidValueString(String givenValue)
          This method will return the long description of why this field's value is invalid and possible actions or examples we could put in this field.
 String getValidationRequiredString()
          This method will return the long description of why this field is required and possible actions or examples we could put in this field.
 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)
 Object getValue()
          Returns the Field's current value.
abstract  boolean getValueAsBoolean()
          Subclasses must override this to determine what their boolean value is.
 byte getValueAsByte()
          Returns a primitive that represents the value in the specified field.
 Date getValueAsDate()
          Returns a Date that represents the value in the specified field.
 double getValueAsDouble()
          Returns a primitive that represents the value in the specified field.
 float getValueAsFloat()
          Returns a primitive that represents the value in the specified field.
 String getValueAsFullLengthString()
          Returns the Field's value as a String.
 int getValueAsInt()
          Returns a primitive that represents the value in the specified field.
 long getValueAsLong()
          Returns a primitive that represents the value in the specified field.
 Number getValueAsNumber()
          Returns a Number that represents the value in the specified field.
 short getValueAsShort()
          Returns a primitive that represents the value in the specified field.
 String getValueAsString()
          Returns the Field's value as a String.
 StringBuffer getXMLData(StringBuffer pXMLData)
          This returns a StringBuffer containing all necessary XML data for this object.
 String getXMLTag()
          This returns a String representing the XML tag for this field Creation date: (1/21/2002 8:16:25 PM)
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.
 void handlePossibleValueOperation(ExecutingContext ec)
          Creation date: (4/23/2003 6:56:22 AM)
 boolean hasMultipleStyleClasses(ExecutingContext ec)
          Check if the given Field possibly has more than one style class.
 boolean hasOldValue()
          Returns wheter or not this Field has an old value.
 boolean hasPossibleValuesKeyClassOrOp()
          This method simply tells whether or not there is a value in the PV_LV_ID column.
 boolean hasPossibleValuesSQLOperation()
          Checks to see if the field has an associated PossibleValues Op Creation date: (4/28/2003 2:43:11 PM)
 boolean hasPossibleValuesSQLOperation(ExecutingContext ec)
          Checks to see if the field has an associated PossibleValues Op Creation date: (4/28/2003 2:43:11 PM)
 boolean hasValue()
          Returns wheter or not this Field's has a value.
 boolean isApplicable(ExecutingContext ec)
          Tests if this field is applicable base on the current executing context
 boolean isAuthorizedForEdit(ExecutingContext pEc)
          Tests if user can edit this field.
 boolean isAuthorizedForRead(ExecutingContext pEc)
          Tests if user can read this field.
 boolean isAutoUpdateValue()
          Returns whether or not this field's value is provided dynamically on update and therefore must have special consideration for updates.
 boolean isBoolean()
          Subclasses should override to change the value
 boolean isChanged()
          Returns wheter or not this Field's value has changed.
 boolean isContainsValue()
          Tests if this field has a value other than null or an empty string
 boolean isCurrentValueField()
          Returns whether or not this field's value is dynamic.
static boolean isCurrentValueString(String value)
          Return true is this string is the same as the ICurrentValueField.CURRENT_VALUE.
 boolean isDate()
          Subclasses should override to change the value
 boolean isDecimalSQLType()
          Returns true if the SQLType is a decimal according to Types
static boolean isDecimalSQLType(int pSQLType)
          Returns true if the SQL Type is a decimal according to Types Creation date: (6/20/2002 1:41:00 PM)
 boolean isDefaultValue()
          Returns whether or not this field's value is provided dynamically on insert and therefore must have special consideration for inserts.
 boolean isDerived()
          Returns whether or not this Field is a derived field.
 boolean isDisplayable(ExecutingContext ec)
          Check to see if this Field is displayable.
 boolean isFieldContentDisplayable()
          Tests if the contents of the field should be displayed
 boolean isFieldValueDatabaseDefault()
          Returns true if the value of this field is the same as we default this field to in the database.
 boolean isFieldValueNotBlank()
          Return a boolean indicating if the value is not blank.
 boolean isFieldValueNull()
          Return a boolean indicating if the value of this Field is Null
 boolean isFileUpload()
           
 boolean isGuarded()
          Check whether this Field is protected (secured)
 boolean isHelpTextPresent()
          Tests if this field has help text
 boolean isInitialized()
          Returns wheter or not this Field's initial value has been set.
 boolean isNumeric()
          Returns true if this class is a subclass of Number Creation date: (4/9/2002 2:33:50 PM)
 boolean isNumericSQLType()
          Returns true if the SQL type is a numeric value in Types
static boolean isNumericSQLType(int pSQLType)
          Returns true if the SQL Type is numeric according to Types Creation date: (6/20/2002 1:41:00 PM)
 boolean isPassword()
          Subclasses should override to change the value.
 boolean isPhysical()
          Tests if a field could be physically present in the database.
 boolean isPossibleValuesSearch()
          Insert the method's description here.
 boolean isReadOnly()
          Tests if this field can be updated
 boolean isReadOnly(ExecutingContext pContext)
          Tests whether or not this field is read only.
 boolean isRequired()
          Tests whether or not this field is required.
 boolean isRequired(ExecutingContext pContext)
          Tests whether or not this field is required.
 boolean isRequiredOnSearch(ExecutingContext ec)
          Tests whether or not this field is required.
 boolean isSkeleton()
          Tests if this field is a skeleton field.
 boolean isString()
          Subclasses should override to change the value
 boolean isStringSQLType()
          Returns true if the SQL Type is a character according to Types
static boolean isStringSQLType(int pSQLType)
          Returns true if the SQL Type is a character according to Types Creation date: (6/20/2002 1:41:00 PM)
 boolean isTime()
          Subclasses should override to change the value
 boolean isUpdateable()
          Tests if this field can be updated by the user.
 boolean isValidationRequiredForAutoPopulate(ExecutingContext pEC)
          Insert the method's description here.
 boolean isValidLength()
          Deprecated. (7/21/2003 11:45:58 AM) replaced with isValidLength(ExecutingContext)
 boolean isValidLength(ExecutingContext ec)
          Validate this Field based on its max length attribute.
 boolean isValidMinLength(ExecutingContext ec)
          Validate this Field based on its minLength attribute that is set as a FieldClass parameter.
 boolean isValidRequired()
          Deprecated. (7/21/2003 11:45:58 AM) replaced with isValidRequired(ExecutingContext)
 boolean isValidRequired(ExecutingContext ec)
          Validate this Field based on its required attribute.
 boolean isValidValue()
          Deprecated. (7/21/2003 11:45:58 AM) replaced with isValidValue(ExecutingContext)
 boolean isValidValue(ExecutingContext ec)
          Validate this Field value.
abstract  boolean isValueEqual(Object obj)
          Return a boolean indicating if the passed in Object is equal to this Fields value.
 boolean isValueEqualToString(String stringValue)
          Creates the proper Object for this Field from the given String and checks to see if it is equal to this Field's value.
abstract  boolean isValueGreaterThan(Object obj)
          Returns a boolean indicating if this field is greater than the supplied object.
abstract  boolean isValueLessThan(Object obj)
          Returns a boolean indicating if this field is less then the supplied object.
 boolean lessThan(Object obj)
          Deprecated. Use the isValueLessThan() method instead
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a property change listener that was added via the addPropertyChangeListener() method.
 Field rollbackChanges()
          Undo any changes that have been made to this Field since it was read from or written to the database.
 void setAttribute(Object key, Object value)
          Set the given attribute about this Field for the given key.
 void setChanged(boolean isChanged)
          Set whether or not this Field has changed.
 void setClonedValues(Object pValue, Object pOldValue)
          This method should only be called when cloning a Field.
 void setDate(String[] fields, Object value)
          Sets the values of three fields for the year, month, and day of a Date that resulted from a derived field.
 void setFieldContentDisplayable(boolean newFieldContentDisplayable)
          Insert the method's description here.
 void setFieldDescriptor(FieldDescriptorRow pFD)
          Sets the FieldDescriptorRow associated with this field.
 void setInitialValue(Object value)
          !!DA WK (7/14/2003 9:53:04 AM)
 void setInitialValueAsString(String value)
          Create an object for the Field's SQL type.
 void setMaxLength(int length)
          Sets the maximum length of this field's contents.
 void setName(String pName)
          Sets this Field's name.
 void setRow(Row pRow)
          Sets the Row this Field belongs to.
 void setSavepoint()
          Sets the current value as the save point for this Field.
 void setSQLType(int pSQLType)
          Sets the SQL type of the described fields.
 void setSQLTypeName(String pSQLTypeName)
          setSQLTypeName method comment.
 void setStaticAttribute(Object key, Object value)
           
 void setTable(Table pTable)
          Sets this Fields Table to which this Field belongs.
 void setValue(double pDouble)
          Sets the current value of the Field to the specified value, and also sets the old value to the previous value.
 void setValue(long pLong)
          Sets the current value of the Field to the specified value, and also sets the old value to the previous value.
 void setValue(Object pValue)
          Sets the current value of the Field to the specified value, and also sets the old value to the previous value.
 void setValueAsString(String pStringValue)
          Create an object for the Field's SQL type.
 void setValueToDefault(ExecutingContext ec)
          Sets the fields value back to the default value Creation date: Jun 24, 2004 - 3:14:48 PM
 String toString()
          Returns the String representation of this Field.
 String toUpperCase()
          This method will UPPERCASE this fields value if it is stored in the databse as a Char or it is a StringField.
 boolean validate(ExecutingContext ec)
          Validate this Field based on it's configuration and value.
 boolean validate(ExecutingContext ec, Principal pUser)
          Deprecated. by WK on (8/9/2003 9:30:03 AM) because the ExecutingContext contains the user. Replaced with validate(ExecutingContext). This method will no longer be supported as of WOW 7.0.
 boolean validate(int pOperation, Principal pUser)
          Deprecated. Use the validate() method which takes in an ExecutingContext
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Field

public Field()
Method Detail

addFieldClassForDataClass

public static void addFieldClassForDataClass(Class pDataClass,
                                             Class pFieldClass)
                                      throws CMException
Maps a data class to a field class, so that future invocations of the getFieldClassForDataClass() method with the data class as the argument will return the field class. The default data types (String, Timestamp, and numbers) are already mapped, so this method only needs to be invoked to add special subclasses of Field to the mapping.

This method is not thread safe; it should only be invoked during system intialization before Field and Row objects are being created

Parameters:
pDataClass - The type of data the specified type of field should hold
pFieldClass - The type of field that should hold the specified type of data. This must be a subclass of Field.
CMException

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener which is informed when this field has its value changed.


appendSQLColumnDefinition

public static StringBuffer appendSQLColumnDefinition(FieldDescriptorRow pFieldDescriptor,
                                                     DBSystem targetSystem,
                                                     StringBuffer sb)
                                              throws DataEngineException
This method should append all of the necessary information to create this field within a CREATE TABLE SQL statement. It should tell at least the field's type and length if necessary and optionally whether or not it is NULL capable or if it has a DEFAULT value

DataEngineException

appendSQLNameAndValue

public StringBuffer appendSQLNameAndValue(boolean pUseOriginalValue,
                                          String pOperator,
                                          StringBuffer sb)
                                   throws CMException
Appends the field's name and value in SQL format to the StringBuffer.

Parameters:
pUseOriginalValue -
Returns:
String
CMException

appendSQLNameAndValue

public StringBuffer appendSQLNameAndValue(boolean pUseOriginalValue,
                                          StringBuffer sb)
                                   throws CMException
Appends the field's name and value in SQL format to the StringBuffer.

Parameters:
pUseOriginalValue -
Returns:
String
CMException

clearValidationExceptions

public void clearValidationExceptions()
Clears any validation exceptions that may have previously been set on this Field.


cloneField

public Field cloneField()
                 throws CMException
Returns a clone of the Field.

CMException

commitValue

public void commitValue()
Clears out all old values and save point values to commits current values.


concat

public String concat(String[] parts)
              throws CMException
Concatenate the field values. The last value in the given String[] determines whether or not to trim values. The second to last value in the String[] denotes the separator to use between the values. And the rest of the beginning values in the String[] are the fields names to concatenate. See Row.concatenateFieldValues(String[], String, boolean) for more details.

Returns:
String
CMException

create

public static Field create(String pName,
                           int pSQLType)
                    throws CMException
Create and return a new Field

Parameters:
pName - The name of the field
pSQLType - The type of data the field will hold. This should be a value from the java.sql.Types class.
CMException

create

public static Field create(String pName,
                           Class pFieldType)
                    throws CMException
Create and return a new Field

Parameters:
pName - The name of the field
pFieldType - The type of field to create
CMException

createFromDataType

public static Field createFromDataType(String pName,
                                       Class pDataType)
                                throws CMException
Create and return a new Field, based on the type of data the field should hold. Fields created from this method are always skeleton fields.

Parameters:
pName - The name of the field
Returns:
A field which can hold the specified type of data, or null if the data type is not recognized
CMException

createObject

public abstract Object createObject(String pStringValue)
                             throws CMException
Create an object for this Field type using the given String.

Parameters:
pStringValue - String
CMException

divide

public Double divide(String[] fieldNames)
              throws CMException
Divide the two field values. See Row.divide(String, String) for more details.

Parameters:
fieldNames - names of two fields to divide
Returns:
String
CMException

equals

public boolean equals(Object otherField)
Tests if another field is equal to this field. Two fields are equal if and only if they have the same name and their values are equal.

Overrides:
equals in class Object

executeGetterMethod

public Object executeGetterMethod(String methodString)

executeSetterMethod

public Object executeSetterMethod(String methodString,
                                  Object value)

getAssociationOperation

public Operation getAssociationOperation()
                                  throws CMException
Gets the data Operation of this Field's FieldDescriptor. If one doesn't exists, null is returned..

CMException

getAttribute

public Object getAttribute(Object key)
Get an attribute about the Field for the given key.

Returns:
object identified by the given key.

getAutoUpdateValue

public Object getAutoUpdateValue(ExecutingContext executingContext)
                          throws CMException
Get the field's auto update value as a String.

CMException

getColumnSpan

public int getColumnSpan(boolean isDetails)
Get the number of columns this field should take up.

Parameters:
isDetails - whether or not its details or results table being generated

getConfigProperty

public final Object getConfigProperty(String key,
                                      ExecutingContext executingContext)
Get a config property for the given row.


getCopiedValue

public abstract Object getCopiedValue()
Gets an independent copy of this field's value. If the value is immutable, then this method can simply return the value. Otherwise, a clone of the value should be returned.


getCSVField

public String getCSVField()
Returns the String value of the Object, that will be written to the CSV file. If the toString method of any Object already does this, then there is no need to implement this interface.

In a CMException was thrown, or there were problems, then [Invalid Field] will be returned Creation date: (12/6/2001 2:31:28 AM)

Specified by:
getCSVField in interface ICSVField
Returns:
String

getCurrentValue

public Object getCurrentValue(ExecutingContext ec)
                       throws CMException
Returns a value that may be retrieved from a database, current time, calculation or other source that that is dynamic.

CMException

getCurrentValueAsString

public String getCurrentValueAsString(ExecutingContext ec)
                               throws CMException
Returns the value of this field as a String.

CMException

getDataSQLOperation

public Operation getDataSQLOperation()
                              throws CMException
Deprecated. replaced with getAssociationOperation()

Gets the data Operation of this Field's FieldDescriptor. If one doesn't exists, null is returned..

CMException

getDate

public Date getDate(String[] fields)
             throws DataEngineException
Returns a Date that represents the Date of the 3 values passed in as a String[]. The values should be in the order year, month, day.

Returns:
java.util.Date
DataEngineException

getDefaultDatabaseValue

public abstract String getDefaultDatabaseValue()
                                        throws CMException
Subclass must override this method and return a default value to be placed in the database when this field is Non-nullable and not required.

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:09:11 PM)

CMException

getDefaultExternalName

public static String getDefaultExternalName(String pClassName)
Returns an the default external name to use, or null if none is specified. Creation date: (7/23/2003 12:39:37 PM)


getDefaultUsageId

public static Integer getDefaultUsageId(String pClassName)
Returns an the default usage id as an Integer or null Creation date: (6/26/2002 3:25:15 PM)


getDefaultValue

public Object getDefaultValue(ExecutingContext pContext)
                       throws CMException
Get the field's default value as a String.

CMException

getDisplayHeight

public int getDisplayHeight()
                     throws CMException
Gets the Field's display height. This only controls the number of columns in the text field that will be displayed, or the size of the select. It does not restrict the amount of characters that can be entered for a Field's value. If no display height is specified then return -1.

Returns:
display height of this Field
CMException

getDisplayLength

public int getDisplayLength()
                     throws CMException
Deprecated. replaced with getDisplayWidth() to keep consistent with what a user sees when they view the field (e.g. width and height of a field)

Gets the column's display size. This only controls the number of columns in the text field that will be displayed. It does not restrict the amount of characters that can be entered. If no display size is specified then return -1. Creation date: (4/10/2003 6:47:34 PM)

CMException

getDisplayOrder

public int getDisplayOrder()
Returns the display order This information is stored in the FieldDescriptor Creation date: (6/5/2002 2:39:33 PM)


getDisplayValue

public String getDisplayValue()
                       throws CMException
Returns the display value of this Field as a String

Returns:
java.lang.String
CMException

getDisplayWidth

public int getDisplayWidth()
                    throws CMException
Gets the Field's display width. This only controls the number of columns in the text field that will be displayed. It does not restrict the amount of characters that can be entered for a Field's value. If no display size is specified then return -1.

Returns:
display width of this Field
CMException

getExternalName

public String getExternalName()
                       throws CMException
Specified by:
getExternalName in interface IExternallyNamed
CMException

getExternalValidationKey

public String getExternalValidationKey()
Get the key that may be used to uniquely identify Field subclasses for external validation. That is validation outside the Field itself. e.g. Javascript.


getFDFData

public StringBuffer getFDFData(StringBuffer pFDFData)
This returns a StringBuffer containing all necessary FDF data for this object. Creation date: (2/4/2002 4:13:39 PM)

Specified by:
getFDFData in interface IFDFObject

getFieldClassForDataClass

public static Class getFieldClassForDataClass(Class pDataClass)
Gets the type of Field that is registered to hold a type of data

Parameters:
pDataClass - The type of data the field should hold
Returns:
The appropriate subclass of Field which can hold data of the specified type. This may be null if the data type is not recognized

getFieldDescriptor

public FieldDescriptorRow getFieldDescriptor()
                                      throws CMException
Returns the FieldDescriptorRow associated with this field.

Returns:
FieldDescriptorRow
CMException

getFieldDescriptorSource

public String getFieldDescriptorSource()
Gets the field descriptor source location of this field. The source location is the alias of the connection, the library, the table, and the field name of the field descriptor for a field.

Returns:
concatination of connection alias, library name, table name, and field name.

getFieldIncrementor

public IFieldIncrementor getFieldIncrementor()
By default, Fields will use the same incrementor for their values. There are special cases where users might want to have a special incrementor. For example, Wabash wanted to have an auto increment field that tacked the year onto the number. So, for auto incremented #'s 100, 101, and 102, for the year 2003 they would want the incrementor to return 10003, 10103, and 10203. Creation date: (2/5/2003 11:48:30 AM)


getIndex

public int getIndex()
Returns the index of this Field within the Row the Field belongs to.

Returns:
int

getLibrary

public Library getLibrary()
Returns the Library of the Table this Field belongs to.

Returns:
Library

getLibraryName

public String getLibraryName()
Returns the name of the library this Field's table belongs to.

Returns:
String

getMaxLength

public int getMaxLength()
                 throws CMException
Returns the max length of this field. This information is stored in the FieldDescriptor, and ignores any heading information. This value can be overridden for individual fields with the setMaxLength() method Creation date: (1/24/2002 12:14:15 PM)

CMException

getMaxLength

public int getMaxLength(FileDescriptor fled)
                 throws CMException
Returns the max length of this field. This could either be the maximum length that the field's value can have, or possibly the length of the field's header (as defined by the FileDescriptor) if the header is longer that the max length of this field's value.

CMException

getMetaDataSystemAlias

public String getMetaDataSystemAlias()
Gets the alias of the system this Field's Table's Library's DBSystem uses for retrieving its meta data.

Returns:
String

getName

public String getName()
Specified by:
getName in interface INamed

getOldValue

public Object getOldValue()
Returns the previous value the Field use to have.

Returns:
Object

getOldValueAsString

public String getOldValueAsString()
Returns the Field's old value as a String (or the field's current value as a String if it doesn't have an old value).

Returns:
String

getPossibleValues

public RowCollection getPossibleValues()
                                throws CMException
Returns a RowCollection containing the possible values for the Field.

Returns:
RowCollection
CMException

getPossibleValues

public RowCollection getPossibleValues(Field fld)
                                throws CMException
Returns a RowCollection containing the possible values for the Field.

Parameters:
fld - Field
Returns:
RowCollection
CMException

getPreferredDisplayLength

public int getPreferredDisplayLength()
                              throws CMException
Gets the column's preferred display size. This only controls the number of columns in the text field that will be displayed. It does not restrict the amount of characters that can be entered. This value is derived by comparing display length, max length, column size. If no display length is specified then use the lesser of max length or column size. Creation date: (4/10/2003 6:47:34 PM)

CMException

getPreferredJavaDataType

public static Class getPreferredJavaDataType(int pSQLType)
                                      throws CMException
Gets the preferred Java class for the SQL type. It may be possible to translate the SQLType to other Java data types; this is just the preferred one.

CMException

getRow

public Row getRow()
Returns the Row this Field belongs to.

Returns:
Row

getSecuredTypeId

public int getSecuredTypeId()
Gets the id of the secured type.

Specified by:
getSecuredTypeId in interface IGuarded

getSecuredTypeName

public String getSecuredTypeName()
Gets the secured type name for this Field.

Specified by:
getSecuredTypeName in interface IGuarded

getSecurityType

public int getSecurityType()
Gets the security type of this Field.

Specified by:
getSecurityType in interface IGuarded
Returns:
security type

getSQLColumnDefinition

public String getSQLColumnDefinition()
                              throws CMException
This method should return all of the necessary information to create this field within a CREATE TABLE SQL statement. It should tell at least the field's type and length if necessary and optionally whether or not it is NULL capable, UNIQUE, or it is a PRIMARY KEY Creation date: (1/16/2002 2:24:10 PM)

Returns:
java.lang.String
CMException

getSQLColumnDefinition

public static String getSQLColumnDefinition(FieldDescriptorRow pFieldDescriptor,
                                            DBSystem targetSystem)
                                     throws DataEngineException
This method should return all of the necessary information to create this field within a CREATE TABLE SQL statement. It should tell at least the field's type and length if necessary and optionally whether or not it is NULL capable or if it has a DEFAULT value

DataEngineException

getSQLNameAndDefaultValue

public String getSQLNameAndDefaultValue()
                                 throws CMException
Gets the Field's name and value in SQL format: "-NAME- = -VALUE-" where -NAME- is the name of this field and -VALUE- is this field's default value getDefaultDatabaseValue(). The returned String is typically used to generate a WHERE clause for an SQL statement. Creation date: (4/9/2002 4:28:50 PM)

CMException

getSQLNameAndValue

public String getSQLNameAndValue()
                          throws CMException
Gets the Field's name and value in SQL format: "-NAME- = -VALUE-" where -NAME- is the name of this field and -VALUE- is this field's value. The returned String is typically used to generate a WHERE clause for an SQL statement.

CMException

getSQLNameAndValue

public String getSQLNameAndValue(boolean pUseOriginalValue)
                          throws CMException
Gets the Field's name and value in SQL format: "-NAME- = -VALUE-" where -NAME- is the name of this field and -VALUE- is this field's value. The returned String is typically used to generate a WHERE clause for an SQL statement.

Parameters:
pUseOriginalValue - 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

getSQLObject

public Object getSQLObject()
                    throws CMException
Gets this field's value as an Object in SQL format.

CMException

getSQLType

public int getSQLType()
               throws CMException
Gets the SQL type of the described fields. SQL types are defined in java.sql.Types

CMException

getSQLType

public static int getSQLType(String sqlTypeName)

getSQLTypeName

public String getSQLTypeName()
                      throws CMException
getSQLTypeName method comment.

CMException

getSQLTypeName

public static String getSQLTypeName(int sqlType)

getSQLValue

public String getSQLValue()
                   throws CMException
Returns the Field's value in SQL format. For example, if this field's value is the number 3 then the String "3" is returned. If this field's value is the String "Hello" then the String "'Hello'" is returned.

CMException

getSQLValue

public abstract String getSQLValue(boolean pUseOriginalValue)
                            throws CMException
Returns the Field's value in SQL format. For example, if this field's value is the number 3 then the String "3" is returned. If this field's value is the String "Hello" then the String "'Hello'" is returned.

Parameters:
pUseOriginalValue - 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

getSQLValue

public String getSQLValue(boolean useOriginalValue,
                          boolean includeQuotes)
                   throws CMException
This method is a temporary solution to getting the field's value without appending single quote marks at the beginning and end of the field's value if it normally would have quotes.

CMException

getStaticAttribute

public Object getStaticAttribute(Object key)

getStyleClass

public String getStyleClass(String value,
                            String displayValue,
                            ExecutingContext ec)
Get a Field's style. Field subclasses may override to special case handle custom styles for Fields.

Parameters:
ec - current context in which code is executing
Returns:
Field's style

getStyleClass

public String getStyleClass(ExecutingContext ec)
                     throws CMException
Get a Field's style. Field subclasses may override to special case handle custom styles for Fields.

Parameters:
ec - current context in which code is executing
Returns:
Field's style
CMException

getSystem

public DBSystem getSystem()
Returns the DBSystem this Fields Table belongs to (its Table gets its DBSystem from its Library).

Returns:
DBsystem

getSystemAlias

public String getSystemAlias()
Returns the system alias for the Field's Table.

Returns:
String

getSystemURL

public String getSystemURL()
Returns the system url this Fields Table's DBSystem has (its Table gets the system url from the Library which gets it from the DBSystem).

Returns:
String

getTable

public Table getTable()
Returns the Table to which this Field belongs.

Returns:
Table

getTableName

public String getTableName()
Returns the name of the Table this Field belongs to.

Returns:
String

getValidationExceptions

public ValidationExceptionCollection getValidationExceptions()
This is lazy inited so if you want to see if this field has any ValidationException, you must check the size() of this List Creation date: (4/5/2002 2:01:13 PM)

Returns:
planetj.exception.ValidationExceptionCollection

getValidationInvalidLengthString

public String getValidationInvalidLengthString()
                                        throws CMException
This method will return the long description of why this field's length is invalid and possible actions or examples we could put in this field. Subclasses can overrride this if can better describe thier requrements Creation date: (5/16/2002 4:53:27 PM)

CMException

getValidationInvalidMinLengthString

public String getValidationInvalidMinLengthString()
                                           throws CMException
This method will return the long description of why this field's minimum length is invalid and possible actions or examples we could put in this field. Subclasses can overrride this if can better describe thier requrements Creation date: (5/21/2004 10:56:53 AM)

CMException

getValidationInvalidValueString

public String getValidationInvalidValueString()
                                       throws CMException
This method will return the long description of why this field's value is invalid and possible actions or examples we could put in this field. Subclasses can overrride this if can better describe thier requrements Creation date: (5/16/2002 4:53:27 PM)

CMException

getValidationInvalidValueString

public String getValidationInvalidValueString(String givenValue)
                                       throws CMException
This method will return the long description of why this field's value is invalid and possible actions or examples we could put in this field. Subclasses can overrride this if can better describe thier requrements Creation date: (5/16/2002 4:53:27 PM)

CMException

getValidationRequiredString

public String getValidationRequiredString()
                                   throws CMException
This method will return the long description of why this field is required and possible actions or examples we could put in this field. Subclasses can overrride this if can better describe thier requrements Creation date: (5/16/2002 4:53:27 PM)

CMException

getValidValuesString

public String getValidValuesString()
                            throws CMException
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)

Returns:
java.lang.String
Throws:
CMException

getValue

public Object getValue()
Returns the Field's current value.

Specified by:
getValue in interface INamed
Returns:
Object

getValueAsBoolean

public abstract boolean getValueAsBoolean()
Subclasses must override this to determine what their boolean value is. Returns a primitive that represents the value in the specified field.

Returns:
boolean

getValueAsByte

public byte getValueAsByte()
Returns a primitive that represents the value in the specified field.

Returns:
byte

getValueAsDate

public Date getValueAsDate()
Returns a Date that represents the value in the specified field.

Returns:
java.util.Date

getValueAsDouble

public double getValueAsDouble()
Returns a primitive that represents the value in the specified field.

Returns:
double

getValueAsFloat

public float getValueAsFloat()
Returns a primitive that represents the value in the specified field.

Returns:
float

getValueAsFullLengthString

public String getValueAsFullLengthString()
                                  throws CMException
Returns the Field's value as a String. Space out using either spaces of 0's depending on the data type

Returns:
String
CMException

getValueAsInt

public int getValueAsInt()
Returns a primitive that represents the value in the specified field.

Returns:
int

getValueAsLong

public long getValueAsLong()
Returns a primitive that represents the value in the specified field.

Returns:
long

getValueAsNumber

public Number getValueAsNumber()
Returns a Number that represents the value in the specified field.

Returns:
Number

getValueAsShort

public short getValueAsShort()
Returns a primitive that represents the value in the specified field.

Returns:
short

getValueAsString

public String getValueAsString()
Returns the Field's value as a String.

Returns:
String

getXMLData

public StringBuffer getXMLData(StringBuffer pXMLData)
This returns a StringBuffer containing all necessary XML data for this object. Creation date: (1/21/2002 8:16:25 PM)

Specified by:
getXMLData in interface IXMLObject

getXMLTag

public String getXMLTag()
This returns a String representing the XML tag for this field Creation date: (1/21/2002 8:16:25 PM)


guessFieldClassProbability

public 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. Each subclass will examin fields such as : {DECIMAL_DIGITS, COLUMN_NAME, COLUMN_SIZE, REMARKS, DATA_TYPE, TYPE_NAME} Each subclass will detirmine the probability that it should be the field class for this FD Row. -1 will be returned if there is no chance (0%)this field is the fieldClass for pFDRow. 100 or greater will be returned if this is absolutely 100% the field class for pFDRow Creation date: (6/19/2002 2:55:49 PM)


handlePossibleValueOperation

public void handlePossibleValueOperation(ExecutingContext ec)
                                  throws CMException
Creation date: (4/23/2003 6:56:22 AM)

Parameters:
ec - planetj.dataengine.ExecutingContext
CMException

hasMultipleStyleClasses

public boolean hasMultipleStyleClasses(ExecutingContext ec)
Check if the given Field possibly has more than one style class.

Parameters:
ec - current context in which code is executing
Returns:
Field's style

hasOldValue

public boolean hasOldValue()
Returns wheter or not this Field has an old value.

Returns:
boolean

hasPossibleValuesKeyClassOrOp

public boolean hasPossibleValuesKeyClassOrOp()
This method simply tells whether or not there is a value in the PV_LV_ID column. However, this column is used both for PossibleValues and for PossibleValuesSearch, so this method does not tell whether or not it is a valid PossibleValuesSearch operation. In order to tell this, you must check isPossibleValuesSearch This method allows for a quick PV check instead of a db hit to retrieve the PV - call another method if not null and then have to retrieve the PV values again. Used in HTMLField.appendInput() Creation date: (4/28/2003 2:43:11 PM)

Returns:
boolean

hasPossibleValuesSQLOperation

public boolean hasPossibleValuesSQLOperation()
Checks to see if the field has an associated PossibleValues Op Creation date: (4/28/2003 2:43:11 PM)

Returns:
boolean

hasPossibleValuesSQLOperation

public boolean hasPossibleValuesSQLOperation(ExecutingContext ec)
Checks to see if the field has an associated PossibleValues Op Creation date: (4/28/2003 2:43:11 PM)

Returns:
boolean

hasValue

public boolean hasValue()
Returns wheter or not this Field's has a value.

Returns:
boolean

isApplicable

public boolean isApplicable(ExecutingContext ec)
                     throws CMException
Tests if this field is applicable base on the current executing context

CMException

isAuthorizedForEdit

public boolean isAuthorizedForEdit(ExecutingContext pEc)
                            throws CMException
Tests if user can edit this field. This method should ask its row

CMException

isAuthorizedForRead

public boolean isAuthorizedForRead(ExecutingContext pEc)
                            throws CMException
Tests if user can read this field. This method should ask its row

CMException

isAutoUpdateValue

public boolean isAutoUpdateValue()
Returns whether or not this field's value is provided dynamically on update and therefore must have special consideration for updates. For instance, a field that always has the CURRENT TIMESTAMP for its value would get this value from the database. When we go to update, this field will be updated every time that the row is updated, however it will not cause an update in and of itself.

Returns:
boolean

isBoolean

public boolean isBoolean()
Subclasses should override to change the value

Returns:
boolean

isChanged

public boolean isChanged()
Returns wheter or not this Field's value has changed.

Returns:
boolean

isContainsValue

public boolean isContainsValue()
Tests if this field has a value other than null or an empty string


isCurrentValueField

public boolean isCurrentValueField()
Returns whether or not this field's value is dynamic.

Returns:
boolean

isCurrentValueString

public static boolean isCurrentValueString(String value)
Return true is this string is the same as the ICurrentValueField.CURRENT_VALUE.


isDate

public boolean isDate()
Subclasses should override to change the value

Returns:
boolean

isDecimalSQLType

public final boolean isDecimalSQLType()
Returns true if the SQLType is a decimal according to Types

Returns:
boolean

isDecimalSQLType

public static final boolean isDecimalSQLType(int pSQLType)
Returns true if the SQL Type is a decimal according to Types Creation date: (6/20/2002 1:41:00 PM)


isDefaultValue

public boolean isDefaultValue()
Returns whether or not this field's value is provided dynamically on insert and therefore must have special consideration for inserts. For instance, a field that always has the CURRENT TIMESTAMP for its value would get this value from the database. When we go to insert, this field will be updated every time that the row is inserted.

Returns:
boolean

isDerived

public boolean isDerived()
                  throws CMException
Returns whether or not this Field is a derived field.

Returns:
boolean
CMException

isDisplayable

public boolean isDisplayable(ExecutingContext ec)
                      throws CMException
Check to see if this Field is displayable.

Parameters:
ec - context in which code is running.
Returns:
true if Field is displayable
CMException

isFieldContentDisplayable

public boolean isFieldContentDisplayable()
Tests if the contents of the field should be displayed


isFieldValueDatabaseDefault

public boolean isFieldValueDatabaseDefault()
                                    throws CMException
Returns true if the value of this field is the same as we default this field to in the database. Example Database Defaults: StringField="" NumberField=0 ="NULL" Creation date: (4/24/2002 7:12:57 PM)

CMException

isFieldValueNotBlank

public boolean isFieldValueNotBlank()
Return a boolean indicating if the value is not blank. Not Blank is defined as: Strings: not null & not empty spaces, Numbers: Not Null


isFieldValueNull

public boolean isFieldValueNull()
Return a boolean indicating if the value of this Field is Null


isFileUpload

public boolean isFileUpload()
Returns:
boolean

isGuarded

public boolean isGuarded()
Check whether this Field is protected (secured)

Specified by:
isGuarded in interface IGuarded
Returns:
boolean

isHelpTextPresent

public boolean isHelpTextPresent()
Tests if this field has help text


isInitialized

public boolean isInitialized()
Returns wheter or not this Field's initial value has been set.

Returns:
boolean

isNumeric

public boolean isNumeric()
Returns true if this class is a subclass of Number Creation date: (4/9/2002 2:33:50 PM)


isNumericSQLType

public final boolean isNumericSQLType()
Returns true if the SQL type is a numeric value in Types

Returns:
boolean

isNumericSQLType

public static final boolean isNumericSQLType(int pSQLType)
Returns true if the SQL Type is numeric according to Types Creation date: (6/20/2002 1:41:00 PM)


isPassword

public boolean isPassword()
Subclasses should override to change the value. If a Field's usage id is set to a password field it is also a password field.

Returns:
boolean

isPhysical

public boolean isPhysical()
                   throws CMException
Tests if a field could be physically present in the database. (This does not test whether the data in this field actually is in the database, only if it could be stored in the database.)

CMException

isPossibleValuesSearch

public boolean isPossibleValuesSearch()
                               throws CMException
Insert the method's description here. Creation date: (1/15/2003 11:41:34 AM)

Returns:
boolean
CMException

isReadOnly

public boolean isReadOnly()
                   throws CMException
Tests if this field can be updated

CMException

isReadOnly

public boolean isReadOnly(ExecutingContext pContext)
Tests whether or not this field is read only. The default behavior is to ask the Row, which by default uses the FD to determine if this field is read only. Subclasses of Field or Row may change this default behavior.

Parameters:
pContext - The current executing context, which may be null

isRequired

public boolean isRequired()
Tests whether or not this field is required. The default behavior is to ask the Row, which by default uses the FD to determine if this field is required or not. Subclasses of Field or Row may change this default behavior.

Returns:
boolean

isRequired

public boolean isRequired(ExecutingContext pContext)
Tests whether or not this field is required. The default behavior is to ask the Row, which by default uses the FD to determine if this field is required or not. Subclasses of Field or Row may change this default behavior

Parameters:
pContext - The current executing context, which may be null

isRequiredOnSearch

public boolean isRequiredOnSearch(ExecutingContext ec)
Tests whether or not this field is required. The default behavior is to ask the Row, which by default uses the FD to determine if this field is required or not. Subclasses of Field or Row may change this default behavior

Parameters:
ec - The current executing context, which may be null

isSkeleton

public boolean isSkeleton()
Tests if this field is a skeleton field. A skeleton field is a field which does not have field descriptors, and whose type might not be what you expect. A skeleton field will be able to write its value to the database, but may not support other functionality that fields usually do. Typically, skeleton fields are created when the Row.setFieldValue() method is inovked, and no field with the specified name exists.


isString

public boolean isString()
Subclasses should override to change the value

Returns:
boolean

isStringSQLType

public final boolean isStringSQLType()
Returns true if the SQL Type is a character according to Types

Returns:
boolean

isStringSQLType

public static final boolean isStringSQLType(int pSQLType)
Returns true if the SQL Type is a character according to Types Creation date: (6/20/2002 1:41:00 PM)


isTime

public boolean isTime()
Subclasses should override to change the value

Returns:
boolean

isUpdateable

public boolean isUpdateable()
Tests if this field can be updated by the user. Some types of fields may not be updateable; for those types this method should be overridden to return false.


isValidationRequiredForAutoPopulate

public boolean isValidationRequiredForAutoPopulate(ExecutingContext pEC)
Insert the method's description here. Creation date: (11/25/2003 9:54:07 AM)

Parameters:
pEC - planetj.dataengine.ExecutingContext
Returns:
boolean

isValidLength

public final boolean isValidLength()
Deprecated. (7/21/2003 11:45:58 AM) replaced with isValidLength(ExecutingContext)

Validate this Field based on its max length attribute. If the value is is too big, the return false

Returns:
boolean true if valid

isValidLength

public boolean isValidLength(ExecutingContext ec)
Validate this Field based on its max length attribute. If the value is is too big, the return false

Parameters:
ec - The current executing context, which may be null
Returns:
boolean true if valid

isValidMinLength

public boolean isValidMinLength(ExecutingContext ec)
                         throws CMException
Validate this Field based on its minLength attribute that is set as a FieldClass parameter. Ex: planetj.database.field.PasswordField,minLength=7 If the value is is too small, the return false

Parameters:
ec - The current executing context, which may be null
Returns:
boolean true if valid
Throws:
CMException - if FieldDescriptor cannot be obtained

isValidRequired

public final boolean isValidRequired()
Deprecated. (7/21/2003 11:45:58 AM) replaced with isValidRequired(ExecutingContext)

Validate this Field based on its required attribute. If the value is null and the field is required, then return false

Returns:
boolean true if valid

isValidRequired

public boolean isValidRequired(ExecutingContext ec)
Validate this Field based on its required attribute. If the value is null and the field is required, then return false

Parameters:
ec - The current executing context, which may be null
Returns:
boolean true if valid

isValidValue

public final boolean isValidValue()
                           throws CMException
Deprecated. (7/21/2003 11:45:58 AM) replaced with isValidValue(ExecutingContext)

Validate this Field value. Subclasses should override and validate according to their field types. If the field value is valid, return true,

Returns:
boolean true if valid
CMException

isValidValue

public boolean isValidValue(ExecutingContext ec)
                     throws CMException
Validate this Field value. Subclasses should override and validate according to their field types. If the field value is valid, return true,

Parameters:
ec - The executing context, which may be null
Returns:
boolean true if valid
CMException

isValueEqual

public abstract boolean isValueEqual(Object obj)
Return a boolean indicating if the passed in Object is equal to this Fields value.


isValueEqualToString

public boolean isValueEqualToString(String stringValue)
                             throws CMException
Creates the proper Object for this Field from the given String and checks to see if it is equal to this Field's value.

CMException

isValueGreaterThan

public abstract boolean isValueGreaterThan(Object obj)
Returns a boolean indicating if this field is greater than the supplied object. the Row the Field belongs to. Subclasses should override and implement as appropriate.

Returns:
boolean

isValueLessThan

public abstract boolean isValueLessThan(Object obj)
Returns a boolean indicating if this field is less then the supplied object. the Row the Field belongs to. Subclasses should override and return the appropriate response.

Returns:
boolean

lessThan

public boolean lessThan(Object obj)
Deprecated. Use the isValueLessThan() method instead

Returns a boolean indicating if this field is less then the supplied object. the Row the Field belongs to.

Returns:
boolean

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener that was added via the addPropertyChangeListener() method.


rollbackChanges

public Field rollbackChanges()
                      throws CMException
Undo any changes that have been made to this Field since it was read from or written to the database. This method will not undo any changes that have been saved to the database.

Returns:
This field is returned
CMException

setAttribute

public void setAttribute(Object key,
                         Object value)
Set the given attribute about this Field for the given key.

Parameters:
key - used to identify the object in the Map.
value - Object to be stored as an attribute.

setChanged

public void setChanged(boolean isChanged)
Set whether or not this Field has changed.

Returns:
boolean

setClonedValues

public void setClonedValues(Object pValue,
                            Object pOldValue)
This method should only be called when cloning a Field. It allows for the proper setting of both old and current values without changing other properties of the cloned Field.


setDate

public void setDate(String[] fields,
                    Object value)
             throws CMException
Sets the values of three fields for the year, month, and day of a Date that resulted from a derived field. The values should be in the order year, month, day.

Parameters:
value - Object
CMException

setFieldContentDisplayable

public void setFieldContentDisplayable(boolean newFieldContentDisplayable)
Insert the method's description here. Creation date: (8/22/2002 6:02:26 PM)

Parameters:
newFieldContentDisplayable - boolean

setFieldDescriptor

public void setFieldDescriptor(FieldDescriptorRow pFD)
                        throws CMException
Sets the FieldDescriptorRow associated with this field.

Parameters:
pFD - FieldDescriptorRow
CMException

setInitialValue

public void setInitialValue(Object value)
                     throws CMException
!!DA WK (7/14/2003 9:53:04 AM)

CMException

setInitialValueAsString

public void setInitialValueAsString(String value)
                             throws CMException
Create an object for the Field's SQL type. Then set that object to the Field's value. (Note: Field subclasses define the object type to create.

CMException

setMaxLength

public void setMaxLength(int length)
Sets the maximum length of this field's contents. Normally this information is stored in the field descriptor, but it can be overridden for an individual field with this method. A negative value means that the field descriptor should be checked for the maximum length


setName

public void setName(String pName)
Sets this Field's name.

Parameters:
pName - String

setRow

public void setRow(Row pRow)
            throws DataEngineException
Sets the Row this Field belongs to.

DataEngineException

setSavepoint

public void setSavepoint()
Sets the current value as the save point for this Field. If a rollback is done, then the save points value will be set as the Field's value.


setSQLType

public void setSQLType(int pSQLType)
                throws CMException
Sets the SQL type of the described fields. SQL types are defined in java.sql.Types

CMException

setSQLTypeName

public void setSQLTypeName(String pSQLTypeName)
                    throws CMException
setSQLTypeName method comment.

CMException

setStaticAttribute

public void setStaticAttribute(Object key,
                               Object value)

setTable

public void setTable(Table pTable)
Sets this Fields Table to which this Field belongs.

Parameters:
pTable - Table

setValue

public void setValue(double pDouble)
              throws CMException
Sets the current value of the Field to the specified value, and also sets the old value to the previous value. NOTE: This method will take float types also. If called and the Field is not updatable a CMException is thrown.

CMException

setValue

public void setValue(long pLong)
              throws CMException
Sets the current value of the Field to the specified value, and also sets the old value to the previous value. NOTE: This method will take int types also. If called and the Field is not updatable a CMException is thrown.

CMException

setValue

public void setValue(Object pValue)
              throws CMException
Sets the current value of the Field to the specified value, and also sets the old value to the previous value. If called and the Field is not updatable a CMException is thrown.

CMException

setValueAsString

public void setValueAsString(String pStringValue)
                      throws CMException
Create an object for the Field's SQL type. Then set that object to the Field's value. (Note: Field subclasses define the object type to create.

Parameters:
pStringValue - String
CMException

toString

public String toString()
Returns the String representation of this Field.

Overrides:
toString in class Object
Returns:
String

toUpperCase

public String toUpperCase()
                   throws CMException
This method will UPPERCASE this fields value if it is stored in the databse as a Char or it is a StringField. Dates must be UPPERCASED incase the date format in the DB contains acutal month or day or timezone info Example: Tue May 14 12:23:53 PDT 2002 Times must be UPPERCASED incase the date format in the DB contains acutal month or day or timezone info Example: 14 May 2002 19:26:13 GMT Creation date: (5/14/2002 12:14:39 PM)

CMException

validate

public boolean validate(int pOperation,
                        Principal pUser)
                 throws CMException
Deprecated. Use the validate() method which takes in an ExecutingContext

Validate this Field based on its configuration and field value. If the field value is valid, return true, if not return an exception that encapsulates the error.

CMException

setValueToDefault

public void setValueToDefault(ExecutingContext ec)
                       throws CMException
Sets the fields value back to the default value Creation date: Jun 24, 2004 - 3:14:48 PM

CMException

validate

public boolean validate(ExecutingContext ec)
                 throws CMException
Validate this Field based on it's configuration and value.

Parameters:
ec - current context in which application is executing
Returns:
true, if Field is valid; false otherwise
CMException

validate

public boolean validate(ExecutingContext ec,
                        Principal pUser)
                 throws CMException
Deprecated. by WK on (8/9/2003 9:30:03 AM) because the ExecutingContext contains the user. Replaced with validate(ExecutingContext). This method will no longer be supported as of WOW 7.0.

Validate this Field based on its configuration and field value. If the field value is valid, return true, if not return an exception that encapsulates the error.

CMException