public class ContextMatcher extends Object implements ClassMatcher
This class needs to perform quite a bit of computations in order to gather the network of class releationships, so you are allowed to reuse it should you
Modifier and Type | Class and Description |
---|---|
private static class |
ContextMatcher.ClassGraphHack
A quick hack to compute class dependencies reusing ClassGraph but
without generating output.
|
private static class |
ContextMatcher.DevNullWriter
Simple dev/null imitation
|
Modifier and Type | Field and Description |
---|---|
(package private) ContextMatcher.ClassGraphHack |
cg |
(package private) boolean |
keepParentHide |
(package private) List<ClassDoc> |
matched |
(package private) Options |
opt
The options will be used to decide on inference
|
(package private) Pattern |
pattern |
(package private) RootDoc |
root |
(package private) Set<String> |
visited |
Constructor and Description |
---|
ContextMatcher(RootDoc root,
Pattern pattern,
Options options,
boolean keepParentHide)
Builds the context matcher
|
Modifier and Type | Method and Description |
---|---|
private void |
addToGraph(ClassDoc cd)
Adds the specified class to the internal class graph along with its
relations and depencies, eventually inferring them, according to the
Options specified for this matcher
|
boolean |
matches(ClassDoc cd)
Returns the options for the specified class.
|
boolean |
matches(String name)
Returns the options for the specified class.
|
void |
setContextCenter(Pattern pattern)
Can be used to setup a different pattern for this context matcher.
|
Pattern pattern
Options opt
RootDoc root
boolean keepParentHide
public ContextMatcher(RootDoc root, Pattern pattern, Options options, boolean keepParentHide) throws IOException
root
- The root doc returned by JavaDocpattern
- The pattern that will match the "center" of this
contextkeepParentHide
- If true, parent option hide patterns will be
preserved, so that classes hidden by the options won't
be shown in the contextIOException
public void setContextCenter(Pattern pattern)
This can be used to speed up subsequent matching with the same global options, since the class network informations will be reused.
pattern
- private void addToGraph(ClassDoc cd)
cd
- public boolean matches(ClassDoc cd)
ClassMatcher
matches
in interface ClassMatcher
ClassMatcher.matches(com.sun.javadoc.ClassDoc)
public boolean matches(String name)
ClassMatcher
matches
in interface ClassMatcher
ClassMatcher.matches(java.lang.String)