|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.dbobj.DBField
A DBField object represents a single field definition in a DBObjectDef. It does not store any actual data, only the meta-data associated with a field.
| Field Summary | |
static Set |
allDataTypes
Contains a list of all recognized expresso data types. |
protected boolean |
allowNull
Is a null value allowed for this field. |
static String |
ARRAY_TYPE
|
static String |
ATTRIBUTE_ERROR
Attribute String for if there's an error with the field. |
static String |
ATTRIBUTE_ERROR_MESSAGE
Attribute String for what message to display if there's an error with thie field. |
protected Hashtable |
attributes
User Defined Attributes for each field. |
static String |
AUTOINC_TYPE
AUTOINC_TYPE is a special expresso type code for auto-increment field, a synonym for integer. |
static String |
BIGINT_TYPE
|
static String |
BINARY_TYPE
|
static String |
BIT_TYPE
|
static String |
BLOB_TYPE
|
static String |
BOOLEAN_MASK
Boolean regular expression syntax for easy reference. |
static String |
BOOLEAN_TYPE
boolean is synonym for bit |
static String |
CHAR_TYPE
|
static String |
CLOB_TYPE
|
static String |
DATE_MASK
Date regular expression syntax for easy reference. |
static String |
DATE_TYPE
|
static String |
DATETIME_TYPE
datetime is a synonym for timestamp |
static String |
DECIMAL_TYPE
|
protected String |
description
The user friendly description of this field. |
static String |
DOUBLE_TYPE
|
protected boolean |
encrypted
Set this value to true if you want a particular string field encrypted (Not implemented yet) |
protected String |
expressoFieldTypeString
The string "type" used to specify this type of field in Expresso |
protected String |
fieldName
|
protected int |
fieldSize
The size of this field. |
protected String |
filterMethod
What is the string filtering method applied with this filter |
static String |
FLOAT_MASK
Floating point regular expression syntax for easy reference. |
static String |
FLOAT_TYPE
|
protected boolean |
hashed
Set this value to true if you want a particular string field hashed instead of stored in plaintext. |
static String |
INT_MASK
Integer Regular Expression for easy reference |
static String |
INT_TYPE
int is synonym for integer |
static String |
INTEGER_TYPE
|
protected boolean |
isCharacterLongObject
Is this object a CLOB? |
protected boolean |
isFloatingPointType
|
protected boolean |
isKey
Is this a key field? |
protected boolean |
isLongObject
Is this object a LOB? |
protected boolean |
isMultiValued
Is this a multivalued field |
protected boolean |
isReadOnly
Is this field readonly? |
protected boolean |
isSecret
Does this field not appear in standard DBMaint listings? |
protected boolean |
isVirtual
Is this a virtual field: Ie, does the system provide all values for this field. |
static String |
JAVA_OBJECT
|
static String |
LONG_TYPE
long is a synonym for BIGINT |
static String |
LONGVARBINARY
|
static String |
LONGVARCHAR_TYPE
|
protected String |
lookupDefinition
Optional parameter that defines the definition of the lookup object if the lookup object implements the Defineable interface. |
protected String |
lookupField
String for the lookup field in the lookup object that maps to this field. |
protected String |
lookupObject
String for lookup object classname |
protected org.apache.oro.text.regex.Pattern |
mask
|
static String |
NULL_TYPE
null isn't supported in expresso as of 5/02 |
static String |
NUMERIC_TYPE
|
static String |
OTHER_TYPE
|
protected int |
precision
Field precision, if applicable to this field |
static String |
REAL_TYPE
|
static String |
REF_TYPE
|
static String |
SMALLINT_TYPE
|
static String |
STRUCT_TYPE
|
static String |
TEXT_TYPE
text is a synonym for longvarchar |
static String |
TIME_TYPE
|
static String |
TIMESTAMP_TYPE
|
static String |
TINYINT_TYPE
|
static String |
VARBINARY_TYPE
|
static String |
VARCHAR_TYPE
|
| Constructor Summary | |
DBField(String myName,
String myType,
int newPrecision,
boolean myAllowNull,
String myDescrip)
constructor for types with no size |
|
DBField(String myName,
String myType,
int mySize,
int newPrecision,
boolean myAllowNull,
String myDescrip)
Constructor: A DBField is initialized knowing it's name, type, size, description and whether or not it can accept null or empty values |
|
| Method Summary | |
boolean |
allowsNull()
Does this field allow nulls? |
Set |
getAllAttributes()
Retrieves all attribute names for this particular data field's metadata |
Object |
getAttribute(String attribName)
Returns an attribute keyed by name. |
Iterator |
getAttributesIterator()
Returns a copy of all attributes associated with this field. |
String |
getDefaultValue()
Retrieve the default value for the field. |
String |
getDescription()
Return the description of this field |
Class |
getFilterClass()
getter for Filter Class used in conjuction with get/setFilterMethod |
String |
getFilterMethod()
Return the filter method currently used for this field. |
String |
getLength()
Return the length of the field in characters |
int |
getLengthInt()
Return the length of this field as an integer |
String |
getLookupDefinition()
Future versions of Expresso will rely more on objects that are shown as unique by a combination of their classname and their definition names. |
String |
getLookupField()
When you get a lookup object, to perform a complete mapping between the two, you need to know what field name in the remote object maps to this field. |
String |
getLookupObject()
Return the value for the lookupObject for this field |
org.apache.oro.text.regex.Pattern |
getMask()
Get the compiled regular expression for this field. |
String |
getName()
Return the name of the field |
int |
getPrecision()
Return the precision of this field as an integer |
String |
getTypeString()
Return the database type of the field as specified with a string in the DBObject itself |
boolean |
isAutoIncremented()
Is this field an auto-incremented field? |
boolean |
isBinaryObjectType()
Is it a BLOB? |
boolean |
isBooleanType()
is the field a boolean? |
boolean |
isCharacterLongObjectType()
Is this field fall into the classification of a long character object? |
boolean |
isDateOnlyType()
is the field a date or time field? |
boolean |
isDateTimeType()
is the field a date or time field? |
boolean |
isDateType()
is the field a date or time field? |
boolean |
isEncrypted()
Return the field's hashed status |
boolean |
isFloatingPointType()
|
boolean |
isHashed()
Return the field's hashed status |
boolean |
isKey()
Is this field a key field? |
boolean |
isLongBinaryType()
Is it a LONGVARBINARY? |
boolean |
isLongCharacterType()
Is it a LONGVARCHAR? |
boolean |
isLongObjectType()
Does this field fall into a class of BLOB object data types? |
boolean |
isMasked()
Return boolean if the field has a mask set |
boolean |
isMultiValued()
Is this field multi-valued? |
boolean |
isNumericType()
is the field a numeric field? |
boolean |
isQuotedTextType()
is the field a quoted text field? |
boolean |
isReadOnly()
Return the field's read-only |
boolean |
isSecret()
Return the field's secret status |
boolean |
isTimeType()
is the field a date or time field? |
boolean |
isVirtual()
Is this field a virtual field? |
void |
removeAttribute(String attribName)
Removes an attribute from this Field object. |
void |
setAttribute(String attribName,
Object attribValue)
Sets an attribute for this particular field. |
void |
setDefaultMask()
Set the field's default mask according to it's type |
void |
setDefaultValue(String newValue)
Sets the default value of the field. |
void |
setEncrypted(boolean newValue)
Set the field's encrypted status |
void |
setFilterClass(Class filterClass)
Set's the name of the filter class to be used used in conjuction with get/setFilterMethod |
String |
setFilterMethod(String newMethod)
Set's the name of the filter method to be used |
void |
setHashed(boolean newValue)
Set the field's hashed status. |
void |
setKey(boolean newKey)
Set this field as a key field (or not) |
void |
setLookupDefinition(String definitionName)
Sets the value for the "lookup definition" this is the name of the definition for objects implementing the defineable interface. |
void |
setLookupField(String lookupFieldName)
Sets the value for the "lookup field". |
void |
setLookupObject(String objectName)
Set the value for the "lookup object" for this field. |
void |
setMask(org.apache.oro.text.regex.Pattern newMask)
Set a regular expression "mask" for this field that specifies it's valid values. |
void |
setMultiValued(boolean newMulti)
Set this field to be "multi-valued". |
void |
setReadOnly()
Set the field as a read-only field. |
void |
setSecret()
Set the field as a 'secret' field. |
void |
setVirtual(boolean newVirtual)
Set this field as a virtual field. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final transient String AUTOINC_TYPE
public static final transient String ARRAY_TYPE
public static final transient String BIGINT_TYPE
public static final transient String BINARY_TYPE
public static final transient String BIT_TYPE
public static final transient String BOOLEAN_TYPE
public static final transient String BLOB_TYPE
public static final transient String CHAR_TYPE
public static final transient String CLOB_TYPE
public static final transient String DATE_TYPE
public static final transient String DATETIME_TYPE
public static final transient String DOUBLE_TYPE
public static final transient String DECIMAL_TYPE
public static final transient String FLOAT_TYPE
public static final transient String INTEGER_TYPE
public static final transient String INT_TYPE
public static final transient String JAVA_OBJECT
public static final transient String LONG_TYPE
public static final transient String LONGVARCHAR_TYPE
public static final transient String LONGVARBINARY
public static final transient String NULL_TYPE
public static final transient String NUMERIC_TYPE
public static final transient String OTHER_TYPE
public static final transient String REAL_TYPE
public static final transient String REF_TYPE
public static final transient String SMALLINT_TYPE
public static final transient String STRUCT_TYPE
public static final transient String TIME_TYPE
public static final transient String TIMESTAMP_TYPE
public static final transient String TEXT_TYPE
public static final transient String TINYINT_TYPE
public static final transient String VARBINARY_TYPE
public static final transient String VARCHAR_TYPE
public static final String BOOLEAN_MASK
public static final String DATE_MASK
public static final String INT_MASK
public static final String FLOAT_MASK
public static final String ATTRIBUTE_ERROR
public static final String ATTRIBUTE_ERROR_MESSAGE
protected String fieldName
protected String expressoFieldTypeString
protected boolean allowNull
protected String description
protected int fieldSize
protected boolean isVirtual
protected org.apache.oro.text.regex.Pattern mask
protected Hashtable attributes
protected boolean isMultiValued
protected boolean isSecret
protected boolean isReadOnly
protected String lookupObject
protected String lookupField
protected String lookupDefinition
protected boolean isKey
protected boolean isLongObject
protected boolean isCharacterLongObject
protected String filterMethod
protected boolean encrypted
protected boolean hashed
protected int precision
protected boolean isFloatingPointType
public static transient Set allDataTypes
| Constructor Detail |
public DBField(String myName,
String myType,
int mySize,
int newPrecision,
boolean myAllowNull,
String myDescrip)
throws DBException
myName - Field name of this fieldmyType - Database type of the field - use string constant from DBFieldmySize - Size of the field in charactersnewPrecision - precision for this fieldmyAllowNull - True if null is allowed, false if notmyDescrip - Description (title) of the field
public DBField(String myName,
String myType,
int newPrecision,
boolean myAllowNull,
String myDescrip)
throws DBException
myName - Field name of this fieldmyType - Database type of the field - use string constant from DBFieldnewPrecision - precision for this fieldmyAllowNull - True if null is allowed, false if notmyDescrip - Description (title) of the field| Method Detail |
public boolean allowsNull()
allowsNull in interface DataFieldMetaDatapublic String getDescription()
getDescription in interface DataFieldMetaDatapublic String getDefaultValue()
getDefaultValue in interface DataFieldMetaDatapublic void setDefaultValue(String newValue)
setDefaultValue in interface DataFieldMetaDatanewValue - Stringpublic String getFilterMethod()
public String getLength()
public int getLengthInt()
getLengthInt in interface DataFieldMetaDatapublic String getLookupObject()
getLookupObject in interface DataFieldMetaDatapublic String getLookupDefinition()
getLookupDefinition in interface DataFieldMetaDatapublic String getLookupField()
getLookupField in interface DataFieldMetaDataIllegalArgumentException - if the field name does not existpublic String getName()
getName in interface DataFieldMetaDatapublic int getPrecision()
getPrecision in interface DataFieldMetaDatapublic String getTypeString()
getTypeString in interface DataFieldMetaDatapublic boolean isKey()
isKey in interface DataFieldMetaDatapublic boolean isMultiValued()
isMultiValued in interface DataFieldMetaDatapublic boolean isReadOnly()
isReadOnly in interface DataFieldMetaDatapublic boolean isBooleanType()
isBooleanType in interface DataFieldMetaDatapublic boolean isCharacterLongObjectType()
isCharacterLongObjectType in interface DataFieldMetaDatapublic boolean isLongObjectType()
isLongObjectType in interface DataFieldMetaDatapublic boolean isLongBinaryType()
isLongBinaryType in interface DataFieldMetaDatapublic boolean isLongCharacterType()
isLongCharacterType in interface DataFieldMetaDatapublic boolean isBinaryObjectType()
isBinaryObjectType in interface DataFieldMetaDatapublic boolean isQuotedTextType()
isQuotedTextType in interface DataFieldMetaDatapublic boolean isNumericType()
isNumericType in interface DataFieldMetaDatapublic boolean isDateType()
isDateType in interface DataFieldMetaDatapublic boolean isDateOnlyType()
isDateOnlyType in interface DataFieldMetaDatapublic boolean isFloatingPointType()
isFloatingPointType in interface DataFieldMetaDatapublic boolean isTimeType()
isTimeType in interface DataFieldMetaDatapublic boolean isDateTimeType()
isDateTimeType in interface DataFieldMetaDatapublic boolean isSecret()
isSecret in interface DataFieldMetaDatapublic boolean isHashed()
isHashed in interface DataFieldMetaDatapublic boolean isEncrypted()
isEncrypted in interface DataFieldMetaDatapublic boolean isVirtual()
isVirtual in interface DataFieldMetaData
public String setFilterMethod(String newMethod)
throws DBException
newMethod - The name of the filter method to use.
DBExceptionFilterManagerpublic void setKey(boolean newKey)
setKey in interface DataFieldMetaDatanewKey - Is this field a key?public void setLookupObject(String objectName)
setLookupObject in interface DataFieldMetaDataobjectName - the classname of the lookup objectpublic void setLookupField(String lookupFieldName)
lookupFieldName - the name of the field to retrieve.public void setLookupDefinition(String definitionName)
definitionName - java.lang.String. Depends on the class implementation
of the Defineable implementation.public void setMultiValued(boolean newMulti)
setMultiValued in interface DataFieldMetaDatanewMulti - True if the field is multi-valued, false if it is notDBObject.isMultiValued(java.lang.String)public void setHashed(boolean newValue)
setHashed in interface DataFieldMetaDatanewValue - true if you want this field hashed.public void setEncrypted(boolean newValue)
setEncrypted in interface DataFieldMetaDatanewValue - new value if you want an encrypted fieldpublic void setReadOnly()
setReadOnly in interface DataFieldMetaDatapublic boolean isAutoIncremented()
isAutoIncremented in interface DataFieldMetaDatapublic void setSecret()
setSecret in interface DataFieldMetaDatapublic void setVirtual(boolean newVirtual)
setVirtual in interface DataFieldMetaDatanewVirtual - True to make this object virtual, false if it is notpublic void setMask(org.apache.oro.text.regex.Pattern newMask)
setMask in interface DataFieldMetaDatanewMask - The compiled regular expression mask
public void setDefaultMask()
throws DBException
DBException - on errorpublic org.apache.oro.text.regex.Pattern getMask()
getMask in interface DataFieldMetaDatapublic void removeAttribute(String attribName)
removeAttribute in interface DataFieldMetaDataattribName - The name of the attribute to remove from this field.
public void setAttribute(String attribName,
Object attribValue)
setAttribute in interface DataFieldMetaDataattribName - the name of the attributeattribValue - the value of the attribute by this namepublic Object getAttribute(String attribName)
getAttribute in interface DataFieldMetaDataattribName - the name of the attribute to get
public Iterator getAttributesIterator()
getAttributesIterator in interface DataFieldMetaDatapublic Set getAllAttributes()
getAllAttributes in interface DataFieldMetaDatapublic Class getFilterClass()
getFilterMethod()public void setFilterC