Methods Summary |
---|
public void | addAllObjectsForAbstractClass(java.lang.Class objectsClass, oracle.toplink.essentials.internal.sessions.AbstractSession session, java.util.Vector allObjects)Add all of the objects of the class and all of its subclasses.
The session is needed because there is no other way to find all subclasses.
ClassDescriptor descriptor = session.getDescriptor(objectsClass);
addAllObjectsForClass(objectsClass, allObjects);
for (Enumeration enumeration = descriptor.getInheritancePolicy().getChildDescriptors().elements();
enumeration.hasMoreElements();) {
addAllObjectsForAbstractClass(((ClassDescriptor)enumeration.nextElement()).getJavaClass(), session, allObjects);
}
|
public void | addAllObjectsForAbstractClass(java.lang.Class objectsClass, oracle.toplink.essentials.sessions.Session session, java.util.Vector allObjects)Add all of the objects of the class and all of its subclasses.
The session is needed because there is no other way to find all subclasses.
addAllObjectsForAbstractClass(objectsClass, (AbstractSession)session, allObjects);
|
public void | addAllObjectsForClass(java.lang.Class objectsClass, java.util.Vector allObjects)Add all of the objects of the class.
if (!getRegisteredObjects().containsKey(objectsClass)) {
return;
}
for (Enumeration enumeration = ((Hashtable)getRegisteredObjects().get(objectsClass)).elements();
enumeration.hasMoreElements();) {
allObjects.addElement(enumeration.nextElement());
}
|
public boolean | containsObject(java.lang.Class objectsClass, java.lang.String objectsName)Check if the object is registred given its name.
return ((getRegisteredObjects().containsKey(objectsClass)) && (((Hashtable)getRegisteredObjects().get(objectsClass)).containsKey(objectsName)));
|
public boolean | containsObject(java.lang.Object objectToCheck, java.lang.String objectsName)Check if the object is registred given its name.
return containsObject(objectToCheck.getClass(), objectsName);
|
public java.util.Vector | getAllClasses()Return all of the objects registered.
Vector allClasses = new Vector();
for (Enumeration e = getRegisteredObjects().keys(); e.hasMoreElements();) {
allClasses.addElement(e.nextElement());
}
return allClasses;
|
public java.util.Vector | getAllObjects()Return all of the objects registered.
Vector allObjects;
allObjects = new Vector();
for (Enumeration e = getAllClasses().elements(); e.hasMoreElements();) {
Class eachClass = (Class)e.nextElement();
addAllObjectsForClass(eachClass, allObjects);
}
return allObjects;
|
public java.util.Vector | getAllObjectsForAbstractClass(java.lang.Class objectsClass, oracle.toplink.essentials.internal.sessions.AbstractSession session)Return all of the objects of the class and all of its subclasses.
The session is needed because there is no other way to find all subclasses.
ClassDescriptor descriptor = session.getDescriptor(objectsClass);
Vector allObjects = new Vector();
addAllObjectsForClass(objectsClass, allObjects);
if (descriptor.hasInheritance()) {
for (Enumeration enumeration = descriptor.getInheritancePolicy().getChildDescriptors().elements();
enumeration.hasMoreElements();) {
addAllObjectsForClass(((ClassDescriptor)enumeration.nextElement()).getJavaClass(), allObjects);
}
}
return allObjects;
|
public java.util.Vector | getAllObjectsForAbstractClass(java.lang.Class objectsClass)Return all of the objects of the class and all of its subclasses.
Vector allObjects;
allObjects = new Vector();
// hummm, how can this be done....
return allObjects;
|
public java.util.Vector | getAllObjectsForClass(java.lang.Class objectsClass)Return all of the objects of the class.
Vector allObjects;
allObjects = new Vector();
addAllObjectsForClass(objectsClass, allObjects);
return allObjects;
|
public static oracle.toplink.essentials.tools.schemaframework.PopulationManager | getDefaultManager()Lazy initialize the default instance.
if (defaultManager == null) {
defaultManager = new PopulationManager();
}
return defaultManager;
|
public java.lang.Object | getObject(java.lang.Class objectsClass, java.lang.String objectsName)Return the object registred given its name.
if (!(getRegisteredObjects().containsKey(objectsClass))) {
return null;
}
return ((Hashtable)getRegisteredObjects().get(objectsClass)).get(objectsName);
|
public java.util.Hashtable | getRegisteredObjects()Return the registered objects.
return registeredObjects;
|
public java.lang.Object | registerObject(java.lang.Class javaClass, java.lang.Object objectToRegister, java.lang.String objectsName)Register the object given its name.
The objects are represented as a hashtable of hashtables, lazy initialized on the class.
if (!(getRegisteredObjects().containsKey(javaClass))) {
getRegisteredObjects().put(javaClass, new Hashtable());
}
((Hashtable)getRegisteredObjects().get(javaClass)).put(objectsName, objectToRegister);
return objectToRegister;
|
public java.lang.Object | registerObject(java.lang.Object objectToRegister, java.lang.String objectsName)Register the object given its name.
The objects are represented as a hashtable of hashtables, lazy initialized on the class.
if (!(getRegisteredObjects().containsKey(objectToRegister.getClass()))) {
getRegisteredObjects().put(objectToRegister.getClass(), new Hashtable());
}
((Hashtable)getRegisteredObjects().get(objectToRegister.getClass())).put(objectsName, objectToRegister);
return objectToRegister;
|
public void | removeObject(java.lang.Class classToRemove, java.lang.String objectsName)Remove the object given its class and name.
if (getRegisteredObjects().containsKey(classToRemove)) {
((Hashtable)getRegisteredObjects().get(classToRemove)).remove(objectsName);
}
|
public java.lang.Object | removeObject(java.lang.Object objectToRemove, java.lang.String objectsName)Remove the object given its name.
removeObject(objectToRemove.getClass(), objectsName);
return objectToRemove;
|
public static void | resetDefaultManager()Reset the default instance.
defaultManager = null;
|
public static void | setDefaultManager(oracle.toplink.essentials.tools.schemaframework.PopulationManager theDefaultManager)Set the default instance.
defaultManager = theDefaultManager;
|
public void | setRegisteredObjects(java.util.Hashtable registeredObjects)Set the registered objects.
this.registeredObjects = registeredObjects;
|