|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.db.datatypes.DataTypeHelper
public class DataTypeHelper
Helper class for unwrapping the DataTypeUsage object.
Constructor Summary | |
---|---|
DataTypeHelper()
|
Method Summary | |
---|---|
static boolean |
canGetTypeStringFromID(DBObjectID id)
|
static DBObjectID |
findIDForTypeString(DBObjectProvider provider,
Schema defaultSchema,
java.lang.String typeString)
From a String representing a datatype of some sort, find an ID for that type in the given provider, or return null. |
static DBObjectID |
findOrCreateIDForTypeString(DBObjectProvider provider,
Schema defaultSchema,
java.lang.String typeString)
From a String representing a datatype of some sort, find or create an ID for that type in the given provider. |
static java.lang.Object |
getAttributeValue(java.lang.Object value,
DataType dataType,
java.lang.String attributeName)
Returns an attribute value as an object of the type of the attribute. |
static DataType |
getDataType(DataTypeUsage usage)
Returns the DataType that usage is an instance of, or null if usage is null |
static DataTypeUsage |
getDataTypeUsageForString(DBObjectProvider provider,
Schema defaultSchema,
java.lang.String usageString)
See getDataTypeUsageForString(DBObjectProvider,Schema,String,boolean) |
static DataTypeUsage |
getDataTypeUsageForString(DBObjectProvider provider,
Schema defaultSchema,
java.lang.String usageString,
boolean strict)
Returns a DataTypeUsage for the given string. |
static java.lang.String |
getDDL(DataTypeUsage dtu)
Gets the ddl for the give DataTypeUsage, unless something goes wrong then it'll return null. |
static java.lang.Long |
getLongAttributeValue(DataTypeUsage usage,
java.lang.String name)
Returns the value of the given named attribute from the given DataTypeUsage as a Long. |
static java.lang.String |
getNameFromLabel(int resourceLabelID)
|
static java.lang.String |
getNameFromLabel(java.lang.String resourceLabel)
|
static java.lang.String |
getStringAttributeDefaultValue(DataTypeUsage usage,
java.lang.String attributeName)
Returns the default value of the given named attribute from the given DataTypeUsage as a String. |
static java.lang.String |
getStringAttributeValue(DataTypeUsage usage,
java.lang.String name)
Returns the value of the given named attribute from the given DataTypeUsage as a String. |
static java.lang.String |
getTypeStringFromID(DBObjectID typeID,
Schema defaultSchema)
Return a fully qualified String representation of the type with the given ID, omitting the schema name if it is the same as the default schema |
static boolean |
isXMLType(DataType type)
|
static java.lang.Long |
toLong(java.lang.Object usageValue)
Returns usageValue as a Long, or null if usageValue is null or usageValue can't be converted to a number. |
static java.lang.Long |
toLongOrError(java.lang.Object usageValue)
Returns usageValue as a Long, or null if usageValue is null or usageValue can't be converted to a number. |
static java.lang.String |
toString(java.lang.Object usageValue)
Returns usageValue as a String, or null if usageValue is null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataTypeHelper()
Method Detail |
---|
public static DataType getDataType(DataTypeUsage usage) throws DBException
usage
- the usage to unwrap
DBException
- if the usage's DBObjectID doesn't resolve to a valid DataTypepublic static java.lang.Long getLongAttributeValue(DataTypeUsage usage, java.lang.String name)
public static java.lang.String getStringAttributeValue(DataTypeUsage usage, java.lang.String name)
public static java.lang.String getStringAttributeDefaultValue(DataTypeUsage usage, java.lang.String attributeName)
public static java.lang.Long toLong(java.lang.Object usageValue)
public static java.lang.Long toLongOrError(java.lang.Object usageValue) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static java.lang.String toString(java.lang.Object usageValue)
public static java.lang.String getNameFromLabel(int resourceLabelID)
public static java.lang.String getNameFromLabel(java.lang.String resourceLabel)
public static java.lang.Object getAttributeValue(java.lang.Object value, DataType dataType, java.lang.String attributeName)
value
- : value to be converteddataType
- : data type of valueattributeName
- : name of the attributepublic static java.lang.String getDDL(DataTypeUsage dtu)
public static boolean canGetTypeStringFromID(DBObjectID id)
public static java.lang.String getTypeStringFromID(DBObjectID typeID, Schema defaultSchema)
typeID
- defaultSchema
- public static DBObjectID findOrCreateIDForTypeString(DBObjectProvider provider, Schema defaultSchema, java.lang.String typeString)
typeString
- provider
- defaultSchema
-
public static DBObjectID findIDForTypeString(DBObjectProvider provider, Schema defaultSchema, java.lang.String typeString)
typeString
- provider
- defaultSchema
-
public static DataTypeUsage getDataTypeUsageForString(DBObjectProvider provider, Schema defaultSchema, java.lang.String usageString)
getDataTypeUsageForString(DBObjectProvider,Schema,String,boolean)
public static DataTypeUsage getDataTypeUsageForString(DBObjectProvider provider, Schema defaultSchema, java.lang.String usageString, boolean strict)
DataTypeUsage
for the given string. If strict == true
and no underlying DataType can be found, then null is returned.
If strict == false (or is omitted) and an underlying DataType cannot be
found, an ObjectTypeUsage with a ReferenceID for the DataType will be
returned.
provider
- defaultSchema
- usageString
- strict
-
public static boolean isXMLType(DataType type)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |