|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.pogamut.posh.explorer.Crawler<T>
cz.cuni.pogamut.posh.explorer.ClassCrawler
public abstract class ClassCrawler
Crawl through all class and find the ones that fit the filter. This crawler
doesn't invoke any extra threads, all crawling is done in the crawl() method. The crawler looks for all classes that are subtypes/implement
class/interface with specified fully qualified name.
| Field Summary | |
|---|---|
protected String |
fqn
|
protected Set<org.netbeans.api.project.Project> |
projects
Project we will crawl over, source of classpath. |
| Fields inherited from class cz.cuni.pogamut.posh.explorer.Crawler |
|---|
cache, cacheUm, listeners, listenersUm |
| Constructor Summary | |
|---|---|
protected |
ClassCrawler(org.netbeans.api.project.Project project,
String fqn)
Create new crawler that will go through project and find all classes that are either subclass or implement class/interface with fqn. |
protected |
ClassCrawler(Set<org.netbeans.api.project.Project> projects,
String fqn)
Create new crawler that will go through all projects and find all classes that are either subclass or implement class/interface with fqn. |
| Method Summary | |
|---|---|
void |
crawl()
Start crawling for the primitives. |
void |
die()
Terminate the crawler, once this is called, crawler should die and liseners shouldn't recieve any further messages. |
protected Set<org.netbeans.api.java.source.ElementHandle<TypeElement>> |
getAllSubtypes(org.netbeans.api.java.source.ClassIndex ci,
org.netbeans.api.java.source.ElementHandle<TypeElement> ancestorTE)
Get all subtypes (either implemetors or subtypes) of certain TypeElement in the ClassIndex. |
protected org.netbeans.api.java.source.ClasspathInfo |
getClasspathInfo(org.netbeans.api.project.Project project)
Get ClasspathInfo for project. |
protected Set<org.netbeans.api.java.source.ElementHandle<TypeElement>> |
getDirectSubtypes(org.netbeans.api.java.source.ClassIndex ci,
org.netbeans.api.java.source.ElementHandle<TypeElement> ancestor)
Find all types that directly (=not transitively) implement ancestor type (extends/implemet). |
protected String |
getSimpleNameFromFQN(String fqn)
Get simple name from fqn of class |
protected org.netbeans.api.java.source.ElementHandle<TypeElement> |
getTypeOfClass(org.netbeans.api.java.source.ClassIndex ci,
String classfqn)
Find the ElementHandle of TypeElement of clazz in the passed ClassIndex. |
| Methods inherited from class cz.cuni.pogamut.posh.explorer.Crawler |
|---|
addListener, getDescription, getName, notifyCrawledData, notifyFinished, notifyStarted, removeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Set<org.netbeans.api.project.Project> projects
protected final String fqn
| Constructor Detail |
|---|
protected ClassCrawler(org.netbeans.api.project.Project project,
String fqn)
project - project in which (sources and dependencies) we will crawlfqn - Fully qualified name of class/interface that is ancestor for
all seeked classes.
protected ClassCrawler(Set<org.netbeans.api.project.Project> projects,
String fqn)
projects - All projects in which (sources and dependencies) we will
crawlfqn - Fully qualified name of class/interface that is ancestor for
all seeked classes.| Method Detail |
|---|
public final void crawl()
Crawler
crawl in class Crawler<PrimitiveData>CrawlerListenerpublic void die()
CrawlerCrawlerListener#finished(boolean) .
die in class Crawler<PrimitiveData>protected final org.netbeans.api.java.source.ClasspathInfo getClasspathInfo(org.netbeans.api.project.Project project)
ClasspathInfo for project. In most cases, you are interested in ClassIndex you can retrieve using
ClasspathInfo.getClassIndex().
If you need to owner project of some file, use FileOwnerQuery.
project - What project should I use to determine classpath?
ClassPath.BOOT, ClassPath.COMPILE, and ClassPath.SOURCEprotected final String getSimpleNameFromFQN(String fqn)
fqn - fully qualified name of some class, like (like java.lang.String)
protected final org.netbeans.api.java.source.ElementHandle<TypeElement> getTypeOfClass(org.netbeans.api.java.source.ClassIndex ci,
String classfqn)
ci - ClassIndex in which we are looking.clazz - class for which TypeElement we are looking
protected final Set<org.netbeans.api.java.source.ElementHandle<TypeElement>> getDirectSubtypes(org.netbeans.api.java.source.ClassIndex ci,
org.netbeans.api.java.source.ElementHandle<TypeElement> ancestor)
ci - classindedx in which we are lookingancestor - ancestor type
protected final Set<org.netbeans.api.java.source.ElementHandle<TypeElement>> getAllSubtypes(org.netbeans.api.java.source.ClassIndex ci,
org.netbeans.api.java.source.ElementHandle<TypeElement> ancestorTE)
types that either (transitively) extend or implement the ancestor.
ci - ClassIndex in which we are loookingancestorTE - type element that is the ancestor.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||