public class PlSqlDatatype extends PlSqlCodeFragment implements DataType
Modifier and Type | Class and Description |
---|---|
static class |
PlSqlDatatype.Structure |
AbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupport
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE |
PCTROWTYPE, PCTTYPE, REF
Constructor and Description |
---|
PlSqlDatatype() |
Modifier and Type | Method and Description |
---|---|
void |
addVariable(PlSqlVariable variable)
Adds the given PlSqlVariable to the Variables property array
|
DataTypeUsage |
createDefaultUsage()
Returns an DataTypeUsage object for this type.
|
DataTypeUsage |
createUsage(java.util.Map<java.lang.String,java.lang.Object> attributes)
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.
|
PlSqlReference |
findBaseTypeReference()
Finds the PlSqlReference from the parent PlSqlBlock that represents the
base type of this datatype.
|
DBObjectID |
getBaseTypeID()
Convenience method to get the DBObjectID for the base type of this
datatype.
|
java.lang.Integer |
getBaseTypeOffset()
Gets the offset of the base type for this datatype in the source.
|
DataTypeAttribute |
getDataTypeAttribute(java.lang.String name)
Gets a DataTypeAttribute of the given name
|
DataTypeAttribute[] |
getDataTypeAttributes()
Get method for the DataTypeAttributes property
|
java.lang.String |
getDDL(DataTypeUsage dataTypeUsage)
Generates the DDL for this type.
|
java.lang.Integer |
getLimit()
Get method for the Limit property
|
java.lang.Integer |
getSQLType()
Gets the SQL type that identifies this data type.
|
PlSqlDatatype.Structure |
getStructure()
Get method for the Structure property
|
java.lang.String |
getType()
Returns the type of this object.
|
PlSqlVariable[] |
getVariables()
Get method for the Variables property
|
boolean |
hasDataTypeAttribute(java.lang.String name)
Returns true if this DataType has the given attribute name.
|
boolean |
isSubType()
Get method for the SubType property
|
boolean |
matches(java.lang.String usageString)
Returns
true if the usageString is valid syntax for the DataType,
false otherwise. |
void |
setBaseTypeID(DBObjectID baseTypeID)
Deprecated.
set the offset of the PlSqlReference that represents the
base type instead using
setBaseTypeOffset(Integer) . |
void |
setBaseTypeOffset(java.lang.Integer offset)
Sets the offset of the base type for this datatype in the source.
|
void |
setLimit(java.lang.Integer limit)
Set method for the Limit property
|
void |
setStructure(PlSqlDatatype.Structure structure)
Set method for the Structure property
|
void |
setSubType(boolean subType)
Set method for the SubType property
|
void |
setVariables(PlSqlVariable[] variables)
Set method for the Variables property
|
void |
validateDefaultValue(java.lang.Object defaultValue,
DataTypeUsage dataTypeUsage,
DBObject dbObject)
Deprecated.
|
void |
validateUsage(DataTypeUsage dataTypeUsage,
DBObject dbObject)
Deprecated.
|
addComment, addPropertyReference, addReference, getComments, getPropertyReferences, getReferences, setComments, setPropertyReferences, setReferences
copyToImpl, getChildAtOffset, getDeclarationAtOffset, getEndOffset, getName, getReferenceAtOffset, getSource, getSourceID, getStartOffset, setEndOffset, setSource, setSourceImpl, setStartOffset
setParent
checkInit, checkInit, getOwnedObjectsImpl, getProperties, getReferenceIDsImpl, needsInitialization, processPropertyChange, setID
addObjectListener, addObjectListener, addObjectListener, changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, findOwnedObject, findParent, fireObjectUpdated, firePropertyChanged, getChildSupport, getChildSupport, getID, getOwnedObjects, getOwnedObjects, getParent, getProperty, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeObjectListener, removeObjectListener, removeObjectListener, removeOwnedObject, removeThisAsParent, replaceReferenceIDs, setName, setProperties, setProperty, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addObjectListener, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getProperties, getProperty, getProperty, getReferenceIDs, hashCode, removeObjectListener, removeOwnedObject, replaceReferenceIDs, setID, setName, setProperties, setProperty
getParent
public static final java.lang.String TYPE
public java.lang.String getType()
DBObject
public java.lang.Integer getSQLType()
DataType
getSQLType
in interface DataType
Types
,
OracleTypes
public void setVariables(PlSqlVariable[] variables)
variables
- constituent members of a record datatypepublic PlSqlVariable[] getVariables()
public void addVariable(PlSqlVariable variable)
variable
- member of a record datatypepublic boolean isSubType()
public void setSubType(boolean subType)
public PlSqlDatatype.Structure getStructure()
public void setStructure(PlSqlDatatype.Structure structure)
structure
- indicator of the type of DataTypepublic DBObjectID getBaseTypeID() throws CancelledException
CancelledException
getBaseTypeOffset()
,
findBaseTypeReference()
@Deprecated public void setBaseTypeID(DBObjectID baseTypeID)
setBaseTypeOffset(Integer)
.public java.lang.Integer getBaseTypeOffset()
For example, for type varvarr
in the following procedure:
CREATE PROCEDURE PROC1 AS TYPE varvarr IS VARRAY(2) of VARCHAR2(10); ...This is the offset of the start of VARCHAR2.
public void setBaseTypeOffset(java.lang.Integer offset)
offset
- the base type offsetpublic PlSqlReference findBaseTypeReference() throws CancelledException
CancelledException
getBaseTypeOffset()
public java.lang.Integer getLimit()
public void setLimit(java.lang.Integer limit)
limit
- the size of the collection if varraypublic DataTypeAttribute[] getDataTypeAttributes()
getDataTypeAttributes
in interface DataType
public boolean hasDataTypeAttribute(java.lang.String name)
DataType
hasDataTypeAttribute
in interface DataType
name
- the name of the attribute to check.public DataTypeAttribute getDataTypeAttribute(java.lang.String name)
getDataTypeAttribute
in interface DataType
name
- the name of the attribute to getpublic java.lang.String getDDL(DataTypeUsage dataTypeUsage)
DataType
public DataTypeUsage createDefaultUsage()
DataType
createDefaultUsage
in interface DataType
public DataTypeUsage createUsage(java.util.Map<java.lang.String,java.lang.Object> attributes)
DataType
createUsage
in interface DataType
attributes
- the attributes for the new usagepublic DataTypeUsage createUsage(java.lang.String usageString)
DataType
DataType.matches(java.lang.String)
.
Should be overridden by sub-classes to return an object of the sub-class type.createUsage
in interface DataType
usageString
- the string to use to create a usagepublic boolean matches(java.lang.String usageString)
DataType
true
if the usageString is valid syntax for the DataType,
false
otherwise.
Should be overridden by sub-classes to do the validation.@Deprecated public void validateUsage(DataTypeUsage dataTypeUsage, DBObject dbObject)
validateUsage
in interface DataType
@Deprecated public void validateDefaultValue(java.lang.Object defaultValue, DataTypeUsage dataTypeUsage, DBObject dbObject)
validateDefaultValue
in interface DataType