APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.tools.jdeps

public Class DepsAnalyzer

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.tools.jdeps.InverseDepsAnalyzer, com.sun.tools.jdeps.ModuleExportsAnalyzer
Imports
com.sun.tools.jdeps.Dependency.Location, java.io.IOException, java.util.ArrayList, .Deque, .LinkedHashSet, .LinkedList, .List, .Optional, .Set, java.util.concurrent.ConcurrentLinkedDeque, java.util.stream.Collectors, .Stream

Dependency Analyzer. Type of filters: source filter: -include target filter: -package, -regex, --require The initial archive set for analysis includes 1. archives specified in the command line arguments 2. observable modules matching the source filter 3. classpath archives matching the source filter or target filter 4. --add-modules and -m root modules

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static class

Field Summary

Modifier and TypeField and Description
pack-priv final Analyzer
pack-priv final boolean
pack-priv final Set<Archive>
pack-priv final JdepsConfiguration
pack-priv final JdepsFilter
pack-priv final DependencyFinder
pack-priv final List<Archive>
pack-priv final Analyzer.Type
pack-priv final JdepsWriter

Constructor Summary

AccessConstructor and Description
public
DepsAnalyzer(JdepsConfiguration config, JdepsFilter filter, JdepsWriter writer, Analyzer.Type verbose, boolean apiOnly)

Method Summary

Modifier and TypeMethod and Description
private void
pack-priv Set<Archive>
archives()

Returns the archives for reporting that has matching dependences.

public Graph<DepsAnalyzer.Node>
dependenceGraph()

Returns a graph of dependences.

pack-priv Set<String>
dependences()

Returns the dependences, either class name or package name as specified in the given verbose level.

public boolean
include(Archive source)

public Graph<DepsAnalyzer.Node>
moduleGraph()

Returns a graph of module dependences.

public boolean
run()

public boolean
run(boolean compileTimeView, int
depth of recursive analysis. depth == 0 if -R is set
maxDepth
)

Perform compile-time view or run-time view dependency analysis.

private void
private void
transitiveDeps(int depth)

private Set<Archive>
unresolvedArchives(Stream<Dependency.Location> locations)

Returns the archives that contains the given locations and not parsed and analyzed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

analyzerback to summary
pack-priv final Analyzer analyzer
apiOnlyback to summary
pack-priv final boolean apiOnly
archivesback to summary
pack-priv final Set<Archive> archives
configurationback to summary
pack-priv final JdepsConfiguration configuration
filterback to summary
pack-priv final JdepsFilter filter
finderback to summary
pack-priv final DependencyFinder finder
rootArchivesback to summary
pack-priv final List<Archive> rootArchives
verboseback to summary
pack-priv final Analyzer.Type verbose
writerback to summary
pack-priv final JdepsWriter writer

Constructor Detail

DepsAnalyzerback to summary
public DepsAnalyzer(JdepsConfiguration config, JdepsFilter filter, JdepsWriter writer, Analyzer.Type verbose, boolean apiOnly)

Method Detail

addEdgeback to summary
private void addEdge(Graph.Builder<DepsAnalyzer.Node> builder, Analyzer.Dep dep)
archivesback to summary
pack-priv Set<Archive> archives()

Returns the archives for reporting that has matching dependences. If --require is set, they should be excluded.

dependenceGraphback to summary
public Graph<DepsAnalyzer.Node> dependenceGraph()

Returns a graph of dependences. Each Node represents a class or package per the specified verbose level. Each edge indicates

dependencesback to summary
pack-priv Set<String> dependences()

Returns the dependences, either class name or package name as specified in the given verbose level.

includeback to summary
public boolean include(Archive source)
moduleGraphback to summary
public Graph<DepsAnalyzer.Node> moduleGraph()

Returns a graph of module dependences. Each Node represents a module and each edge is a dependence. No analysis on "requires transitive".

runback to summary
public boolean run() throws IOException
runback to summary
public boolean run(boolean compileTimeView, int maxDepth) throws IOException

Perform compile-time view or run-time view dependency analysis.

Parameters
maxDepth:int

depth of recursive analysis. depth == 0 if -R is set

transitiveArchiveDepsback to summary
private void transitiveArchiveDeps(int depth) throws IOException
transitiveDepsback to summary
private void transitiveDeps(int depth) throws IOException
unresolvedArchivesback to summary
private Set<Archive> unresolvedArchives(Stream<Dependency.Location> locations)

Returns the archives that contains the given locations and not parsed and analyzed.

com.sun.tools.jdeps back to summary

public final Enum DepsAnalyzer.Info

extends Enum<DepsAnalyzer.Info>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final DepsAnalyzer.Info
public static final DepsAnalyzer.Info
public static final DepsAnalyzer.Info
public static final DepsAnalyzer.Info
public static final DepsAnalyzer.Info
public static final DepsAnalyzer.Info
public static final DepsAnalyzer.Info
public static final DepsAnalyzer.Info

Constructor Summary

AccessConstructor and Description
private
Info()

Method Summary

Modifier and TypeMethod and Description
public static DepsAnalyzer.Info
public static DepsAnalyzer.Info[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXPORTED_APIback to summary
public static final DepsAnalyzer.Info EXPORTED_API
INTERNAL_APIback to summary
public static final DepsAnalyzer.Info INTERNAL_API
JDK_INTERNAL_APIback to summary
public static final DepsAnalyzer.Info JDK_INTERNAL_API
JDK_REMOVED_INTERNAL_APIback to summary
public static final DepsAnalyzer.Info JDK_REMOVED_INTERNAL_API
MODULE_PRIVATEback to summary
public static final DepsAnalyzer.Info MODULE_PRIVATE
QUALIFIED_EXPORTED_APIback to summary
public static final DepsAnalyzer.Info QUALIFIED_EXPORTED_API
REQUIRESback to summary
public static final DepsAnalyzer.Info REQUIRES
REQUIRES_TRANSITIVEback to summary
public static final DepsAnalyzer.Info REQUIRES_TRANSITIVE

Constructor Detail

Infoback to summary
private Info()

Method Detail

valueOfback to summary
public static DepsAnalyzer.Info valueOf(String name)
valuesback to summary
public static DepsAnalyzer.Info[] values()
com.sun.tools.jdeps back to summary

public Class DepsAnalyzer.Node

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final DepsAnalyzer.Info
public final String
public final String

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
Node(String name, String source, DepsAnalyzer.Info info)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

infoback to summary
public final DepsAnalyzer.Info info
nameback to summary
public final String name
sourceback to summary
public final String source

Constructor Detail

Nodeback to summary
pack-priv Node(String name, DepsAnalyzer.Info info)
Nodeback to summary
pack-priv Node(String name, String source, DepsAnalyzer.Info info)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override