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

public Class Analyzer

extends Object
Class Inheritance
Imports
com.sun.tools.jdeps.Dependency.Location, java.io.BufferedReader, .IOException, .InputStream, .InputStreamReader, .UncheckedIOException, java.lang.module.ModuleDescriptor, java.util.Collections, .Comparator, .HashMap, .HashSet, .Map, .Objects, .Set, java.util.function.Predicate, java.util.stream.Collectors, .Stream

Dependency Analyzer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
pack-priv class
Analyzer.Dependences

Dependences contains the dependencies for an Archive that can have one or more classes.

pack-priv static interface
Analyzer.Filter

Filter to be applied when analyzing the dependencies from the given archives.

pack-priv static class
public static enum
Analyzer.Type

Type of the dependency analysis.

pack-priv static interface

Field Summary

Modifier and TypeField and Description
pack-priv static final Predicate<Archive>
protected final JdepsConfiguration
protected final Analyzer.Filter
protected final Map<Dependency.Location, Archive>
pack-priv static final Archive
pack-priv static final Analyzer.Jdk8Internals
protected final Map<Archive, Analyzer.Dependences>
protected final Analyzer.Type

Constructor Summary

AccessConstructor and Description
pack-priv
Analyzer(JdepsConfiguration config, Analyzer.Type
Type of the dependency analysis
type
,
Analyzer.Filter filter)

Constructs an Analyzer instance.

Method Summary

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

Returns the analyzed archives

pack-priv Set<String>
dependences(Archive source)

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

pack-priv boolean
hasDependences(Archive archive)

Returns true if the given archive has dependences.

pack-priv static boolean
notFound(Archive archive)

pack-priv Stream<Archive>
requires(Archive source)

Returns the direct dependences of the given source

pack-priv boolean
run(Iterable<? extends Archive> archives, Map<Dependency.Location, Archive> locationMap)

Performs the dependency analysis on the given archives.

pack-priv void
visitDependences(Archive source, Analyzer.Visitor v, Analyzer.Type level, Predicate<Archive> targetFilter)

Visit the dependencies of the given source.

pack-priv void
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANYback to summary
pack-priv static final Predicate<Archive> ANY
configurationback to summary
protected final JdepsConfiguration configuration
filterback to summary
protected final Analyzer.Filter filter
locationToArchiveback to summary
protected final Map<Dependency.Location, Archive> locationToArchive
NOT_FOUNDback to summary
pack-priv static final Archive NOT_FOUND
REMOVED_JDK_INTERNALSback to summary
pack-priv static final Analyzer.Jdk8Internals REMOVED_JDK_INTERNALS
resultsback to summary
protected final Map<Archive, Analyzer.Dependences> results
typeback to summary
protected final Analyzer.Type type

Constructor Detail

Analyzerback to summary
pack-priv Analyzer(JdepsConfiguration config, Analyzer.Type type, Analyzer.Filter filter)

Constructs an Analyzer instance.

Parameters
type:Analyzer.Type

Type of the dependency analysis

Method Detail

archivesback to summary
pack-priv Set<Archive> archives()

Returns the analyzed archives

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

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

hasDependencesback to summary
pack-priv boolean hasDependences(Archive archive)

Returns true if the given archive has dependences.

notFoundback to summary
pack-priv static boolean notFound(Archive archive)
requiresback to summary
pack-priv Stream<Archive> requires(Archive source)

Returns the direct dependences of the given source

runback to summary
pack-priv boolean run(Iterable<? extends Archive> archives, Map<Dependency.Location, Archive> locationMap)

Performs the dependency analysis on the given archives.

visitDependencesback to summary
pack-priv void visitDependences(Archive source, Analyzer.Visitor v, Analyzer.Type level, Predicate<Archive> targetFilter)

Visit the dependencies of the given source. If the requested level is SUMMARY, it will visit the required archives list.

visitDependencesback to summary
pack-priv void visitDependences(Archive source, Analyzer.Visitor v)
visitDependencesback to summary
pack-priv void visitDependences(Archive source, Analyzer.Visitor v, Analyzer.Type level)
com.sun.tools.jdeps back to summary

pack-priv Class Analyzer.Dep

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final Archive
pack-priv final String
pack-priv final Archive

Constructor Summary

AccessConstructor and Description
pack-priv
Dep(String origin, Archive originArchive, String target, Archive targetArchive)

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.

pack-priv String
pack-priv Archive
pack-priv String
pack-priv Archive
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

originback to summary
pack-priv final String origin
originArchiveback to summary
pack-priv final Archive originArchive
targetback to summary
pack-priv final String target
targetArchiveback to summary
pack-priv final Archive targetArchive

Constructor Detail

Depback to summary
pack-priv Dep(String origin, Archive originArchive, String target, Archive targetArchive)

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
originback to summary
pack-priv String origin()
originArchiveback to summary
pack-priv Archive originArchive()
targetback to summary
pack-priv String target()
targetArchiveback to summary
pack-priv Archive targetArchive()
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.

com.sun.tools.jdeps back to summary

pack-priv Class Analyzer.Dependences

extends Object
implements Visitor
Class Inheritance
All Implemented Interfaces
com.sun.tools.jdeps.Archive.Visitor

Dependences contains the dependencies for an Archive that can have one or more classes.

Field Summary

Modifier and TypeField and Description
protected final Archive
private Analyzer.Dep
protected final Set<Analyzer.Dep>
protected final Analyzer.Type
protected final Set<Archive>
protected final Predicate<Archive>

Constructor Summary

AccessConstructor and Description
pack-priv
Dependences(Archive archive, Analyzer.Type level)

pack-priv
Dependences(Archive archive, Analyzer.Type level, Predicate<Archive> targetFilter)

Method Summary

Modifier and TypeMethod and Description
protected Analyzer.Dep
pack-priv Set<Analyzer.Dep>
pack-priv Archive
private String
pack-priv Set<Archive>
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

archiveback to summary
protected final Archive archive
curDepback to summary
private Analyzer.Dep curDep
depsback to summary
protected final Set<Analyzer.Dep> deps
levelback to summary
protected final Analyzer.Type level
requiresback to summary
protected final Set<Archive> requires
targetFilterback to summary
protected final Predicate<Archive> targetFilter

Constructor Detail

Dependencesback to summary
pack-priv Dependences(Archive archive, Analyzer.Type level)
Dependencesback to summary
pack-priv Dependences(Archive archive, Analyzer.Type level, Predicate<Archive> targetFilter)

Method Detail

addDepback to summary
protected Analyzer.Dep addDep(Dependency.Location o, Dependency.Location t)
dependenciesback to summary
pack-priv Set<Analyzer.Dep> dependencies()
findArchiveback to summary
pack-priv Archive findArchive(Dependency.Location t)
getLocationNameback to summary
private String getLocationName(Dependency.Location o)
requiresback to summary
pack-priv Set<Archive> requires()
visitback to summary
public void visit(Dependency.Location o, Dependency.Location t)

Implements com.sun.tools.jdeps.Archive.Visitor.visit.

Annotations
@Override
com.sun.tools.jdeps back to summary

pack-priv Interface Analyzer.Filter

Known Direct Implementers
com.sun.tools.jdeps.JdepsFilter

Filter to be applied when analyzing the dependencies from the given archives. Only the accepted dependencies are recorded.

Method Summary

Modifier and TypeMethod and Description
public boolean
accepts(Dependency.Location origin, Archive originArchive, Dependency.Location target, Archive targetArchive)

Method Detail

acceptsback to summary
public boolean accepts(Dependency.Location origin, Archive originArchive, Dependency.Location target, Archive targetArchive)
com.sun.tools.jdeps back to summary

pack-priv Class Analyzer.Jdk8Internals

extends Module
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final String
private final Set<String>
private static final String
Inherited from com.sun.tools.jdeps.Module:
DEBUGJDK_UNSUPPORTEDUNNAMED_MODULE

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
isExported(String pn)

Overrides com.sun.tools.jdeps.Module.isExported.

Tests if the package of the given name is exported.

public boolean
public String
name()

Overrides com.sun.tools.jdeps.Module.name.

Returns module name

Inherited from com.sun.tools.jdeps.Module:
descriptorexportsgetModuleisAutomaticisExportedisJDKUnsupportedisNamedisOpenisOpenisSystemlocationpackagestoNormalModuletoStringtracetrace

Field Detail

JDK8_INTERNALSback to summary
private static final String JDK8_INTERNALS
jdk8Internalsback to summary
private final Set<String> jdk8Internals
NAMEback to summary
private static final String NAME

Constructor Detail

Jdk8Internalsback to summary
private Jdk8Internals()

Method Detail

containsback to summary
public boolean contains(Dependency.Location location)
isExportedback to summary
public boolean isExported(String pn)

Overrides com.sun.tools.jdeps.Module.isExported.

Doc from com.sun.tools.jdeps.Module.isExported.

Tests if the package of the given name is exported.

Annotations
@Override
isJDKback to summary
public boolean isJDK()

Overrides com.sun.tools.jdeps.Module.isJDK.

Annotations
@Override
nameback to summary
public String name()

Overrides com.sun.tools.jdeps.Module.name.

Doc from com.sun.tools.jdeps.Module.name.

Returns module name

Annotations
@Override
com.sun.tools.jdeps back to summary

public final Enum Analyzer.Type

extends Enum<Analyzer.Type>
Class Inheritance

Type of the dependency analysis. Appropriate level of data will be stored.

Field Summary

Modifier and TypeField and Description
public static final Analyzer.Type
public static final Analyzer.Type
public static final Analyzer.Type
public static final Analyzer.Type
public static final Analyzer.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

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

Field Detail

CLASSback to summary
public static final Analyzer.Type CLASS
MODULEback to summary
public static final Analyzer.Type MODULE
PACKAGEback to summary
public static final Analyzer.Type PACKAGE
SUMMARYback to summary
public static final Analyzer.Type SUMMARY
VERBOSEback to summary
public static final Analyzer.Type VERBOSE

Constructor Detail

Typeback to summary
private Type()

Method Detail

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

pack-priv Interface Analyzer.Visitor

Known Direct Implementers
com.sun.tools.jdeps.JdepsTask.SimpleDepVisitor, com.sun.tools.jdeps.JdepsWriter.DotFileWriter.DotFileFormatter, com.sun.tools.jdeps.JdepsWriter.DotFileWriter.SummaryDotFile, com.sun.tools.jdeps.JdepsWriter.SimpleWriter.RawOutputFormatter, com.sun.tools.jdeps.JdepsWriter.SimpleWriter.RawSummaryFormatter

Method Summary

Modifier and TypeMethod and Description
public void
visitDependence(String origin, Archive originArchive, String target, Archive targetArchive)

Visits a recorded dependency from origin to target which can be a fully-qualified classname, a package name, a module or archive name depending on the Analyzer's type.

Method Detail

visitDependenceback to summary
public void visitDependence(String origin, Archive originArchive, String target, Archive targetArchive)

Visits a recorded dependency from origin to target which can be a fully-qualified classname, a package name, a module or archive name depending on the Analyzer's type.