|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.3.0) E17493-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.db.property.Metadata
public class Metadata
The database API contains a number of bean classes that represent the objects that can exist in a database (e.g. Tables, Columns, Constraints). This class provides meta-information about these bean classes and the properties available on them.
Method Summary | |
---|---|
java.util.Collection<java.lang.String> |
getAllTypes(java.lang.Class<? extends DBObject> clz) Gets all the valid DBObject types for the given class, including all subclasses and implementations. |
java.util.Map<java.lang.String,java.lang.Class<? extends DBObject>> |
getDBObjectClasses() The returned map contains a mapping of DBObject types to their declaring DBObject subclasses. |
static Metadata |
getInstance() Gets the metadata for the database API. |
java.lang.Class<? extends DBObject> |
getObjectClass(java.lang.String type) Gets the DBObject class that corresponds to the given object type. |
java.util.Collection<java.lang.String> |
getSupportedProperties(java.lang.Class<? extends DBObject> objClz, java.lang.Class<? extends DBObjectProvider> proClz) Gets the supported properties, both defined on the bean class and also any extra properties registered via annotations or extensions, for the given object class in the context of the given provider class. |
java.util.Collection<java.lang.String> |
getSupportedProperties(java.lang.Class<? extends DBObject> objClz, java.lang.Class<? extends DBObjectProvider> proClz, boolean incBean, boolean incExtra) Gets the supported properties, both defined on the bean class and also any extra properties registered via annotations or extensions, for the given object class in the context of the given provider class. |
static java.lang.String |
getType(java.lang.Class<? extends DBObject> objClass) Returns the type defined for the given object class. |
boolean |
isBeanProperty(java.lang.Class<? extends DBObject> clz, java.lang.String propName) Tests whether a given property is a bean property (i.e. |
static boolean |
isRealBean(java.lang.Class<? extends Copyable> clz) Tests whether the given bean class is a concrete bean - i.e. |
boolean |
isSchemaObject(java.lang.String type) Returns true if the given DBObject type represents a SchemaObject. |
boolean |
isStaticReferenceProperty(java.lang.String propName) Tests whether the given property name is a static reference property, i.e. |
boolean |
isTypeOf(java.lang.Class<? extends DBObject> clz, java.lang.String type) Tests whether the given object type corresponds to a subclass of the given object class. |
DBObject |
newDBObject(java.lang.String type, java.lang.String name) Creates a new DBObject of given type, and sets it up with a name. |
DBObject |
newInstance(java.lang.String type) Creates a new instance of a DBObject of the given type. |
void |
registerIDProperty(java.lang.String name, boolean staticReference, java.lang.Class<? extends DBObjectProvider> providerType, java.lang.Class<? extends DBObject>... objectTypes) Registers a new property in the APIs metadata that has a return type of DBObjectID. |
void |
registerObjectClass(java.lang.String type, java.lang.Class<? extends DBObject> clz) |
void |
registerProperty(PropertyInfo info) Registers an extra property into the API metadata. |
void |
registerProperty(java.lang.String name, java.lang.Class returnType, java.lang.Class<? extends DBObjectProvider> providerType, java.lang.Class<? extends DBObject>... objectTypes) Registers a new property in the APIs metadata for a given object class and provider. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Metadata getInstance()
public java.util.Map<java.lang.String,java.lang.Class<? extends DBObject>> getDBObjectClasses()
public boolean isSchemaObject(java.lang.String type)
isTypeOf( SchemaObject.class, type )
public boolean isTypeOf(java.lang.Class<? extends DBObject> clz, java.lang.String type)
boolean isRelation = Metadata.getInstance().isTypeOf( Relation.class, type );
clz
- the class to query (e.g. SystemObject.class
)type
- the database object type (e.g. Table.TYPE
)public DBObject newDBObject(java.lang.String type, java.lang.String name)
type
- the type of object to createname
- the name to give the object (optional)public java.lang.Class<? extends DBObject> getObjectClass(java.lang.String type)
type
- the object type to lookuppublic void registerObjectClass(java.lang.String type, java.lang.Class<? extends DBObject> clz)
public java.util.Collection<java.lang.String> getAllTypes(java.lang.Class<? extends DBObject> clz)
public DBObject newInstance(java.lang.String type)
null
if a new instance cannot be instantiated - for example some types are defined at the interface level and therefore cannot be instantiated.type
- the object type required ( e.g. "TABLE" )public java.util.Collection<java.lang.String> getSupportedProperties(java.lang.Class<? extends DBObject> objClz, java.lang.Class<? extends DBObjectProvider> proClz)
objClz
- the object to query the properties for - cannot be null.proClz
- the provider class for the object - can be null if all registered properties are required.public java.util.Collection<java.lang.String> getSupportedProperties(java.lang.Class<? extends DBObject> objClz, java.lang.Class<? extends DBObjectProvider> proClz, boolean incBean, boolean incExtra)
objClz
- the object to query the properties for - cannot be null.proClz
- the provider class for the object - can be null if all registered properties are required.incBean
- include bean properties in the listincExtra
- include extra properties (registerd with the Metadata) in the list.public void registerProperty(java.lang.String name, java.lang.Class returnType, java.lang.Class<? extends DBObjectProvider> providerType, java.lang.Class<? extends DBObject>... objectTypes)
name
- the property namereturnType
- the expected return type for the propertyproviderType
- the class of DBObjectProvider that this property is to be registered against (null or DBObjectProvider.class registers for all providers).objectTypes
- the object types this property is valid against (null or DBObject.class registers for all DBObjects).public void registerIDProperty(java.lang.String name, boolean staticReference, java.lang.Class<? extends DBObjectProvider> providerType, java.lang.Class<? extends DBObject>... objectTypes)
name
- the property namestaticReference
- true if the property value is treated as a normal reference and replaced by the replaceReferenceIDs
method on DBObject.providerType
- the class of DBObjectProvider that this property is to be registered against (null or DBObjectProvider.class registers for all providers).objectTypes
- the object types this property is valid against (null or DBObject.class registers for all DBObjects).public void registerProperty(PropertyInfo info)
java.lang.IllegalArgumentException
- if the PropertyInfo is not valid or a property is already registered with that name.public boolean isStaticReferenceProperty(java.lang.String propName)
propName
- the name of the property to querypublic boolean isBeanProperty(java.lang.Class<? extends DBObject> clz, java.lang.String propName)
clz
- the object type to testpropName
- the property name to findpublic static boolean isRealBean(java.lang.Class<? extends Copyable> clz)
clz
- the class to testpublic static java.lang.String getType(java.lang.Class<? extends DBObject> objClass)
objClass
- the class to lookup (e.g. Table
.class)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.3.0) E17493-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |