Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

oracle.javatools.db
Class AbstractDBObjectBuilder

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObjectBuilder
All Implemented Interfaces:
DBObjectBuilder
Direct Known Subclasses:
DictionaryDBObjectBuilder

public abstract class AbstractDBObjectBuilder
extends java.lang.Object
implements DBObjectBuilder

Abstract implementation of DBObjectbuilder that provides core support for component building of objects.


Field Summary
 
Fields inherited from interface oracle.javatools.db.DBObjectBuilder
BASE_COMPONENT_KEY
 
Constructor Summary
protected AbstractDBObjectBuilder(AbstractDBObjectProvider pro, java.lang.String type)
           
 
Method Summary
 void buildObject(SchemaObject object)
          Requests that the specified object be completed.
 void buildObjectComponent(SchemaObject object, java.lang.String key)
          Uses canBuildComponents() to work out whether this builder can build just the given (key) subcomponent.
protected  boolean canBuildComponents()
          Returns false by default.
abstract  SchemaObject createObject(java.lang.String name, Schema schema, DBObjectID id)
          Requests the creation of a new SchemaObject of the type built by this DBObjectBuilder instance.
protected  void ensureComponent(AbstractSchemaObject obj, java.lang.String key)
          Ensures that the given component has been built.
protected abstract  void fillInObject(SchemaObject object)
           
protected  void fillInObjectComponent(SchemaObject object, java.lang.String key)
          Builds the whole object by default.
protected  java.lang.String getObjectType()
           
protected  AbstractDBObjectProvider getProvider()
           
protected  void markAsBuilt(AbstractSchemaObject obj)
           
protected  boolean needsBuilding(AbstractSchemaObject obj, java.lang.String key)
          Returns true if the given subcomponent of the object hasn't been explicitly built yet.
 boolean needsBuilding(AbstractSchemaObject obj, java.lang.String key, boolean checkBuilder)
          Checks whether the given component key on the given object needs building and optionally includes a check as to whether the object has been completely built already.
protected  void registerObject(SchemaObject object)
          Shared between buildObject and buildObjects to perform any post-build tasks that are needed (e.g.
protected  void updateTimestamp(SchemaObject object)
          Sets the timestamp of the given object if the underyling DBObjectProvide supports timestamping.
protected  void updateTimestamp(SchemaObject object, boolean force)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDBObjectBuilder

protected AbstractDBObjectBuilder(AbstractDBObjectProvider pro,
                                  java.lang.String type)
Method Detail

getObjectType

protected java.lang.String getObjectType()

getProvider

protected AbstractDBObjectProvider getProvider()

createObject

public abstract SchemaObject createObject(java.lang.String name,
                                          Schema schema,
                                          DBObjectID id)
Description copied from interface: DBObjectBuilder
Requests the creation of a new SchemaObject of the type built by this DBObjectBuilder instance.

Specified by:
createObject in interface DBObjectBuilder
Parameters:
name - The name of the new object
schema - The schema containing the new object
id - the DBObjectID for the new object
Returns:
The newly created object

buildObject

public void buildObject(SchemaObject object)
                 throws DBException
Description copied from interface: DBObjectBuilder
Requests that the specified object be completed. The object should be completely initialized after the call completes.

Specified by:
buildObject in interface DBObjectBuilder
Parameters:
object - The object needing building
Throws:
DBException - if an error occurs trying to build the object

fillInObject

protected abstract void fillInObject(SchemaObject object)
                              throws DBException
Throws:
DBException

registerObject

protected void registerObject(SchemaObject object)
                       throws DBException
Shared between buildObject and buildObjects to perform any post-build tasks that are needed (e.g. timestamping, registration with the object manager etc. Really we should try and do this for multiple objects at once as well but the timestamping work isn't easy to change that too so for now we'll stick with one at a time.

Throws:
DBException

updateTimestamp

protected void updateTimestamp(SchemaObject object)
                        throws DBException
Sets the timestamp of the given object if the underyling DBObjectProvide supports timestamping.

Throws:
DBException

updateTimestamp

protected void updateTimestamp(SchemaObject object,
                               boolean force)
                        throws DBException
Throws:
DBException

needsBuilding

protected boolean needsBuilding(AbstractSchemaObject obj,
                                java.lang.String key)
Returns true if the given subcomponent of the object hasn't been explicitly built yet. If the object has been wholely built then this will confusingly return true because the object's builder is not checked. To check the object's builder as well call needsBuilding(AbstractSchemaObject,String,boolean)


needsBuilding

public boolean needsBuilding(AbstractSchemaObject obj,
                             java.lang.String key,
                             boolean checkBuilder)
Checks whether the given component key on the given object needs building and optionally includes a check as to whether the object has been completely built already.


markAsBuilt

protected void markAsBuilt(AbstractSchemaObject obj)

ensureComponent

protected void ensureComponent(AbstractSchemaObject obj,
                               java.lang.String key)
                        throws DBException
Ensures that the given component has been built. Use in a fillInObject implementation to ensure that dependent components are built before the component required.

Throws:
DBException

buildObjectComponent

public void buildObjectComponent(SchemaObject object,
                                 java.lang.String key)
                          throws DBException
Uses canBuildComponents() to work out whether this builder can build just the given (key) subcomponent. If it can't the whole object is built.

Specified by:
buildObjectComponent in interface DBObjectBuilder
Throws:
DBException

fillInObjectComponent

protected void fillInObjectComponent(SchemaObject object,
                                     java.lang.String key)
                              throws DBException
Builds the whole object by default. Override if canBuildComponents returns true to build the respective components. Defer to this implementation for unrecongnized keys.

Throws:
DBException

canBuildComponents

protected boolean canBuildComponents()
Returns false by default. Override to enable building by component in this builder.


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

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