ClassInfo objects, which stores both reachable classes
(obtained through a given class relationship, either by direct relationship or through an indirect path), and
directly related classes (classes reachable through a direct relationship only). (By default, accessing a
ClassInfoList as a List returns only reachable classes; by calling directOnly(), you can
get the directly related classes.)
Most ClassInfoList objects returned by ClassGraph are sorted into lexicographical order by the value of
ClassInfo#getName(). One exception to this is the classes returned by
ClassInfo#getSuperclasses(), which are in ascending order of the class hierarchy.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | ClassInfoList.
Filter a |
| Modifier and Type | Field and Description |
|---|---|
| private final transient Set | directlyRelatedClasses
Directly related classes. |
| pack-priv static final ClassInfoList | EMPTY_LIST
An unmodifiable empty |
| private static final long | serialVersionUID
Hides io. |
| private final boolean | sortByName
Whether to sort by name. |
| Access | Constructor and Description |
|---|---|
| pack-priv | ClassInfoList(final Set<ClassInfo>
reachable classes reachableClasses, final Set<ClassInfo> directly related classes directlyRelatedClasses, final boolean whether to sort by name sortByName)Construct a modifiable list of |
| pack-priv | ClassInfoList(final ClassInfo.
reachable and directly related classes reachableAndDirectlyRelatedClasses,whether to sort by name sortByName)Construct a modifiable list of |
| pack-priv | ClassInfoList(final Set<ClassInfo>
reachable classes reachableClasses, final boolean whether to sort by name sortByName)Construct a modifiable list of |
| public | |
| public | ClassInfoList(final int
the size hint. sizeHint)Construct a new empty modifiable list of |
| public | ClassInfoList(final Collection<ClassInfo>
the initial collection of classInfoCollection)ClassInfo objects to add to the ClassInfoList.Construct a new modifiable empty |
| Modifier and Type | Method and Description |
|---|---|
| public ClassInfoList | Returns: The list of directly-related classes.Get the list of classes that were directly related, as opposed to reachable through multiple steps. |
| public static ClassInfoList | Returns: the unmodifiable emptyClassInfoList.Return an unmodifiable empty |
| public boolean | equals(final Object
the object to be compared for equality with this list obj)Overrides io. Implements java. Compares the specified object with this list for equality. |
| public ClassInfoList | Returns: The set difference of thisClassInfoList and other, i.e. (this \ other).The other other)ClassInfoList to subtract from this one.Find the set difference between this |
| public ClassInfoList | Returns: The subset of thisClassInfoList for which the given filter predicate is true.The filterClassInfoFilter to apply.Find the subset of this |
| public String | Returns: the GraphViz file contents.The GraphViz layout width in inches. sizeX, final float The GraphViz layout width in inches. sizeY, final boolean If true, show fields within class nodes in the graph. showFields, final boolean If true, show edges between classes and the types of their fields. showFieldTypeDependencyEdges, final boolean If true, show methods within class nodes in the graph. showMethods, final boolean If true, show edges between classes and the return types and/or parameter types of their methods. showMethodTypeDependencyEdges, final boolean If true, show annotations in the graph. showAnnotations, final boolean whether to use simple names for classes in type signatures (if true, the package name is stripped
from class names in method and field type signatures). useSimpleNames)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. |
| public String | Returns: the GraphViz file contents.The GraphViz layout width in inches. sizeX, final float The GraphViz layout width in inches. sizeY, final boolean If true, show fields within class nodes in the graph. showFields, final boolean If true, show edges between classes and the types of their fields. showFieldTypeDependencyEdges, final boolean If true, show methods within class nodes in the graph. showMethods, final boolean If true, show edges between classes and the return types and/or parameter types of their methods. showMethodTypeDependencyEdges, final boolean If true, show annotations in the graph. showAnnotations)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. |
| public String | Returns: the GraphViz file contents.The GraphViz layout width in inches. sizeX, final float The GraphViz layout width in inches. sizeY)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. |
| public String | Returns: the GraphViz file contents.Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. |
| public void | generateGraphVizDotFile(final File
the file to save the GraphViz .dot file to. file)Generate a and save a .dot file, which can be fed into GraphViz for layout and visualization of the class graph. |
| public String | Returns: the GraphViz file contents.
Deprecated
Use
generateGraphVizDotFileFromInterClassDependencies() instead.
Deprecated: use |
| public String | Returns: the GraphViz file contents.The GraphViz layout width in inches. sizeX, final float The GraphViz layout width in inches. sizeY, final boolean If true, and if includeExternalClasses)ClassGraph#enableExternalClasses() was called before scanning, show
"external classes" (non-accepted classes) within the dependency graph.Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. |
| public String | Returns: the GraphViz file contents.The GraphViz layout width in inches. sizeX, final float The GraphViz layout width in inches. sizeY)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. |
| public String | Returns: the GraphViz file contents.Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. |
| public ClassInfoList | Returns: The filtered list, containing only annotations.Filter this |
| public ClassInfoList | Returns: The filtered list, containing only classes for whichassignableToClassRef.isAssignableFrom(listItemClassRef) is true for the corresponding
Class<?> references for assignableToClass and the list items. Returns the empty list if no
classes were assignable to the requested class.the superclass or interface to filter for. superclassOrInterface)Filter this |
| public ClassInfoList | Returns: The filtered list, containing only enums.Filter this |
| public ClassInfoList | Returns: The filtered list, containing only implemented interfaces.Filter this |
| public ClassInfoList | Returns: The filtered list, containing only interfaces.Filter this |
| public ClassInfoList | Returns: The filtered list, containing only interfaces.Filter this |
| public ClassInfoList | Returns: The filtered list, containing onlyrecord classes.Filter this |
| public ClassInfoList | Returns: The filtered list, containing only standard classes.Filter this |
| public int | hashCode()
Overrides io. Implements java. Returns the hash code value for this list. |
| public ClassInfoList | Returns: The intersection of thisClassInfoList with the others.The other others)ClassInfoLists to intersect with this one.Find the intersection of this |
| public < The superclass or interface. T> List | loadClasses(final Class<T>
The superclass or interface class reference to cast each loaded class to. superclassOrInterfaceType, final boolean If true, ignore any exceptions or errors thrown during classloading, or when attempting to cast
the resulting ignoreExceptions)Class<?> reference to the requested type -- instead, skip the element (i.e.
the returned list may contain fewer items than this input list). If false,
IllegalArgumentException is thrown if the class could not be loaded or could not be cast
to the requested type.Convert this list of |
| public < The superclass or interface. T> List | loadClasses(final Class<T>
The superclass or interface class reference to cast each loaded class to. superclassOrInterfaceType)Convert this list of |
| public List | loadClasses(final boolean
If true, ignore any exceptions or errors thrown during classloading. If an exception or error is
thrown during classloading, no ignoreExceptions)Class<?> reference is added to the output class for the
corresponding ClassInfo object, so the returned list may contain fewer items than this
input list. If false, IllegalArgumentException is thrown if the class could not be loaded.Convert this list of |
| public List | |
| public ClassInfoList | Returns: The union of thisClassInfoList with the others.The other others)ClassInfoLists to union with this one.Find the union of this |
| directlyRelatedClasses | back to summary |
|---|---|
| private final transient Set<ClassInfo> directlyRelatedClasses Directly related classes. | |
| EMPTY_LIST | back to summary |
|---|---|
| pack-priv static final ClassInfoList EMPTY_LIST An unmodifiable empty | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides io. serialVersionUID | |
| sortByName | back to summary |
|---|---|
| private final boolean sortByName Whether to sort by name. | |
| ClassInfoList | back to summary |
|---|---|
| pack-priv ClassInfoList(final Set<ClassInfo> reachableClasses, final Set<ClassInfo> directlyRelatedClasses, final boolean sortByName) Construct a modifiable list of | |
| ClassInfoList | back to summary |
|---|---|
| pack-priv ClassInfoList(final ClassInfo. Construct a modifiable list of
| |
| ClassInfoList | back to summary |
|---|---|
| pack-priv ClassInfoList(final Set<ClassInfo> reachableClasses, final boolean sortByName) Construct a modifiable list of | |
| ClassInfoList | back to summary |
|---|---|
| public ClassInfoList() Construct a new empty modifiable list of | |
| ClassInfoList | back to summary |
|---|---|
| public ClassInfoList(final int sizeHint) Construct a new empty modifiable list of
| |
| ClassInfoList | back to summary |
|---|---|
| public ClassInfoList(final Collection<ClassInfo> classInfoCollection) Construct a new modifiable empty
If the passed
| |
| directOnly | back to summary |
|---|---|
| public ClassInfoList directOnly() Get the list of classes that were directly related, as opposed to reachable through multiple steps. For
example, if this
| |
| emptyList | back to summary |
|---|---|
| public static ClassInfoList emptyList() Return an unmodifiable empty
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides io. Implements java. Doc from java. Compares the specified object with this list for equality. Returns
| |
| exclude | back to summary |
|---|---|
| public ClassInfoList exclude(final ClassInfoList other) Find the set difference between this
| |
| filter | back to summary |
|---|---|
| public ClassInfoList filter(final ClassInfoList. Find the subset of this
| |
| generateGraphVizDotFile | back to summary |
|---|---|
| public String generateGraphVizDotFile(final float sizeX, final float sizeY, final boolean showFields, final boolean showFieldTypeDependencyEdges, final boolean showMethods, final boolean showMethodTypeDependencyEdges, final boolean showAnnotations, final boolean useSimpleNames) Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. The sizeX and sizeY parameters are the image output size to use (in inches) when GraphViz is asked to render the .dot file.
To show non-public classes, call
To show fields, call
To show methods, call
To show annotations, call
| |
| generateGraphVizDotFile | back to summary |
|---|---|
| public String generateGraphVizDotFile(final float sizeX, final float sizeY, final boolean showFields, final boolean showFieldTypeDependencyEdges, final boolean showMethods, final boolean showMethodTypeDependencyEdges, final boolean showAnnotations) Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. The sizeX and sizeY parameters are the image output size to use (in inches) when GraphViz is asked to render the .dot file.
To show non-public classes, call
To show fields, call
To show methods, call
To show annotations, call This method uses simple names for class names in type signatures of fields and methods (package names are stripped).
| |
| generateGraphVizDotFile | back to summary |
|---|---|
| public String generateGraphVizDotFile(final float sizeX, final float sizeY) Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.
Methods, fields and annotations are shown if enabled, via
Only public classes, methods, and fields are shown, unless
| |
| generateGraphVizDotFile | back to summary |
|---|---|
| public String generateGraphVizDotFile() Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.
Methods, fields and annotations are shown if enabled, via
Only public classes, methods, and fields are shown, unless
| |
| generateGraphVizDotFile | back to summary |
|---|---|
| public void generateGraphVizDotFile(final File file) throws IOException Generate a and save a .dot file, which can be fed into GraphViz for layout and visualization of the class graph.
Methods, fields and annotations are shown if enabled, via
Only public classes, methods, and fields are shown, unless
| |
| generateGraphVizDotFileFromClassDependencies | back to summary |
|---|---|
| public String generateGraphVizDotFileFromClassDependencies()
Deprecated Use Deprecated: use
| |
| generateGraphVizDotFileFromInterClassDependencies | back to summary |
|---|---|
| public String generateGraphVizDotFileFromInterClassDependencies(final float sizeX, final float sizeY, final boolean includeExternalClasses) Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. The
returned graph shows inter-class dependencies only. The sizeX and sizeY parameters are the image output size
to use (in inches) when GraphViz is asked to render the .dot file. You must have called
| |
| generateGraphVizDotFileFromInterClassDependencies | back to summary |
|---|---|
| public String generateGraphVizDotFileFromInterClassDependencies(final float sizeX, final float sizeY) Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. The
returned graph shows inter-class dependencies only. The sizeX and sizeY parameters are the image output size
to use (in inches) when GraphViz is asked to render the .dot file. You must have called
Equivalent to calling
| |
| generateGraphVizDotFileFromInterClassDependencies | back to summary |
|---|---|
| public String generateGraphVizDotFileFromInterClassDependencies() Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. The
returned graph shows inter-class dependencies only. The sizeX and sizeY parameters are the image output size
to use (in inches) when GraphViz is asked to render the .dot file. You must have called
Equivalent to calling
| |
| getAnnotations | back to summary |
|---|---|
| public ClassInfoList getAnnotations() Filter this
| |
| getAssignableTo | back to summary |
|---|---|
| public ClassInfoList getAssignableTo(final ClassInfo superclassOrInterface) Filter this
| |
| getEnums | back to summary |
|---|---|
| public ClassInfoList getEnums() Filter this
| |
| getImplementedInterfaces | back to summary |
|---|---|
| public ClassInfoList getImplementedInterfaces() Filter this
| |
| getInterfaces | back to summary |
|---|---|
| public ClassInfoList getInterfaces() Filter this
| |
| getInterfacesAndAnnotations | back to summary |
|---|---|
| public ClassInfoList getInterfacesAndAnnotations() Filter this
| |
| getRecords | back to summary |
|---|---|
| public ClassInfoList getRecords() Filter this
| |
| getStandardClasses | back to summary |
|---|---|
| public ClassInfoList getStandardClasses() Filter this
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides io. Implements java. Doc from java. Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
This ensures that list1.equals(list2) implies that
list1.hashCode()==list2.hashCode() for any two lists,
list1 and list2, as required by the general
contract of Object#hashCode.
| |
| intersect | back to summary |
|---|---|
| public ClassInfoList intersect(final ClassInfoList... others) Find the intersection of this
| |
| loadClasses | back to summary |
|---|---|
| public <T> List Convert this list of Important Note since
| |
| loadClasses | back to summary |
|---|---|
| public <T> List Convert this list of Important Note since
| |
| loadClasses | back to summary |
|---|---|
| public List Convert this list of
| |
| loadClasses | back to summary |
|---|---|
| public List Convert this list of
| |
| union | back to summary |
|---|---|
| public ClassInfoList union(final ClassInfoList... others) Find the union of this
| |
ClassInfoList using a predicate mapping a ClassInfo object to a boolean, producing
another ClassInfoList for all items in the list for which the predicate is true.
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| accept | back to summary |
|---|---|
| public boolean accept(ClassInfo classInfo) Whether or not to allow a | |