|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.fikin.pojostate.select.MethodsIterator
public class MethodsIterator
This class is used to build iterators over class and interface definitions.
It purpose is to allow for deep-hierarchy traversal over method's definition by discovering all interfaces defining it and all classes implementing it.
Traversal over method's overloading is configurable.
Traversal over interfaces or classes only is configurable.
Order of interfaces or classes first is configurable. created on Jul 19, 2005
Field Summary | |
---|---|
protected static java.lang.Class[] |
voidParams
|
Constructor Summary | |
---|---|
MethodsIterator()
|
Method Summary | |
---|---|
java.util.Enumeration |
getClassIterator(java.lang.Class objectOwnClazz,
java.lang.reflect.Method method,
java.lang.ClassLoader loader)
create an enumeration over all classes which implement or define the given method. |
boolean |
isIncludeClasses()
are interfaces only to be iterated over (when set to false) or classes are to be included too by default it is true |
boolean |
isIncludeInterfaces()
are only classes to be iterated over (when set to false) or interfaces to be included too by default it is true |
boolean |
isIncludeObjectClass()
is the object's own class to be included in the iteration. |
boolean |
isInclueSuperDefinitions()
is iteration to include also super definitions of overloaded methods by default true |
boolean |
isInterfacesFirst()
are interfaces first to be iterated by default true |
void |
setIncludeClasses(boolean includeClasses)
set to false if only interfaces are to be iterated over by default it is true |
void |
setIncludeInterfaces(boolean includeInterfaces)
set to false if only classes are to be iterated over i.e. no interfaces. |
void |
setIncludeObjectClass(boolean includeObjectClass)
set this to true if object's own class is to be iterated over too. |
void |
setInclueSuperDefinitions(boolean inclueSuperDefinitions)
set to true if iteration to include also super definitions of overloaded methods by default true |
void |
setInterfacesFirst(boolean interfacesFirst)
set to true is interfaces are to be iterated over first. |
protected boolean |
traverseClasses(java.util.Vector res,
java.lang.Class clazz,
java.lang.reflect.Method method)
traverse over class hierarchy and add what is found to the vector method overloading defined by isInclueSuperDefinitions() is
taken into account |
protected boolean |
traverseInterfaces(java.util.Vector res,
java.lang.Class clazz,
java.lang.reflect.Method method)
traverse over interfaces hierarchy and add what is found to the vector method overloading defined by isInclueSuperDefinitions() is
taken into account |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.Class[] voidParams
Constructor Detail |
---|
public MethodsIterator()
Method Detail |
---|
public void setInterfacesFirst(boolean interfacesFirst)
interfacesFirst
- The interfacesFirst to set.public boolean isInterfacesFirst()
public void setIncludeObjectClass(boolean includeObjectClass)
includeObjectClass
- The includeObjectClass to set.public boolean isIncludeObjectClass()
public void setInclueSuperDefinitions(boolean inclueSuperDefinitions)
inclueSuperDefinitions
- The inclueSuperDefinitions to set.public boolean isInclueSuperDefinitions()
public void setIncludeClasses(boolean includeClasses)
includeClasses
- The includeClasses to set.public boolean isIncludeClasses()
public void setIncludeInterfaces(boolean includeInterfaces)
includeInterfaces
- The includeInterfaces to set.public boolean isIncludeInterfaces()
public java.util.Enumeration getClassIterator(java.lang.Class objectOwnClazz, java.lang.reflect.Method method, java.lang.ClassLoader loader) throws java.lang.SecurityException
isInterfacesFirst()
defines if interfaces are to be first
in the list or last.
isIncludeObjectClass()
defines if object's own class will
be included too if the class itself does not implement the method.
objectOwnClazz
- is object's own classmethod
- is the method in particular to be examinedloader
- to be used
java.lang.SecurityException
protected boolean traverseInterfaces(java.util.Vector res, java.lang.Class clazz, java.lang.reflect.Method method) throws java.lang.SecurityException
isInclueSuperDefinitions()
is
taken into account
res
- clazz
- method
-
java.lang.SecurityException
protected boolean traverseClasses(java.util.Vector res, java.lang.Class clazz, java.lang.reflect.Method method) throws java.lang.SecurityException
isInclueSuperDefinitions()
is
taken into account
res
- clazz
- method
-
java.lang.SecurityException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |