|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry5.ioc.internal.util.InheritanceSearch
public class InheritanceSearch
Used to search from a particular class up the inheritance hierarchy of extended classes and implemented interfaces.
The search starts with the initial class (provided in the constructor). It progresses up the inheritance chain, but skips java.lang.Object. Once classes are exhausted, the inheritance hiearchy is searched. This is a breadth-first search, rooted in the interfaces implemented by the initial class at its super classes. Once all interfaces are exhausted, java.lang.Object is returned (it is always returned last). Two minor tweak to normal inheritance rules:Iterable
interface, so it can be used directly in a for loop: for (Class
search : new InheritanceSearch(startClass)) { ... }
This class is not threadsafe.
Constructor Summary | |
---|---|
InheritanceSearch(java.lang.Class searchClass)
|
Method Summary | |
---|---|
boolean |
hasNext()
|
java.util.Iterator<java.lang.Class> |
iterator()
|
java.lang.Class |
next()
|
void |
remove()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InheritanceSearch(java.lang.Class searchClass)
Method Detail |
---|
public java.util.Iterator<java.lang.Class> iterator()
iterator
in interface java.lang.Iterable<java.lang.Class>
public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.Class>
public java.lang.Class next()
next
in interface java.util.Iterator<java.lang.Class>
public void remove()
remove
in interface java.util.Iterator<java.lang.Class>
java.lang.UnsupportedOperationException
- always
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |