planetj.database.field
Class AbstractBooleanField

java.lang.Object
  |
  +--planetj.database.Field
        |
        +--planetj.database.field.StringOrNumberField
              |
              +--planetj.database.field.StringField
                    |
                    +--planetj.database.field.AbstractBooleanField
All Implemented Interfaces:
Cloneable, IBooleanField, ICSVField, IExternallyNamed, IFDFObject, IGuarded, INamed, IXMLObject, Serializable
Direct Known Subclasses:
TFBooleanField, YBlankBooleanField, YNBooleanField

public abstract class AbstractBooleanField
extends StringField
implements IBooleanField

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class planetj.database.Field
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
AbstractBooleanField()
           
 
Method Summary
abstract  String getFalseValue()
          Subclasses need to return the value which represents the Field's 'false' value.
abstract  String getTrueValue()
          Subclasses need to return the value which represents the Field's 'true' value.
 boolean isBoolean()
          Return true to denote this is a boolean.
 boolean isChecked()
          Returns whether or not the Field is checked.
static boolean isValueTrue(Object value)
          Checks if the given value could be true.
 void setValue(boolean newVal)
          Sets the value of the field based on a primitive boolean value.
 void setValue(Object newVal)
          Overrides the setValue method so that if null is passed for the new value, we use the value of "N" since this is a YN (Y or N) boolean field.
 void switchValue()
          Switches the boolean field's value.
 
Methods inherited from class planetj.database.field.StringField
createObject, getCSVField, getExternalValidationKey, getValueAsBoolean, isNumber, isString, isValidLength
 
Methods inherited from class planetj.database.field.StringOrNumberField
getCopiedValue, getDefaultDatabaseValue, getSQLValue, isValueEqual, isValueGreaterThan, isValueLessThan
 
Methods inherited from class planetj.database.Field
addFieldClassForDataClass, addPropertyChangeListener, appendSQLColumnDefinition, appendSQLNameAndValue, appendSQLNameAndValue, clearValidationExceptions, cloneField, commitValue, concat, create, create, createFromDataType, divide, equals, executeGetterMethod, executeSetterMethod, getAssociationOperation, getAttribute, getAutoUpdateValue, getColumnSpan, getConfigProperty, getCurrentValue, getCurrentValueAsString, getDataSQLOperation, getDate, getDefaultExternalName, getDefaultUsageId, getDefaultValue, getDisplayHeight, getDisplayLength, getDisplayOrder, getDisplayValue, getDisplayWidth, getExternalName, getFDFData, getFieldClassForDataClass, getFieldDescriptor, getFieldDescriptorSource, getFieldIncrementor, getIndex, getLibrary, getLibraryName, getMaxLength, getMaxLength, getMetaDataSystemAlias, getName, getOldValue, getOldValueAsString, getPossibleValues, getPossibleValues, getPreferredDisplayLength, getPreferredJavaDataType, getRow, getSecuredTypeId, getSecuredTypeName, getSecurityType, getSQLColumnDefinition, getSQLColumnDefinition, getSQLNameAndDefaultValue, getSQLNameAndValue, getSQLNameAndValue, getSQLObject, getSQLType, getSQLType, getSQLTypeName, getSQLTypeName, getSQLValue, getSQLValue, getStaticAttribute, getStyleClass, getStyleClass, getSystem, getSystemAlias, getSystemURL, getTable, getTableName, getValidationExceptions, getValidationInvalidLengthString, getValidationInvalidMinLengthString, getValidationInvalidValueString, getValidationInvalidValueString, getValidationRequiredString, getValidValuesString, getValue, getValueAsByte, getValueAsDate, getValueAsDouble, getValueAsFloat, getValueAsFullLengthString, getValueAsInt, getValueAsLong, getValueAsNumber, getValueAsShort, getValueAsString, getXMLData, getXMLTag, guessFieldClassProbability, handlePossibleValueOperation, hasMultipleStyleClasses, hasOldValue, hasPossibleValuesKeyClassOrOp, hasPossibleValuesSQLOperation, hasPossibleValuesSQLOperation, hasValue, isApplicable, isAuthorizedForEdit, isAuthorizedForRead, isAutoUpdateValue, isChanged, isContainsValue, isCurrentValueField, isCurrentValueString, isDate, isDecimalSQLType, isDecimalSQLType, isDefaultValue, isDerived, isDisplayable, isFieldContentDisplayable, isFieldValueDatabaseDefault, isFieldValueNotBlank, isFieldValueNull, isFileUpload, isGuarded, isHelpTextPresent, isInitialized, isNumeric, isNumericSQLType, isNumericSQLType, isPassword, isPhysical, isPossibleValuesSearch, isReadOnly, isReadOnly, isRequired, isRequired, isRequiredOnSearch, isSkeleton, isStringSQLType, isStringSQLType, isTime, isUpdateable, isValidationRequiredForAutoPopulate, isValidLength, isValidMinLength, isValidRequired, isValidRequired, isValidValue, isValidValue, isValueEqualToString, lessThan, removePropertyChangeListener, rollbackChanges, setAttribute, setChanged, setClonedValues, setDate, setFieldContentDisplayable, setFieldDescriptor, setInitialValue, setInitialValueAsString, setMaxLength, setName, setRow, setSavepoint, setSQLType, setSQLTypeName, setStaticAttribute, setTable, setValue, setValue, setValueAsString, setValueToDefault, toString, toUpperCase, validate, validate, validate
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractBooleanField

public AbstractBooleanField()
Method Detail

getFalseValue

public abstract String getFalseValue()
Subclasses need to return the value which represents the Field's 'false' value. For example, the subclass TFBooleanField's false value is 'F'.

Specified by:
getFalseValue in interface IBooleanField
Returns:
false value for Field

getTrueValue

public abstract String getTrueValue()
Subclasses need to return the value which represents the Field's 'true' value. For example, the subclass TFBooleanField's false value is 'T'.

Specified by:
getTrueValue in interface IBooleanField
Returns:
true value for Field

isBoolean

public boolean isBoolean()
Return true to denote this is a boolean.

Overrides:
isBoolean in class Field
Returns:
boolean

isChecked

public boolean isChecked()
Returns whether or not the Field is checked.

Specified by:
isChecked in interface IBooleanField
Returns:
boolean

isValueTrue

public static boolean isValueTrue(Object value)
                           throws CMException
Checks if the given value could be true. The given value is true if it is equal to one of the following. "TRUE", "T", "1", "ON", "Y", or "YES"

CMException

setValue

public void setValue(Object newVal)
              throws CMException
Overrides the setValue method so that if null is passed for the new value, we use the value of "N" since this is a YN (Y or N) boolean field.

Overrides:
setValue in class StringField
Parameters:
newVal - Object
CMException

setValue

public void setValue(boolean newVal)
Sets the value of the field based on a primitive boolean value. If the new value is true, then the value for the field is "Y". If the new value is false, then the value for the field is "N".

Specified by:
setValue in interface IBooleanField
Parameters:
newVal - boolean

switchValue

public void switchValue()
Switches the boolean field's value. If its currently set to true, then the new value will be false. If its set to false, then the new value will be true.

Specified by:
switchValue in interface IBooleanField