Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.javatools.db.plsql
Class Type

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractBuildableObject
          extended by oracle.javatools.db.plsql.DBObjectPlSqlFragment
              extended by oracle.javatools.db.plsql.PlSqlBlock
                  extended by oracle.javatools.db.plsql.PlSqlSchemaObject
                      extended by oracle.javatools.db.plsql.PlSqlSchemaObjectSpec
                          extended by oracle.javatools.db.plsql.Type

All Implemented Interfaces:
ChildDBObject, DataType, DBObject, SchemaObject, SourceObject, SystemObject, Copyable, DynamicPropertySet

public class Type
extends PlSqlSchemaObjectSpec
implements DataType

Nested Class Summary
static class Type.SQLJUsingType
           

 

Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupport

 

Field Summary
static java.lang.String COLLECTION_TYPECODE
           
static java.lang.String OBJECT_TYPECODE
           
static java.lang.String TABLE_TYPE
           
static java.lang.String TYPE
           
static java.lang.String VARRAY_TYPE
           

 

Fields inherited from interface oracle.javatools.db.datatypes.DataType
PCTROWTYPE, PCTTYPE, REF

 

Fields inherited from interface oracle.javatools.db.DBObject
COMMENT

 

Constructor Summary
Type()
           

 

Method Summary
 void addAttribute(PlSqlAttribute attribute)
          Adds the given PlSqlAttribute to the Attributes property array
 void addMethod(PlSqlMethod method)
          Adds the given PlSqlMethod to the Methods property array
 void addSubProgram(PlSqlSubProgram subProgram)
          Adds the given PlSqlSubProgram to the Methods property array.
 void addVariable(PlSqlVariable var)
          Adds the given PlSqlVariable to the Attributes property array.
 boolean canHaveBody()
          Some Types cannot have a body (ie VARRAYs and TABLES).
 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.
 PlSqlAttribute getAttribute(java.lang.String name)
          Gets a Attribute of the given name
 PlSqlAttribute[] getAttributes()
          Get method for the Attributes property
 java.lang.String getCollectionType()
          Returns the code for the Type for Collection Types - either VARRAY or TABLE.
 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
 PlSqlMethod getMethod(java.lang.String name)
          Gets a Method of the given name
 PlSqlMethod[] getMethods()
          Get method for the Methods property
 DataTypeUsage getOfTypeUsage()
          Get method for the OfTypeUsage property
 PlSqlReference getOfTypeUsageReference()
          Get method for the OfTypeUsageReference property
 java.lang.String getOID()
          Get method for the OID property
 java.lang.String getSqljExternalName()
          Get method for the SqljExternalName property
 Type.SQLJUsingType getSqljUsing()
          Get method for the SqljUsing property
 PlSqlSubProgram[] getSubPrograms()
          Convenience method, overloads the superclass getSubPrograms but will return the same as getMethods()
 java.lang.String getType()
          Returns the type of this object.
 java.lang.String getTypeCode()
          Returns the type code
 DBObjectID getUnderTypeID()
          Get method for the UnderTypeID property
 PlSqlReference getUnderTypeReference()
          Get method for the UnderTypeReference property
 PlSqlVariable[] getVariables()
          Convenience method, overloads the superclass getVariables but will return the same as getAttributes()
 boolean hasDataTypeAttribute(java.lang.String name)
          Returns true if this DataTYpe has the given attribute name.
 boolean isAuthidCurrentUser()
          Get method for the AuthidCurrentUser property
 boolean isFinal()
          Whether this object type can be the supertype to another object type
 boolean isInstantiable()
          Whether an object can be defined to be of this type.
 boolean matches(java.lang.String usageString)
          Returns true if the usageString is valid syntax for the DataType, false otherwise.
 void removeAttribute(PlSqlAttribute attribute)
          Removes the given PlSqlAttribute from the Attributes property array
 void removeMethod(PlSqlMethod method)
          Removes the given PlSqlMethod from the Methods property array
 void setAttributes(PlSqlAttribute[] attributes)
          Set method for the Attributes property
 void setAuthidCurrentUser(boolean authidCurrentUser)
          Set method for the AuthidCurrentUser property
 void setCollectionType(java.lang.String collectionType)
          Set method for the CollectionType property
 void setFinal(boolean final_)
          Set whether this object type can be the supertype to another object type.
 void setInstantiable(boolean instantiable)
          Set whether an object can be defined to be of this type.
 void setLimit(java.lang.Integer limit)
          Set method for the Limit property
 void setMethods(PlSqlMethod[] methods)
          Set method for the Methods property
 void setOfTypeUsageReference(PlSqlReference ofTypeUsageRef)
          Set method for the OfTypeUsageReference property
 void setOID(java.lang.String oid)
          Set method for the OID property
 void setSqljExternalName(java.lang.String sqljExternalName)
          Set method for the SqljExternalName property
 void setSqljUsing(Type.SQLJUsingType sqljUsing)
          Set method for the SqljUsing property
 void setSubPrograms(PlSqlSubProgram[] subPrograms)
          Convenience method, overloads the superclass setSubPrograms but each entry in the array must be a PlSqlMethod or an IllegalArgumentExcption will be thrown.
 void setTypeCode(java.lang.String typeCode)
          Set method for the TypeCode property
 void setUnderTypeReference(PlSqlReference underTypeRef)
          Set method for the UnderTypeReference property
 void setVariables(PlSqlVariable[] vars)
          Convenience method, overloads the superclass setVariables but each entry in the array must be a PlSqlAttribute or an IllegalArgumentExcption will be thrown.
 void validateDefaultValue(java.lang.Object defaultValue, DataTypeUsage dataTypeUsage, DBObject dbObject)
          Validates defaultValue for dataTypeUsage against self's definition.
 void validateUsage(DataTypeUsage dataTypeUsage, DBObject dbObject)
          Validates dataTypeUsage against self's definition.

 

Methods inherited from class oracle.javatools.db.plsql.PlSqlSchemaObject
addObjectListener, addObjectListener, addObjectListener, fireObjectUpdated, getSchema, getSource, removeObjectListener, removeObjectListener, removeObjectListener, setSchema, setSource

 

Methods inherited from class oracle.javatools.db.plsql.PlSqlBlock
addBlock, addDatatype, addReference, getBlocks, getDatatypes, getReferences, getSubProgram, getVariable, setBlocks, setDatatypes, setReferences

 

Methods inherited from class oracle.javatools.db.plsql.DBObjectPlSqlFragment
clearSourceID, copyToImpl, getChildAtOffset, getEndOffset, getParent, getSourceID, getStartOffset, setEndOffset, setParent, setStartOffset

 

Methods inherited from class oracle.javatools.db.AbstractBuildableObject
checkInit, checkInit, equalsImpl, getOwnedObjectsImpl, getProperties, getProperty, getReferenceIDsImpl, needsInitialization, setProperty

 

Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, toString

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getReferenceIDs, replaceReferenceIDs, setID, setName

 

Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty

 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

OBJECT_TYPECODE

public static final java.lang.String OBJECT_TYPECODE
See Also:
Constant Field Values

COLLECTION_TYPECODE

public static final java.lang.String COLLECTION_TYPECODE
See Also:
Constant Field Values

TABLE_TYPE

public static final java.lang.String TABLE_TYPE
See Also:
Constant Field Values

VARRAY_TYPE

public static final java.lang.String VARRAY_TYPE
See Also:
Constant Field Values

Constructor Detail

Type

public Type()

Method Detail

getType

public java.lang.String getType()
Description copied from interface: DBObject
Returns the type of this object. Valid types include things like tables, views, synonyms, and columns.
Specified by:
getType in interface DBObject
Overrides:
getType in class PlSqlBlock
Returns:
a string describing the type of object.

canHaveBody

public boolean canHaveBody()
Description copied from class: PlSqlSchemaObjectSpec
Some Types cannot have a body (ie VARRAYs and TABLES). Overriden by subclass.
Overrides:
canHaveBody in class PlSqlSchemaObjectSpec
Returns:
can this object have a body?

isFinal

public boolean isFinal()
Whether this object type can be the supertype to another object type
Returns:
true if no subtypes are allowed, false otherwise
Since:
11.1.2.0.0

setFinal

public void setFinal(boolean final_)
Set whether this object type can be the supertype to another object type. This will not affect the PL/SQL of the type and should only be used when bulding the type from the PL/SQL.
Parameters:
final_ - true if no subtypes are to be allowed, false otherwise
Since:
11.1.2.0.0

isInstantiable

public boolean isInstantiable()
Whether an object can be defined to be of this type.
Returns:
true if an object can be of this type
Since:
11.1.2.0.0

setInstantiable

public void setInstantiable(boolean instantiable)
Set whether an object can be defined to be of this type. This will not affect the PL/SQL of the type and should only be used when bulding the type from the PL/SQL.
Parameters:
instantiable - set true if an object can be of this type
Since:
11.1.2.0.0

getTypeCode

public java.lang.String getTypeCode()
Returns the type code

setTypeCode

public void setTypeCode(java.lang.String typeCode)
Set method for the TypeCode property
Parameters:
typeCode -
Since:
11.1.2.0.0

getCollectionType

public java.lang.String getCollectionType()
Returns the code for the Type for Collection Types - either VARRAY or TABLE.
Returns:
Since:
11.1.2.0.0

setCollectionType

public void setCollectionType(java.lang.String collectionType)
Set method for the CollectionType property
Parameters:
collectionType -
Since:
11.1.2.0.0

setAuthidCurrentUser

public void setAuthidCurrentUser(boolean authidCurrentUser)
Set method for the AuthidCurrentUser property
Parameters:
authidCurrentUser -
Since:
11.1.2.0.0

isAuthidCurrentUser

public boolean isAuthidCurrentUser()
Get method for the AuthidCurrentUser property
Returns:
Since:
11.1.2.0.0

setLimit

public void setLimit(java.lang.Integer limit)
Set method for the Limit property
Parameters:
limit -
Since:
11.1.2.0.0

getLimit

public java.lang.Integer getLimit()
Get method for the Limit property
Returns:
Since:
11.1.2.0.0

getOfTypeUsage

public DataTypeUsage getOfTypeUsage()
Get method for the OfTypeUsage property
Returns:
Since:
11.1.2.0.0

setOfTypeUsageReference

public void setOfTypeUsageReference(PlSqlReference ofTypeUsageRef)
Set method for the OfTypeUsageReference property
Parameters:
ofTypeUsageRef -
Since:
11.1.2.0.0

getOfTypeUsageReference

public PlSqlReference getOfTypeUsageReference()
Get method for the OfTypeUsageReference property
Returns:
Since:
11.1.2.0.0

getUnderTypeReference

public PlSqlReference getUnderTypeReference()
Get method for the UnderTypeReference property
Returns:
Since:
11.1.2.0.0

setUnderTypeReference

public void setUnderTypeReference(PlSqlReference underTypeRef)
Set method for the UnderTypeReference property
Parameters:
underTypeRef -
Since:
11.1.2.0.0

getUnderTypeID

public DBObjectID getUnderTypeID()
Get method for the UnderTypeID property
Returns:
Since:
11.1.2.0.0

setOID

public void setOID(java.lang.String oid)
Set method for the OID property
Parameters:
oid -
Since:
11.1.2.0.0

getOID

public java.lang.String getOID()
Get method for the OID property
Returns:
Since:
11.1.2.0.0

setSqljExternalName

public void setSqljExternalName(java.lang.String sqljExternalName)
Set method for the SqljExternalName property
Parameters:
sqljExternalName -
Since:
11.1.2.0.0

getSqljExternalName

public java.lang.String getSqljExternalName()
Get method for the SqljExternalName property
Returns:
Since:
11.1.2.0.0

setSqljUsing

public void setSqljUsing(Type.SQLJUsingType sqljUsing)
Set method for the SqljUsing property
Parameters:
sqljUsing -
Since:
11.1.2.0.0

getSqljUsing

public Type.SQLJUsingType getSqljUsing()
Get method for the SqljUsing property
Returns:
Since:
11.1.2.0.0

setMethods

public void setMethods(PlSqlMethod[] methods)
Set method for the Methods property
Parameters:
methods -
Since:
11.1.2.0.0

getMethods

public PlSqlMethod[] getMethods()
Get method for the Methods property
Returns:
Since:
11.1.2.0.0

getMethod

public PlSqlMethod getMethod(java.lang.String name)
Gets a Method of the given name
Returns:
Since:
11.1.2.0.0

addMethod

public void addMethod(PlSqlMethod method)
Adds the given PlSqlMethod to the Methods property array
Parameters:
method -
Since:
11.1.2.0.0

removeMethod

public void removeMethod(PlSqlMethod method)
Removes the given PlSqlMethod from the Methods property array
Parameters:
method -
Since:
11.1.2.0.0

getSubPrograms

public PlSqlSubProgram[] getSubPrograms()
Convenience method, overloads the superclass getSubPrograms but will return the same as getMethods()
Overrides:
getSubPrograms in class PlSqlBlock
Returns:
SubPrograms (procedures and functions) defined within this PlSqlBlock
Since:
11.1.2.0.0

setSubPrograms

public void setSubPrograms(PlSqlSubProgram[] subPrograms)
Convenience method, overloads the superclass setSubPrograms but each entry in the array must be a PlSqlMethod or an IllegalArgumentExcption will be thrown. Any SubPrograms set here will be returned by getMethods and getSubPrograms.
Overrides:
setSubPrograms in class PlSqlBlock
Parameters:
subPrograms -
Since:
11.1.2.0.0

addSubProgram

public void addSubProgram(PlSqlSubProgram subProgram)
Adds the given PlSqlSubProgram to the Methods property array. Throws IllegalArgumentException if subProgram is not a PlSqlMethod
Overrides:
addSubProgram in class PlSqlBlock
Parameters:
subProgram -
Since:
11.1.2.0.0

setAttributes

public void setAttributes(PlSqlAttribute[] attributes)
Set method for the Attributes property
Parameters:
attributes -
Since:
11.1.2.0.0

getAttributes

public PlSqlAttribute[] getAttributes()
Get method for the Attributes property
Returns:
Since:
11.1.2.0.0

getAttribute

public PlSqlAttribute getAttribute(java.lang.String name)
Gets a Attribute of the given name
Returns:
Since:
11.1.2.0.0

addAttribute

public void addAttribute(PlSqlAttribute attribute)
Adds the given PlSqlAttribute to the Attributes property array
Parameters:
attribute -
Since:
11.1.2.0.0

removeAttribute

public void removeAttribute(PlSqlAttribute attribute)
Removes the given PlSqlAttribute from the Attributes property array
Parameters:
attribute -
Since:
11.1.2.0.0

getVariables

public PlSqlVariable[] getVariables()
Convenience method, overloads the superclass getVariables but will return the same as getAttributes()
Overrides:
getVariables in class PlSqlBlock
Returns:
Since:
11.1.2.0.0

setVariables

public void setVariables(PlSqlVariable[] vars)
Convenience method, overloads the superclass setVariables but each entry in the array must be a PlSqlAttribute or an IllegalArgumentExcption will be thrown. Any variables set here will be returned by getAttributes and getVariables.
Overrides:
setVariables in class PlSqlBlock
Parameters:
vars -
Since:
11.1.2.0.0

addVariable

public void addVariable(PlSqlVariable var)
Adds the given PlSqlVariable to the Attributes property array. Throws IllegalArgumentException if varm is not a PlSqlAttribute
Overrides:
addVariable in class PlSqlBlock
Parameters:
var -
Since:
11.1.2.0.0

getDDL

public java.lang.String getDDL(DataTypeUsage dataTypeUsage)
Description copied from interface: DataType
Generates the DDL for this type. Uses dataTypeUsages's get() methods to get the actual property values. Should be overridden by sub-classes to generate extra bits.
Specified by:
getDDL in interface DataType

getDataTypeAttributes

public DataTypeAttribute[] getDataTypeAttributes()
Get method for the DataTypeAttributes property
Specified by:
getDataTypeAttributes in interface DataType
Returns:
Since:
11.1.2.0.0

hasDataTypeAttribute

public boolean hasDataTypeAttribute(java.lang.String name)
Description copied from interface: DataType
Returns true if this DataTYpe has the given attribute name.
Specified by:
hasDataTypeAttribute in interface DataType
Returns:
true if the DataTypeAttribute corresponding to name exists.

getDataTypeAttribute

public DataTypeAttribute getDataTypeAttribute(java.lang.String name)
Gets a DataTypeAttribute of the given name
Specified by:
getDataTypeAttribute in interface DataType
Returns:
Since:
11.1.2.0.0

createDefaultUsage

public DataTypeUsage createDefaultUsage()
Description copied from interface: DataType
Returns an DataTypeUsage object for this type. Used by UI to create a default data type usage. Mandatory declarable attributes of the data type are initialised with appropriate values, e.g. the size of a usage of an Oracle VARCHAR2 data type would be set to 4000, its maximum. Should be overridden by sub-classes to return an object of the sub-class type.
Specified by:
createDefaultUsage in interface DataType

createUsage

public DataTypeUsage createUsage(java.util.Map<java.lang.String,java.lang.Object> attributes)
Description copied from interface: DataType
Returns an DataTypeUsage object for this type, populated with attributes. Should be overridden by sub-classes to return an object of the sub-class type.
Specified by:
createUsage in interface DataType

validateUsage

public void validateUsage(DataTypeUsage dataTypeUsage,
                          DBObject dbObject)
                   throws DataTypeValidationException
Description copied from interface: DataType
Validates dataTypeUsage against self's definition. Uses dataTypeUSage's get() methods to get the actual property values for validation. Should be overridden by sub-classes to do sub-class validation.
Specified by:
validateUsage in interface DataType
Parameters:
dataTypeUsage - : the usage to be validated
dbObject - : the context of the data type usage
Throws:
DataTypeValidationException

validateDefaultValue

public void validateDefaultValue(java.lang.Object defaultValue,
                                 DataTypeUsage dataTypeUsage,
                                 DBObject dbObject)
                          throws DefaultValueValidationException
Description copied from interface: DataType
Validates defaultValue for dataTypeUsage against self's definition. Method should be overridden by sub-classes to do sub-class validation.
Specified by:
validateDefaultValue in interface DataType
Parameters:
defaultValue - : the default value
dataTypeUsage - : the usage to be validated
dbObject - : the context of the data type usage
Throws:
DefaultValueValidationException

matches

public boolean matches(java.lang.String usageString)
Description copied from interface: DataType
Returns true if the usageString is valid syntax for the DataType, false otherwise. Should be overridden by sub-classes to do the validation.
Specified by:
matches in interface DataType

createUsage

public DataTypeUsage createUsage(java.lang.String usageString)
Description copied from interface: DataType
Returns an DataTypeUsage object for this type, populated with attributes based on the usageString. Returns null if the usageString does not match the syntax of the DataType. See DataType.matches(java.lang.String). Should be overridden by sub-classes to return an object of the sub-class type.
Specified by:
createUsage in interface DataType

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.