|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.db.AbstractDBObject
public abstract class AbstractDBObject
Provides an abstract implementation of the DBObject
interface.
Nested Class Summary | |
---|---|
protected class |
AbstractDBObject.ChildSupport |
Field Summary |
---|
Fields inherited from interface oracle.javatools.db.DBObject |
---|
COMMENT |
Constructor Summary | |
---|---|
protected |
AbstractDBObject() Constructs a new instance. |
protected |
AbstractDBObject(java.lang.String name) Constructs a new instance with the specified name. |
protected |
AbstractDBObject(java.lang.String name, DBObjectID id) Constructs a new instance with the specified name and id. |
Method Summary | ||
---|---|---|
protected void |
changeParent(ChildDBObject oldChild, ChildDBObject newChild) Changes the parent by removing this object as the parent on the oldChild and setting this object as the parent of the newChild. |
|
protected int |
compareToImpl(AbstractDBObject target) |
|
protected
|
copyObject(T value, DBObject copy, IDPolicy idPolicy) Recursive function that can copy all objects supported as properties in the API. |
|
DBObject |
copyTo(DBObject target, boolean temporaryCopy) Copies the state of this object to another instance. |
|
protected DBObject |
copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy) Internal copy method used by the API to perform copy operations. |
|
DBObject |
copyTo(DBObject target, IDPolicy idPolicy) Copies the state of this object to another instance. |
|
java.lang.Object |
copyTo(java.lang.Object target) Implementation of the Copyable interface that copies the state of this DBObject to another instance. |
|
protected void |
copyToImpl(AbstractDBObject copy, DBObject copyParent, IDPolicy idPolicy) Implementation method for making a copy of this object. |
|
boolean |
equals(java.lang.Object other) |
|
protected boolean |
equalsImpl(AbstractDBObject other) Equals implementation for testing equality with another AbstractDBObject. |
|
DBObject |
findOwnedObject(DBObjectID id) Returns a child of this object that has the given ID. |
|
protected DBObject |
findOwnedObject(DBObjectID id, boolean deep) Finds an owned object with the given ID, optionally recursing into the owned object heirachy. |
|
DBObject |
findOwnedObject(java.lang.String type, java.lang.String name) Final implementation uses getChildrenImpl( String type ) and searches through the contained DBObjects by name. |
|
protected AbstractDBObject.ChildSupport |
getChildSupport(java.lang.String propName) |
|
DBObjectID |
getID() Retrieves the object ID associated with this object. |
|
java.lang.String |
getName() Retrieves the name of this object. |
|
DBObject[] |
getOwnedObjects() Final implementation calls getOwnedObjectsImpl with a null argument for the type. |
|
DBObject[] |
getOwnedObjects(java.lang.String... types) Final implementation calls getOwnedObjectsImpl with the given types. |
|
protected void |
getOwnedObjectsImpl(java.util.Collection<DBObject> objs, java.lang.String... types) Used by all the final children methods. |
|
java.util.Map |
getProperties() Returns null if no properties are set. |
|
java.lang.Object |
getProperty(java.lang.String key) Retrieves the value associated with a property. |
|
java.lang.Object |
getProperty(java.lang.String key, java.lang.Object defaultValue) Retrieves the value associated with a property. |
|
DBObjectID[] |
getReferenceIDs() Final implementation that calls the internal getReferenceIDsImpl() method. |
|
protected void |
getReferenceIDsImpl(java.util.Collection<DBObjectID> refs) Used by the final getReferenceID() implementation. |
|
int |
hashCode() |
|
protected void |
includeOwnedObject(java.util.Collection<DBObject> objs, DBObject obj, java.lang.String... types) |
|
protected boolean |
includesType(DBObject obj, java.lang.String... types) Use to check the types parameter when implementing the getOwnedObjectsImpl method. |
|
protected boolean |
includesType(java.lang.String type, java.lang.String... types) Use to check the types parameter when implementing the getOwnedObjectsImpl method. |
|
protected void |
removeThisAsParent(ChildDBObject child) If the given child object has this object as a parent, this method will remove the parent setting. |
|
boolean |
replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap) Override in subclasses to replace reference IDs as appropriate. |
|
void |
setID(DBObjectID id) Sets the object ID associated with this object. |
|
void |
setName(java.lang.String name) Sets the name of this object. |
|
void |
setProperties(java.util.Map properties) Sets the properties of this object to be those in the given Map. |
|
void |
setProperty(java.lang.String key, java.lang.Object value) Sets the value for a property. |
|
java.lang.String |
toString() |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.javatools.db.DBObject |
---|
getParent, getType |
Constructor Detail |
---|
protected AbstractDBObject()
protected AbstractDBObject(java.lang.String name)
name
- a string representing the name of this object.protected AbstractDBObject(java.lang.String name, DBObjectID id)
name
- a string representing the name of this object.id
- the id for this object.Method Detail |
---|
public final java.lang.Object copyTo(java.lang.Object target)
DBObject
null
is specified for the target, a new instance will be created.
The entire state of the object will be copied, with a few exceptions. In particular, any observers registered will NOT be copied. In cases where this instance contains child DBObjects, new instances of those children will be created, and the state copied to them. The copy will thus contain its own unique state; after making the copy, changing one instance will not cause any changes to occur to the copy. The properties will be copied; however, copies will not be made of the values referenced by the properties - thus, the copy will refer to the same instance as the original. Child objects that are copied will still point to the original parent; it is the responsibility of a copied parent to update the parent of copies of its children point to the copy of itself.
If the object, or any child object has an ID set, the equivalent object in the copy will be given a TemporaryObjectID that does not reference back to the original object. See DBObject.copyTo(DBObject, boolean)
for details.
copyTo
in interface DBObject
copyTo
in interface Copyable
target
- The object to copy to. If target is null
, a new instance will be created, and the state will be copied to that object.DBObject.copyTo(DBObject, boolean)
public final DBObject copyTo(DBObject target, boolean temporaryCopy)
DBObject
null
is specified for the target, a new instance will be created.
The entire state of the object will be copied. In cases where this instance contains child DBObjects, new instances of those children will be created, and the state copied to them. The copy will thus contain its own unique state; after making the copy, changing one instance will not cause any changes to occur to the copy. The properties will be copied; however, copies will not be made of the values referenced by the properties - thus, the copy will refer to the same instance as the original.
The includeID parameter governs what happens to any ids (on this object, or on any children). If true a TemporaryObjectID will be assigned to the copy of any DBObject, that points back to the original object. If false a TemporaryObjectID will be assigned to the copy of any DBObject that already has an ID, but it will not point back to the original.
copyTo
in interface DBObject
target
- The object to copy to. If target is null
, a new instance will be created, and the state will be copied to that object.temporaryCopy
- Whether to include a TemporaryObjectID that points back to the original for every object.TemporaryObjectID
, DBObject.copyTo(java.lang.Object)
public final DBObject copyTo(DBObject target, IDPolicy idPolicy)
DBObject
null
is specified for the target, a new instance will be created.
The entire state of the object will be copied. In cases where this instance contains child DBObjects, new instances of those children will be created, and the state copied to them. The copy will thus contain its own unique state; after making the copy, changing one instance will not cause any changes to occur to the copy. The properties will be copied; however, copies will not be made of the values referenced by the properties - thus, the copy will refer to the same instance as the original.
The idPolicy is used to control the IDs set on all objects in the copy.
copyTo
in interface DBObject
target
- The object to copy to. If target is null
, a new instance will be created, and the state will be copied to that object.idPolicy
- The policy for the IDs set in the copy.TemporaryObjectID
, DBObject.copyTo(java.lang.Object)
, DBObject.copyTo(DBObject, boolean)
protected final DBObject copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy)
This method does not fix internal reference ids on copy. That is done by the calling DBObject.copyTo(DBObject, IDPolicy)
method.
DBObject.copyTo(java.lang.Object)
, DBObject.copyTo(DBObject, boolean)
, copyToImpl(oracle.javatools.db.AbstractDBObject, oracle.javatools.db.DBObject, oracle.javatools.db.IDPolicy)
protected void copyToImpl(AbstractDBObject copy, DBObject copyParent, IDPolicy idPolicy)
copy
- the copy being created of this objectcopyParent
- if this object is being copied underneath a parent, this parameter is the copy of the parent of this object, which will therefore need to be the parent of the copy of this object.idPolicy
- the policy for copying the object's ID.protected <T> T copyObject(T value, DBObject copy, IDPolicy idPolicy)
public final boolean equals(java.lang.Object other)
equals
in class java.lang.Object
protected boolean equalsImpl(AbstractDBObject other)
protected int compareToImpl(AbstractDBObject target)
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void setName(java.lang.String name)
DBObject
setName
in interface DBObject
name
- a string containing the new name for this object.public java.lang.String getName()
DBObject
getName
in interface DBObject
public void setID(DBObjectID id)
DBObject
setID
in interface DBObject
id
- the DBObjectID to be associated with this objectpublic final DBObjectID getID()
DBObject
getID
in interface DBObject
public java.util.Map getProperties()
getProperties
in interface DynamicPropertySet
public java.lang.Object getProperty(java.lang.String key)
DynamicPropertySet
getProperty
in interface DynamicPropertySet
key
- the property key for which a value is desired. exists.null
value if the property does not exist or is not set.public final java.lang.Object getProperty(java.lang.String key, java.lang.Object defaultValue)
DynamicPropertySet
getProperty
in interface DynamicPropertySet
key
- the property key for which a value is desired.defaultValue
- the value to return if no value currently exists.public void setProperties(java.util.Map properties)
setProperties
in interface DynamicPropertySet
properties
- the new properties for this object.java.lang.ClassCastException
- if any key in the given Map isn't a String.public void setProperty(java.lang.String key, java.lang.Object value)
DynamicPropertySet
null
removes that property.setProperty
in interface DynamicPropertySet
key
- the property key to setvalue
- the value to setprotected final void removeThisAsParent(ChildDBObject child)
protected final void changeParent(ChildDBObject oldChild, ChildDBObject newChild)
public final DBObject[] getOwnedObjects()
getOwnedObjects
in interface DBObject
getOwnedObjectsImpl(java.util.Collection<oracle.javatools.db.DBObject>, java.lang.String...)
, DBObject.getOwnedObjects()
public final DBObject[] getOwnedObjects(java.lang.String... types)
getOwnedObjects
in interface DBObject
getOwnedObjectsImpl(java.util.Collection<oracle.javatools.db.DBObject>, java.lang.String...)
, DBObject.getOwnedObjects(java.lang.String...)
public final DBObject findOwnedObject(java.lang.String type, java.lang.String name)
findOwnedObject
in interface DBObject
type
- the DBObject type for the child to be returned (e.g. Column.TYPE
)name
- the name of the DBObject to be returnedgetOwnedObjectsImpl(java.util.Collection<oracle.javatools.db.DBObject>, java.lang.String...)
, DBObject.findOwnedObject(java.lang.String, java.lang.String)
public DBObject findOwnedObject(DBObjectID id)
findOwnedObject
in interface DBObject
id
- the id to look forprotected final DBObject findOwnedObject(DBObjectID id, boolean deep)
id
- the object ID to look fordeep
- whether to recurse further into owned objects' owned objects (and so on)protected void getOwnedObjectsImpl(java.util.Collection<DBObject> objs, java.lang.String... types)
includesType
to check the types vararg.types
- a vararg of the type(s) to search forobjs
- a Collection of the apppropriate children.includesType(java.lang.String, java.lang.String...)
protected final void includeOwnedObject(java.util.Collection<DBObject> objs, DBObject obj, java.lang.String... types)
protected final boolean includesType(java.lang.String type, java.lang.String... types)
if ( includesType( Column.TYPE, types ) ) ...
type
- the type we're interested intypes
- the types parameter passed to getOwnedObjectsImplprotected final boolean includesType(DBObject obj, java.lang.String... types)
if ( includesType( Column.TYPE, types ) ) ...
type
- the type we're interested intypes
- the types parameter passed to getOwnedObjectsImplpublic final DBObjectID[] getReferenceIDs()
getReferenceIDs
in interface DBObject
getReferenceIDsImpl(java.util.Collection<oracle.javatools.db.DBObjectID>)
, DBObject.getReferenceIDs()
protected void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
refs
- the collection of ids this object referencespublic boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
replaceReferenceIDs
in interface DBObject
idMap
- key = old DBObjectID, value = new DBObjectIDprotected final AbstractDBObject.ChildSupport getChildSupport(java.lang.String propName)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |