|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.ClassExtensionRegistry
public class ClassExtensionRegistry
The ClassExtensionRegistry class provides a convenient and consistent way to cache ClassExtension subclasses. All ClassExtensions must know the class for which they are implemented so that the FieldPath can compare its _previousCalssExtension's class and possible avoid a hash lookup. The ClassExtensionRegistry allows for registering ClassExtension instances by targetClass (where targetClass may be an interface). The lookup algorithm for a ClassExtension for a given class is recursive. Upon looking up a ClassExtension for a given target object, the ClassExtensionRegistry will recurse up the target object's superclass chain and interface inheritance graph until it finds a match. To avoid doing this recursion each time, a clone of the ClassExtension is registered for each subclass as the recursion unwinds. The next time the target object's ClassExtension is sought, it will be found immediately without recursion. Of course, this applies for all subclasses between the base class and the target object as those wil have been cloned/registered along the way.
Constructor Summary | |
---|---|
ClassExtensionRegistry()
constructred ClassExtensionRegistry. |
|
ClassExtensionRegistry(boolean addToGlobalRegistries)
Constructs a ClassExtensionRegistry. |
Method Summary | |
---|---|
java.lang.Object[] |
get()
Return an array of ClassExtension representing all the extensions that have been registered. |
ClassExtension |
get(java.lang.Class targetClass)
Lookup a classExtension whose class matches the class of target. |
ClassExtension |
get(java.lang.Object target)
Return the closest fitting ClassExtension for the given target Object, which must be non-null. |
ClassExtension |
getClassExtension(java.lang.Class targetClass)
Deprecated. use get(Object) |
static java.util.List |
getClassExtensions(java.lang.Class targetClass)
|
ClassExtension |
registerClassExtension(java.lang.Class targetClass,
ClassExtension classExtension)
Allow a ClassExtension implementation to be registered/cached for a given base class. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassExtensionRegistry()
public ClassExtensionRegistry(boolean addToGlobalRegistries)
addToGlobalRegistries
- whether to add myself to the
global list of ClassExtensionRegistries.Method Detail |
---|
public static java.util.List getClassExtensions(java.lang.Class targetClass)
public ClassExtension registerClassExtension(java.lang.Class targetClass, ClassExtension classExtension)
targetClass
- the class for which the classExtension applies.classExtension
- the classExtension to be registered.
public ClassExtension getClassExtension(java.lang.Class targetClass)
public ClassExtension get(java.lang.Class targetClass)
targetClass
- the for which the classExtension applies.
public ClassExtension get(java.lang.Object target)
public java.lang.Object[] get()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |