|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.ClassExtension
public abstract class ClassExtension
The ClassExtension class is the abstract superclass for all ClassExtension subclasses. This class provides a slot for the intended class for the ClassExtension as well as an implementation of the clone() method. Both these methods are used by the ClassExtensionRegistry class which provide a convenient mechanism for caching Categories by their corresponding class. A ClassExtension is a collection of behavior/methods that can be associated with an existing class. Often, this is serves as a way to provide a concrete implementation for an 'interface' and attach that interface to existing classes. For example, the FieldValue interface uses the FieldValue_Object as the base implementation which is associated with the Object class. Categories can be subclassed when some of the behavior in a superclass' classExtension needs to be overridden. Often, a Cateogry will be implemented as a static innerclass so it may have access to the private instance variables of the class with which the ClassExtension is being associated. It should be noted that the ClassExtensionRegistry class will clone its registered Categories as needed to flesh out the cache so that each class which needs a Cateogry from the cache will be able to get it directly without traversing up the superclass chain. This is why we expose the setForClass() method -- to allow the ClassExtensionRegistry object the ability to clone and reset the forClass for each subclass for which the ClassExtension applies. The ClassExtensionRegistry uses the forClass variable to determine if the previousClassExtension can be used for the current target object.
Field Summary | |
---|---|
java.lang.Class |
forClass
|
Constructor Summary | |
---|---|
ClassExtension()
|
Method Summary | |
---|---|
java.lang.Object |
clone()
Allows for cloning existing Categories so that the same ClassExtension may be cached multiple times, once for each subclass that inherits the ClassExtension. |
java.lang.Class |
forClass()
Returns the forClass variable which indicates for which class this copy of the classExtension applies. |
static java.lang.Class |
getRealClass(java.lang.Object target)
Returns the real Class for the target object; if target is a kind of ClassProxy, call getRealClass on it, otherwise just call getClass. |
void |
setForClass(java.lang.Class classValue)
Sets the forClass variable which indicates for which class this copy of the classExtension applies. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.Class forClass
Constructor Detail |
---|
public ClassExtension()
Method Detail |
---|
public void setForClass(java.lang.Class classValue)
classValue
- the class for which this copy of the ClassExtension applies.public java.lang.Class forClass()
public java.lang.Object clone()
clone
in class java.lang.Object
public static java.lang.Class getRealClass(java.lang.Object target)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |