public class CircularDependenciesDetector extends MonitoredDependencyAnalyzer
Constructor and Description |
---|
CircularDependenciesDetector(IAnalyzableElement elementToAnalyze)
Initialize the new instance with an element to analyze.
|
CircularDependenciesDetector(IAnalyzableElement elementToAnalyze,
IProgressMonitor monitor)
Initialize the new instance with an element to analyze and a monitor.
|
Modifier and Type | Method and Description |
---|---|
CircularDependenciesDetector |
analyze()
Starts the analyzing of the underlying element and all its contained classes.
|
protected boolean |
areAllInSameContainer(ClassInformation[] classInfos) |
protected boolean |
areAllInSamePackage(ClassInformation[] classInfos) |
protected boolean |
areAllInSamePackageBranch(ClassInformation[] classInfos) |
protected org.pfsw.util.CollectionUtil |
coll() |
protected void |
collectCircularDependencyPaths(ClassInformation[] classInfos)
Collects all the circular dependency paths for each of the given classes.
|
protected void |
debugPrint(ClassInformation[] path) |
CircularDependenciesResult |
detectCircularDependencies(ClassInformation... classInfos)
Detect all the circular dependency paths for each of the given classes.
|
protected void |
findCircularDependencyPaths(ProcessingClassNode startNode,
ClassInformation[] classInfos)
Collects all the circular dependency paths between the given start class
and any of the given classes or referred classes of these.
|
protected ProcessingClassNode |
findOrCreate(ClassInformation classInfo)
Looks for the given class in the class registry and returns the
corresponding ProcessingClassNode.
|
protected java.util.Map<ClassInformation,ProcessingClassNode> |
getNodeRegistry() |
protected java.util.Stack<ProcessingClassNode> |
getNodeStack() |
int |
getNumberOfElementsToAnalyze()
Returns the number of elements this analyzer is processing.
|
CircularDependenciesResult |
getResult()
returns the result of the last
detectCircularDependencies(ClassInformation...)
or analyze() execution. |
protected boolean |
ignoreCyclesInSameContainer() |
protected boolean |
ignoreCyclesInSamePackage() |
protected boolean |
ignoreCyclesInSamePackageBranch() |
protected boolean |
ignoreThirdPartyLibraries() |
protected int |
indexOfTopLevelClass(ClassInformation[] classInfos) |
protected boolean |
isInnerClassDependencyCycle(ClassInformation[] path) |
protected void |
keepCircularDependency(ProcessingClassNode classNode) |
protected void |
resetRegisteredNodes()
Reset the state of all registered class nodes to new.
|
void |
setIgnoreCyclesInSameContainer(boolean newValue) |
void |
setIgnoreCyclesInSamePackage(boolean newValue) |
void |
setIgnoreCyclesInSamePackageBranch(boolean newValue) |
void |
setIgnoreThirdPartyLibraries(boolean newValue) |
protected void |
setNodeRegistry(java.util.Map<ClassInformation,ProcessingClassNode> newValue) |
protected void |
setNodeStack(java.util.Stack<ProcessingClassNode> newValue) |
protected void |
setResult(CircularDependenciesResult newValue) |
protected java.lang.String |
shortestPackageName(ClassInformation[] classInfos) |
protected ClassInformation[] |
stackToArray() |
getAnalyzedElement, getProgressMonitor, getWorkset, isCancelled, resetProcessingCounter, setAnalyzedElement, setIsCancelled, setProgressMonitor, showProgress
public CircularDependenciesDetector(IAnalyzableElement elementToAnalyze)
public CircularDependenciesDetector(IAnalyzableElement elementToAnalyze, IProgressMonitor monitor)
public CircularDependenciesDetector analyze()
analyze
in class MonitoredDependencyAnalyzer
public int getNumberOfElementsToAnalyze()
getNumberOfElementsToAnalyze
in class MonitoredDependencyAnalyzer
public CircularDependenciesResult detectCircularDependencies(ClassInformation... classInfos)
public void setIgnoreCyclesInSamePackage(boolean newValue)
public CircularDependenciesResult getResult()
detectCircularDependencies(ClassInformation...)
or analyze()
execution.public void setIgnoreCyclesInSamePackageBranch(boolean newValue)
public void setIgnoreCyclesInSameContainer(boolean newValue)
public void setIgnoreThirdPartyLibraries(boolean newValue)
protected void collectCircularDependencyPaths(ClassInformation[] classInfos)
protected void findCircularDependencyPaths(ProcessingClassNode startNode, ClassInformation[] classInfos)
protected ProcessingClassNode findOrCreate(ClassInformation classInfo)
protected void resetRegisteredNodes()
protected void keepCircularDependency(ProcessingClassNode classNode)
protected ClassInformation[] stackToArray()
protected boolean isInnerClassDependencyCycle(ClassInformation[] path)
protected boolean areAllInSamePackage(ClassInformation[] classInfos)
protected boolean areAllInSamePackageBranch(ClassInformation[] classInfos)
protected boolean areAllInSameContainer(ClassInformation[] classInfos)
protected int indexOfTopLevelClass(ClassInformation[] classInfos)
protected java.lang.String shortestPackageName(ClassInformation[] classInfos)
protected void debugPrint(ClassInformation[] path)
protected java.util.Map<ClassInformation,ProcessingClassNode> getNodeRegistry()
protected void setNodeRegistry(java.util.Map<ClassInformation,ProcessingClassNode> newValue)
protected java.util.Stack<ProcessingClassNode> getNodeStack()
protected void setNodeStack(java.util.Stack<ProcessingClassNode> newValue)
protected void setResult(CircularDependenciesResult newValue)
protected boolean ignoreCyclesInSamePackage()
protected boolean ignoreCyclesInSamePackageBranch()
protected boolean ignoreCyclesInSameContainer()
protected boolean ignoreThirdPartyLibraries()
protected org.pfsw.util.CollectionUtil coll()