public class PredefinedDataType extends AbstractDBObject implements DataType
AbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupportPCTROWTYPE, PCTTYPE, REF, TYPE| Constructor and Description |
|---|
PredefinedDataType() |
PredefinedDataType(int domain, java.lang.String name)
Use this constructor when the data type is a simple name with no declarable attributes, e.g.
|
PredefinedDataType(int domain, java.lang.String name, java.lang.String definition, DataTypeAttribute[] attributes)
Use this constructor when the datatype is not just a simple name, but has declarable attributes, e.g.
|
PredefinedDataType(int domain, java.lang.String name, java.lang.String definition, long minSize, long maxSize, long defaultSize, boolean isSizeMandatory, DataTypeAttribute[] attributes)
Use this constructor when the data type has a declarable maximum size, e.g.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(DataTypeAttribute attribute) |
void |
addAttribute(DataTypeAttribute attribute, int atIndex) |
protected void |
copyToImpl(AbstractDBObject other, DBObject copyParent, IDPolicy idPolicy)
Implementation method for making a copy of this object.
|
DataTypeUsage |
createDefaultUsage()
Returns an DataTypeUsage object for this type.
|
DataTypeUsage |
createUsage(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
Returns an DataTypeUsage object for this type, populated with attributes.
|
DataTypeUsage |
createUsage(java.lang.String usageString)
Returns an DataTypeUsage object for this type, populated with attributes based on the usageString.
|
protected boolean |
equalsImpl(AbstractDBObject target)
Equals implementation for testing equality with another AbstractDBObject.
|
DataTypeAttribute |
getDataTypeAttribute(java.lang.String name)
Returns the DataTypeAttribute called name or null if this data type doesn't define it.
|
DataTypeAttribute[] |
getDataTypeAttributes()
Returns an array of this type's DataTypeAttributes in the order they were added to this type.
|
java.lang.String |
getDDL(DataTypeUsage dataTypeUsage)
Generates the DDL for this type.
|
protected java.lang.String |
getDefinitionForSearch() |
java.lang.String |
getType()
Returns the type of this object.
|
boolean |
hasDataTypeAttribute(java.lang.String name)
Returns true if the DataTypeAttribute name is on this DataType.
|
boolean |
matches(java.lang.String usageString)
Returns
true if the usageString is valid syntax for the DataType, false otherwise. |
protected static PlsqlNode |
parseDefaultValue(java.lang.String strDefaultValue, DataType dataType, DBObject dbObject)
Parse the default value.
|
void |
removeAttribute(DataTypeAttribute attribute) |
void |
setDataTypeAttributes(DataTypeAttribute[] attrs) |
protected static java.lang.String[] |
tokenize(java.lang.String string, java.lang.String delimiters)
Creates a String[] of tokens extracted from string.
|
void |
validateDefaultValue(java.lang.Object defaultValue, DataTypeUsage dataTypeUsage, DBObject dbObject)
Validates defaultValue for dataTypeUsage against self's definition.
|
void |
validateDefinition()
Validate BNF definition methods.
|
void |
validateUsage(DataTypeUsage dataTypeUsage, DBObject dbObject)
Validates dataTypeUsage against self's definition.
|
addObjectListener, addObjectListener, addObjectListener, changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, findOwnedObject, findOwnedObject, findParent, fireObjectUpdated, firePropertyChanged, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getParent, getProperties, getProperty, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeObjectListener, removeObjectListener, removeObjectListener, removeOwnedObject, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, setProperty, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddObjectListener, copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getProperties, getReferenceIDs, removeObjectListener, removeOwnedObject, replaceReferenceIDs, setID, setNamegetProperty, getProperty, setProperties, setPropertypublic PredefinedDataType()
public PredefinedDataType(int domain,
java.lang.String name)
domain - : Context of data type definition, e.g. column, variable. Domains are specific to each database and are defined in their interface.name -
public PredefinedDataType(int domain,
java.lang.String name,
java.lang.String definition,
DataTypeAttribute[] attributes)
domain - : Context of data type definition, e.g. column, variable. Domains are specific to each database and are defined in their interface.name - : Lookup and display name of this data typedefinition - : BNF definition of this data typeattributes - : Definitions of this data type's attributes
public PredefinedDataType(int domain,
java.lang.String name,
java.lang.String definition,
long minSize,
long maxSize,
long defaultSize,
boolean isSizeMandatory,
DataTypeAttribute[] attributes)
domain - : Context of data type definition, e.g. column, variable. Domains are specific to each database and are defined in their interface.name - : data type namedefinition - : BNF definition of this data typeminSize - : the minimum size of this data typemaxSize - : the maximum size of this data typedefaultSize - : size of data type when size is optional and not declared, default size for UI when size is mandatory.isSizeMandatory - : TRUE when size has to be declaredattributes - : Definitions of additional attributespublic final void addAttribute(DataTypeAttribute attribute)
public final void addAttribute(DataTypeAttribute attribute, int atIndex)
public final void removeAttribute(DataTypeAttribute attribute)
public DataTypeUsage createDefaultUsage()
DataTypecreateDefaultUsage in interface DataTypepublic DataTypeUsage createUsage(java.util.Map<java.lang.String,java.lang.Object> attributeValues)
DataTypecreateUsage in interface DataTypepublic void validateUsage(DataTypeUsage dataTypeUsage, DBObject dbObject) throws DataTypeValidationException
DataTypevalidateUsage in interface DataTypedataTypeUsage - : the usage to be validateddbObject - : the context of the data type usageDataTypeValidationException
public void validateDefaultValue(java.lang.Object defaultValue,
DataTypeUsage dataTypeUsage,
DBObject dbObject)
throws DefaultValueValidationException
DataTypevalidateDefaultValue in interface DataTypedefaultValue - : the default valuedataTypeUsage - : the usage to be validateddbObject - : the context of the data type usageDefaultValueValidationExceptionpublic java.lang.String getDDL(DataTypeUsage dataTypeUsage)
DataTypepublic final boolean hasDataTypeAttribute(java.lang.String name)
hasDataTypeAttribute in interface DataTypepublic final DataTypeAttribute getDataTypeAttribute(java.lang.String name)
getDataTypeAttribute in interface DataTypename - the name of the attribute to findpublic final DataTypeAttribute[] getDataTypeAttributes()
getDataTypeAttributes in interface DataTypepublic final void setDataTypeAttributes(DataTypeAttribute[] attrs)
public final java.lang.String getType()
DBObjectprotected void copyToImpl(AbstractDBObject other, DBObject copyParent, IDPolicy idPolicy)
AbstractDBObjectcopyToImpl in class AbstractDBObjectother - the copy being created of this objectcopyParent - if this object is being copied underneath a parent, this parameter is the copy of the parent of this object, which will therefore need to be the parent of the copy of this object.idPolicy - the policy for copying the object's ID.protected boolean equalsImpl(AbstractDBObject target)
AbstractDBObjectequalsImpl in class AbstractDBObject
public void validateDefinition()
throws DataTypeValidationException
DataTypeValidationException
protected static java.lang.String[] tokenize(java.lang.String string,
java.lang.String delimiters)
protected static PlsqlNode parseDefaultValue(java.lang.String strDefaultValue, DataType dataType, DBObject dbObject) throws DefaultValueValidationException
DefaultValueValidationException - if there are parser exceptionspublic boolean matches(java.lang.String usageString)
DataTypetrue if the usageString is valid syntax for the DataType, false otherwise. Should be overridden by sub-classes to do the validation.public DataTypeUsage createUsage(java.lang.String usageString)
DataTypeDataType.matches(java.lang.String). Should be overridden by sub-classes to return an object of the sub-class type.createUsage in interface DataTypeprotected java.lang.String getDefinitionForSearch()