planetj.database.field
Class StringOrNumberField

java.lang.Object
  extended byplanetj.database.Field
      extended byplanetj.database.field.StringOrNumberField
All Implemented Interfaces:
java.lang.Cloneable, IActionObject, ICSVField, IExternallyNamed, IFDFObject, IGuarded, INamed, IPDFField, IXMLObject, java.io.Serializable
Direct Known Subclasses:
CreditCardExpirationMonthField, CreditCardExpirationYearField, CreditCardNumberField, NumberField, PhoneNumberField, SocialSecurityNumberField, StringField, TrackingNumberField, ZipCodeField

public abstract class StringOrNumberField
extends Field
implements java.lang.Cloneable, java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class planetj.database.Field
Field.FieldLocation
 
Field Summary
 
Fields inherited from class planetj.database.Field
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_UNKNOWN
 
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
StringOrNumberField()
           
 
Method Summary
 java.lang.Object correctValue(java.lang.Object value)
          Correct the given value if needed so it is of the proper type when set on this Field.
 java.lang.Object createObject(java.lang.String pStringValue)
          Create an object for this Field type using the given String.
 java.lang.Object getCopiedValue()
          Gets an independent copy of this field's value.
 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 getSQLValue(boolean pUseOriginalValue)
          Returns the Field's name and value in SQL format.
 boolean isValueEqual(java.lang.Object obj)
          Return a boolean indicating if the passed in Object is equal to this Fields value.
 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(java.lang.Object pValue)
          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 planetj.database.Field
addFieldClassForDataClass, addPropertyChangeListener, appendSQLColumnDefinition, appendSQLNameAndValue, appendSQLNameAndValue, clearTable, clearValidationExceptions, clearValue, cloneFD, cloneField, commitValue, concat, correctSQLLiteral, create, create, createAction, createFromDataType, createInternal, divide, equals, executeGetterMethod, executeSetterMethod, firePropertyChange, getActionDefaultLocation, getActionDescriptor, getActionRequest, getActionRequest, getActions, getAssociationOperation, getAttribute, getAutoUpdateValue, getBackgroundColor, getBackgroundColor, getColumnSpan, getConfigProperty, getCSVDisplayField, getCSVField, getCurrentValue, getCurrentValueAsString, getDataSQLOperation, getDate, getDefaultExternalName, getDefaultUsageId, getDefaultValue, getDisplayComponent, getDisplayHeight, getDisplayLength, getDisplayOrder, getDisplayValue, getDisplayWidth, getExternalName, getExternalValidationKey, getFDFData, getFieldClassForDataClass, getFieldClassParameters, getFieldDescriptor, getFieldDescriptorSource, getFieldHandledActionNames, getFieldIncrementor, getFieldSetName, getFormatter, getHorizontalAlignment, getIndex, getLibrary, getLibraryName, getMaxLength, getMaxLength, getMetaDataSystemAlias, getName, getOldValue, getOldValueAsString, getPDFValue, getPossibleValueClass, getPossibleValues, getPossibleValues, getPossibleValuesKey, getPossibleValuesOperation, getPossibleValuesSQLOperation, getPreferredDisplayLength, getPreferredJavaDataType, getPVPage, getRow, getSearchDefaultValue, getSecuredTypeId, getSecuredTypeName, getSecurityType, getSQLColumnDefinition, getSQLColumnDefinition, getSQLNameAndDefaultValue, getSQLNameAndValue, getSQLNameAndValue, getSQLNullValue, getSQLObject, getSQLType, getSQLType, getSQLTypeName, getSQLTypeName, getSQLValue, getSQLValue, getStaticAttribute, getStaticAttributes, getStatusChange, getStyleClass, getStyleClass, getSystem, getSystemAlias, getSystemURL, getTable, getTableName, getUsageId, getUsageId, getUsageIds, getValidationExceptions, getValidationInvalidLengthString, getValidationInvalidMinLengthString, getValidationInvalidValueString, getValidationInvalidValueString, getValidationRequiredString, getValidValuesString, getValue, getValueAsBoolean, getValueAsByte, getValueAsDate, getValueAsDouble, getValueAsFloat, getValueAsFullLengthString, getValueAsInt, getValueAsLong, getValueAsNumber, getValueAsShort, getValueAsString, getXMLData, getXMLTag, guessFieldClassProbability, handleAction, handlePossibleValueOperation, hasAssociationOperation, hasMultipleStyleClasses, hasOldValue, hasPossibleValuesKeyClassOrOp, hasPossibleValuesOperation, hasPossibleValuesOperation, hasUsageId, hasUsageId, hasValue, incrementValue, isActionApplicable, isApplicable, isAuthorizedForEdit, isAuthorizedForRead, isAutoIncrement, isAutoIncrementDatabaseDriven, isAutoIncrementWOWDriven, isAutoUpdateValue, isBoolean, isChanged, isContainsValue, isCurrentValueField, isCurrentValueString, isDate, isDecimalSQLType, isDecimalSQLType, isDefaultValue, isDerived, isDisplayable, isFieldContentDisplayable, isFieldValueDatabaseDefault, isFieldValueNotBlank, isFieldValueNull, isFieldValuePossibleValue, isFieldValuesEqual, isFileUpload, isGuarded, isHelpTextPresent, isInitialized, isNumeric, isNumericSQLType, isNumericSQLType, isPassword, isPhysical, isPossibleValuesSearch, isPrepareFieldValue, isReadOnly, isReadOnly, isReadOnlyOnSearch, isRequired, isRequired, isRequiredOnSearch, isSkeleton, isStatusChange, isString, isStringSQLType, isStringSQLType, isTime, isTimestamp, isUpdateable, isValidationRequiredForAutoPopulate, isValidLength, isValidLength, isValidMinLength, isValidRequired, isValidRequired, isValidValue, isValidValue, isValueEqualToString, lessThan, removePropertyChangeListener, resetDisplayValue, rollbackChanges, setAttribute, setChanged, setClonedValues, setDate, setFieldContentDisplayable, setFieldDescriptor, setHasValue, setIndex, setInitialValue, setInitialValueAsString, setMaxLength, setName, setPVPage, setRow, setSavepoint, setSkeleton, setSQLType, setSQLTypeName, setStaticAttribute, setTable, setValue, setValue, setValueAsString, setValueToDefault, statusChanged, toString, toUpperCase, validate, validate, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringOrNumberField

public StringOrNumberField()
Method Detail

correctValue

public java.lang.Object correctValue(java.lang.Object value)
Description copied from class: Field
Correct the given value if needed so it is of the proper type when set on this Field.

Overrides:
correctValue in class Field
Parameters:
value - Object

createObject

public java.lang.Object createObject(java.lang.String pStringValue)
                              throws java.lang.NumberFormatException
Create an object for this Field type using the given String.

Specified by:
createObject in class Field
Parameters:
pStringValue - String
Throws:
java.lang.NumberFormatException

getCopiedValue

public java.lang.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.

Specified by:
getCopiedValue in class Field

getDefaultDatabaseValue

public 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.

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:42:30 PM)

Specified by:
getDefaultDatabaseValue in class Field

getSQLValue

public java.lang.String getSQLValue(boolean pUseOriginalValue)
                             throws CMException
Returns the Field's name and value in SQL format.

Specified by:
getSQLValue in class Field
Parameters:
pUseOriginalValue -
Returns:
String
Throws:
CMException

isValueEqual

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

Specified by:
isValueEqual in class Field

isValueGreaterThan

public boolean isValueGreaterThan(java.lang.Object obj)
Returns a boolean indicating if this field is greater than the supplied object. the Row the Field belongs to.

Specified by:
isValueGreaterThan in class Field
Returns:
boolean

isValueLessThan

public boolean isValueLessThan(java.lang.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.

Specified by:
isValueLessThan in class Field
Returns:
boolean

setValue

public void setValue(java.lang.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.

Overrides:
setValue in class Field
Throws:
CMException