public final class DBObjectDeclarationFactory
extends java.lang.Object
IdDeclaration
and
IdReference
.
Examples:
(Column, Table and DBObjectProvider are all in package oracle.javatools.db)
1) Create a reference to table "EMP" in schema "SCOTT" in a given
DBObjectProvider (pro):
DBObjectDeclarationFactory factory = DBObjectDeclarationFactory.getInstance(); DBObjectDeclaration decl = factory.createDeclaration( pro, "SCOTT", Table.TYPE, "EMP" );2) Create a reference to column "ENAME" in table "EMP" using the default schema a DBObjectProvider (pro):
DBObjectDeclarationFactory factory = DBObjectDeclarationFactory.getInstance(); DBObjectDeclaration decl = factory.createDelcaration( pro, null, Table.TYPE, "EMP", Column.TYPE, "ENAME" );
Modifier and Type | Class and Description |
---|---|
static class |
DBObjectDeclarationFactory.DeclarationHelper<T extends DBObjectProvider>
A DeclarationHelper is repsonsible for uniquely identifying a given
type of DBObjectProvider.
|
Modifier and Type | Method and Description |
---|---|
DBObjectDeclaration |
createDeclaration(BaseObjectID id)
Creates a new declaration to the object represented by the given ID
|
DBObjectDeclaration |
createDeclaration(DBObjectProvider pro,
java.lang.String schemaName,
java.lang.String type,
java.lang.String name)
Creates a new declaration to an object in the given provider by schema
name, type and object name.
|
DBObjectDeclaration |
createDeclaration(DBObjectProvider pro,
java.lang.String schemaName,
java.lang.String type,
java.lang.String name,
java.lang.String childType,
java.lang.String childName)
Creates a new declaration to a child object in the given provider by name
and type of both the child object and its parent.
|
DBObjectDeclaration |
createDeclaration(java.lang.String declarationId)
Creates a DBObjectDeclaration for the given declarationId.
|
java.lang.String |
createDeclarationId(BaseObjectID id)
Creates a unique identifier that can be used to create a
DBObjectDeclaration for the given DBObjectID for a DBObject in a
DBObjectProvider.
|
java.lang.String |
createDeclarationId(DBObjectProvider pro,
DBObject obj)
Creates a unique identifier that can be used to create a
DBObjectDeclaration to any DBObject object (e.g.
|
java.lang.String |
createDeclarationId(DBObjectProvider pro,
DBObjectID id)
Creates a unique identifier that can be used to create a
DBObjectDeclaration for the given DBObjectID for a DBObject in a
DBObjectProvider.
|
java.lang.String |
createDeclarationId(DBObjectProvider pro,
java.lang.String schemaName,
java.lang.String type,
java.lang.String name)
Creates a unique identifier that can be used to create a
DBObjectDeclaration.
|
java.lang.String |
createDeclarationId(DBObjectProvider pro,
java.lang.String schemaName,
java.lang.String type,
java.lang.String name,
java.lang.String childType,
java.lang.String childName)
Creates a unique identifier that can be used to create a
DBObjectDeclaration to a child object (e.g.
|
DBObjectProviderDeclaration |
createProviderDeclaration(DBObjectProvider pro)
Creates a DBObjectProviderDeclaration to represent the given
DBObjectProvider in the IDE declaration framework.
|
DBObjectProviderDeclaration |
createProviderDeclaration(DBObjectProviderID proID)
Creates a DBObjectProviderDeclaration to represent the DBObjectProvider
identified by the given ID in the IDE declaration framework.
|
DBObjectProviderDeclaration |
createProviderDeclaration(java.lang.String declarationId)
Creates a DBObjectDeclaration for the given declarationId.
|
java.lang.String |
createProviderDeclarationId(DBObjectProvider pro)
Creates a unique identifier that can be used to create a
DBObjectProviderDeclaration for the given DBObjectProvider.
|
java.lang.String |
createProviderDeclarationId(DBObjectProviderID proID)
Creates a unique identifier that can be used to create a
DBObjectProviderDeclaration for the DBObjectProvider identified by the
given ID.
|
java.util.Collection<? extends DBObjectProvider> |
findReferenceProviders(DBObjectProvider pro,
Scope scope)
Finds all providers "in Scope" that can contain References to the given
DBObjectProvider.
|
BaseObjectID |
getDBObjectID(Context context,
java.lang.String declarationID)
Creates a BaseObjectID that will resolve to the DBObject identifier
by the given declarationID.
|
DBObjectProvider |
getDBObjectProvider(Context context,
java.lang.String declarationID)
Gets the DBObjectProvider for the given declaration identifier.
|
DBObjectProviderID |
getDBObjectProviderID(Context context,
java.lang.String declarationID)
Gets the id for the DBObjectProvider from the given declaration
identifier.
|
static DBObjectDeclarationFactory |
getInstance() |
Project |
getProject(DBObjectProvider pro,
Context context)
Gets the Project that the given provider is in, or null if the
provider doesn't belong to a Project.
|
void |
registerHelper(DBObjectDeclarationFactory.DeclarationHelper helper)
Registers a DeclarationHelper for processing a specific
DBObjectProvider implementation.
|
boolean |
supportsProvider(DBObjectProvider pro)
Tests whether the given DBObjectProvider is supported by the declaration
factory (and therefore the db dependency support as a whole).
|
boolean |
supportsProviderType(java.lang.String proType)
Tests whether the given type of DBObjectProvider is supported by the
declaration factory (and therefore the db dependency support as a
whole).
|
void |
unregisterHelper(DBObjectDeclarationFactory.DeclarationHelper helper)
Unregisters a DeclarationHelper for processing a specific
DBObjectProvider implementation.
|
public static DBObjectDeclarationFactory getInstance()
public DBObjectDeclaration createDeclaration(DBObjectProvider pro, java.lang.String schemaName, java.lang.String type, java.lang.String name)
If the schema name is null, the default schema of the given provider will be assumed.
pro
- the provider the object is inschemaName
- the schema the object is owned by, or null to defaulttype
- the type of the object (e.g. oracle.javatoools.db.Table.TYPE )name
- the name of the objectpublic DBObjectDeclaration createDeclaration(DBObjectProvider pro, java.lang.String schemaName, java.lang.String type, java.lang.String name, java.lang.String childType, java.lang.String childName)
If the schema name is null, the default schema of the given provider will be assumed.
pro
- the provider the object is inschemaName
- the schema the object is owned by, or null to defaultownerType
- the type of the owning (parent) object
(e.g. oracle.javatoools.db.Table.TYPE )ownerName
- the name of the owning( parent) objecttype
- the type of the child object
(e.g. oracle.javatools.db.Column.TYPE)name
- the name of the child objectpublic DBObjectDeclaration createDeclaration(BaseObjectID id)
id
- the id for the object to create a declaration forpublic DBObjectDeclaration createDeclaration(java.lang.String declarationId)
declarationId
- the unique identifier to create a declaration forpublic java.lang.String createDeclarationId(DBObjectProvider pro, java.lang.String schemaName, java.lang.String type, java.lang.String name)
pro
- the provider containing the referenced objectschemaName
- the name of the owning schematype
- the type of the object (e.g. Table.TYPE)name
- the name of the objectpublic java.lang.String createDeclarationId(DBObjectProvider pro, java.lang.String schemaName, java.lang.String type, java.lang.String name, java.lang.String childType, java.lang.String childName)
pro
- the provider containing the referenced objectschemaName
- the name of the owning schematype
- the type of the object (e.g. Table.TYPE)name
- the name of the objectchildType
- the type of the child object (e.g. Column.TYPE)childName
- the name of the child object to referencepublic java.lang.String createDeclarationId(DBObjectProvider pro, DBObject obj)
pro
- the provider containing the objectobj
- the object to create an identifier forpublic java.lang.String createDeclarationId(BaseObjectID id)
id
- the BaseDBObjectID to create a declaration identifier forpublic java.lang.String createDeclarationId(DBObjectProvider pro, DBObjectID id)
pro
- the DBObjectProvider containing the DBObjectid
- the DBObjectID for the object in the provider.public DBObjectProvider getDBObjectProvider(Context context, java.lang.String declarationID)
context
- the IDE Context for finding the provider indeclarationID
- the object (or provider) declaration identifierpublic DBObjectProviderID getDBObjectProviderID(Context context, java.lang.String declarationID)
context
- the IDE Context for finding the provider indeclarationID
- the object (or provider) declaration identifierpublic BaseObjectID getDBObjectID(Context context, java.lang.String declarationID)
context
- the IDE Context for finding the provider indeclarationID
- the object declaration identifierpublic DBObjectProviderDeclaration createProviderDeclaration(DBObjectProvider pro)
pro
- the provider to representpublic DBObjectProviderDeclaration createProviderDeclaration(DBObjectProviderID proID)
pro
- the provider to representpublic java.lang.String createProviderDeclarationId(DBObjectProvider pro)
This declaration identifier is only useful for referencing the proider itself, not any object in that provider.
pro
- the provider to create a declaration identifier for.public java.lang.String createProviderDeclarationId(DBObjectProviderID proID)
This declaration identifier is only useful for referencing the proider itself, not any object in that provider.
proID
- the provider id to create a declaration identifier for.public DBObjectProviderDeclaration createProviderDeclaration(java.lang.String declarationId)
declarationId
- the unique identifier to create a declaration forpublic boolean supportsProvider(DBObjectProvider pro)
pro
- the provider to testpublic boolean supportsProviderType(java.lang.String proType)
proType
- the provider type to testpublic java.util.Collection<? extends DBObjectProvider> findReferenceProviders(DBObjectProvider pro, Scope scope) throws java.lang.InterruptedException
pro
- the provider we want references to the objects inscope
- the scope to search for providers injava.lang.InterruptedException
public Project getProject(DBObjectProvider pro, Context context)
pro
- the provider to get the project forcontext
- the relevant IDE contextpublic void registerHelper(DBObjectDeclarationFactory.DeclarationHelper helper)
public void unregisterHelper(DBObjectDeclarationFactory.DeclarationHelper helper)