Class ClassInfoList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- io.github.classgraph.PotentiallyUnmodifiableList<T>
-
- io.github.classgraph.InfoList<T>
-
- io.github.classgraph.MappableInfoList<ClassInfo>
-
- io.github.classgraph.ClassInfoList
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<ClassInfo>,java.util.Collection<ClassInfo>,java.util.List<ClassInfo>,java.util.RandomAccess
public class ClassInfoList extends MappableInfoList<ClassInfo>
A uniquified (deduplicated) list ofClassInfoobjects, 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 aClassInfoListas aListreturns only reachable classes; by callingdirectOnly(), you can get the directly related classes.)Most
ClassInfoListobjects returned by ClassGraph are sorted into lexicographical order by the value ofClassInfo.getName(). One exception to this is the classes returned byClassInfo.getSuperclasses(), which are in ascending order of the class hierarchy.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceClassInfoList.ClassInfoFilterFilter aClassInfoListusing a predicate mapping aClassInfoobject to a boolean, producing anotherClassInfoListfor all items in the list for which the predicate is true.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<ClassInfo>directlyRelatedClassesDirectly related classes.(package private) static ClassInfoListEMPTY_LISTAn unmodifiable emptyClassInfoList.private static longserialVersionUIDserialVersionUIDprivate booleansortByNameWhether to sort by name.-
Fields inherited from class io.github.classgraph.PotentiallyUnmodifiableList
modifiable
-
-
Constructor Summary
Constructors Constructor Description ClassInfoList()Construct a new empty modifiable list ofClassInfoobjects.ClassInfoList(int sizeHint)Construct a new empty modifiable list ofClassInfoobjects, given a size hint.ClassInfoList(ClassInfo.ReachableAndDirectlyRelatedClasses reachableAndDirectlyRelatedClasses, boolean sortByName)Construct a modifiable list ofClassInfoobjects.ClassInfoList(java.util.Collection<ClassInfo> classInfoCollection)Construct a new modifiable emptyClassInfoList, given an initial list ofClassInfoobjects.ClassInfoList(java.util.Set<ClassInfo> reachableClasses, boolean sortByName)Construct a modifiable list ofClassInfoobjects, where each class is directly related.ClassInfoList(java.util.Set<ClassInfo> reachableClasses, java.util.Set<ClassInfo> directlyRelatedClasses, boolean sortByName)Construct a modifiable list ofClassInfoobjects, consisting of reachable classes (obtained through the transitive closure) and directly related classes (one step away in the graph).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ClassInfoListdirectOnly()Get the list of classes that were directly related, as opposed to reachable through multiple steps.static ClassInfoListemptyList()Return an unmodifiable emptyClassInfoList.booleanequals(java.lang.Object obj)ClassInfoListexclude(ClassInfoList other)Find the set difference between thisClassInfoListand anotherClassInfoList, i.e.ClassInfoListfilter(ClassInfoList.ClassInfoFilter filter)Find the subset of thisClassInfoListfor which the given filter predicate is true.java.lang.StringgenerateGraphVizDotFile()Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.java.lang.StringgenerateGraphVizDotFile(float sizeX, float sizeY)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.java.lang.StringgenerateGraphVizDotFile(float sizeX, float sizeY, boolean showFields, boolean showFieldTypeDependencyEdges, boolean showMethods, boolean showMethodTypeDependencyEdges, boolean showAnnotations)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.java.lang.StringgenerateGraphVizDotFile(float sizeX, float sizeY, boolean showFields, boolean showFieldTypeDependencyEdges, boolean showMethods, boolean showMethodTypeDependencyEdges, boolean showAnnotations, boolean useSimpleNames)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.voidgenerateGraphVizDotFile(java.io.File file)Generate a and save a .dot file, which can be fed into GraphViz for layout and visualization of the class graph.java.lang.StringgenerateGraphVizDotFileFromClassDependencies()Deprecated.UsegenerateGraphVizDotFileFromInterClassDependencies()instead.java.lang.StringgenerateGraphVizDotFileFromInterClassDependencies()Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.java.lang.StringgenerateGraphVizDotFileFromInterClassDependencies(float sizeX, float sizeY)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.java.lang.StringgenerateGraphVizDotFileFromInterClassDependencies(float sizeX, float sizeY, boolean includeExternalClasses)Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph.ClassInfoListgetAnnotations()Filter thisClassInfoListto include only annotations.ClassInfoListgetAssignableTo(ClassInfo superclassOrInterface)Filter thisClassInfoListto include only classes that are assignable to the requested class, assignableToClass (i.e.ClassInfoListgetEnums()Filter thisClassInfoListto include onlyEnumclasses.ClassInfoListgetImplementedInterfaces()Filter thisClassInfoListto include only implemented interfaces, i.e.ClassInfoListgetInterfaces()Filter thisClassInfoListto include only interfaces that are not annotations.ClassInfoListgetInterfacesAndAnnotations()Filter thisClassInfoListto include only interfaces and annotations (annotations are interfaces, and can be implemented).ClassInfoListgetRecords()Filter thisClassInfoListto include onlyrecordclasses.ClassInfoListgetStandardClasses()Filter thisClassInfoListto include only standard classes (classes that are not interfaces or annotations).inthashCode()ClassInfoListintersect(ClassInfoList... others)Find the intersection of thisClassInfoListwith one or more others.java.util.List<java.lang.Class<?>>loadClasses()Convert this list ofClassInfoobjects to a list ofClass<?>objects.java.util.List<java.lang.Class<?>>loadClasses(boolean ignoreExceptions)Convert this list ofClassInfoobjects to a list ofClass<?>objects.<T> java.util.List<java.lang.Class<T>>loadClasses(java.lang.Class<T> superclassOrInterfaceType)Convert this list ofClassInfoobjects to a list ofClass<?>objects, casting each item in the list to the requested superclass or interface type.<T> java.util.List<java.lang.Class<T>>loadClasses(java.lang.Class<T> superclassOrInterfaceType, boolean ignoreExceptions)Convert this list ofClassInfoobjects to a list ofClass<?>objects, casting each item in the list to the requested superclass or interface type.ClassInfoListunion(ClassInfoList... others)Find the union of thisClassInfoListwith one or more others.-
Methods inherited from class io.github.classgraph.MappableInfoList
asMap, containsName, get
-
Methods inherited from class io.github.classgraph.InfoList
getAsStrings, getAsStringsWithSimpleNames, getNames
-
Methods inherited from class io.github.classgraph.PotentiallyUnmodifiableList
add, add, addAll, addAll, clear, iterator, listIterator, makeUnmodifiable, remove, remove, removeAll, retainAll, set
-
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, lastIndexOf, listIterator, removeIf, removeRange, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Field Detail
-
directlyRelatedClasses
private final transient java.util.Set<ClassInfo> directlyRelatedClasses
Directly related classes.
-
sortByName
private final boolean sortByName
Whether to sort by name.
-
serialVersionUID
private static final long serialVersionUID
serialVersionUID- See Also:
- Constant Field Values
-
EMPTY_LIST
static final ClassInfoList EMPTY_LIST
An unmodifiable emptyClassInfoList.
-
-
Constructor Detail
-
ClassInfoList
ClassInfoList(java.util.Set<ClassInfo> reachableClasses, java.util.Set<ClassInfo> directlyRelatedClasses, boolean sortByName)
Construct a modifiable list ofClassInfoobjects, consisting of reachable classes (obtained through the transitive closure) and directly related classes (one step away in the graph).- Parameters:
reachableClasses- reachable classesdirectlyRelatedClasses- directly related classessortByName- whether to sort by name
-
ClassInfoList
ClassInfoList(ClassInfo.ReachableAndDirectlyRelatedClasses reachableAndDirectlyRelatedClasses, boolean sortByName)
Construct a modifiable list ofClassInfoobjects.- Parameters:
reachableAndDirectlyRelatedClasses- reachable and directly related classessortByName- whether to sort by name
-
ClassInfoList
ClassInfoList(java.util.Set<ClassInfo> reachableClasses, boolean sortByName)
Construct a modifiable list ofClassInfoobjects, where each class is directly related.- Parameters:
reachableClasses- reachable classessortByName- whether to sort by name
-
ClassInfoList
public ClassInfoList()
Construct a new empty modifiable list ofClassInfoobjects.
-
ClassInfoList
public ClassInfoList(int sizeHint)
Construct a new empty modifiable list ofClassInfoobjects, given a size hint.- Parameters:
sizeHint- the size hint.
-
ClassInfoList
public ClassInfoList(java.util.Collection<ClassInfo> classInfoCollection)
Construct a new modifiable emptyClassInfoList, given an initial list ofClassInfoobjects.If the passed
Collectionis not aSet, then theClassInfoobjects will be uniquified (by adding them to a set) before they are added to the returned list.ClassInfoobjects in the returned list will be sorted by name.- Parameters:
classInfoCollection- the initial collection ofClassInfoobjects to add to theClassInfoList.
-
-
Method Detail
-
emptyList
public static ClassInfoList emptyList()
Return an unmodifiable emptyClassInfoList.- Returns:
- the unmodifiable empty
ClassInfoList.
-
loadClasses
public <T> java.util.List<java.lang.Class<T>> loadClasses(java.lang.Class<T> superclassOrInterfaceType, boolean ignoreExceptions)Convert this list ofClassInfoobjects to a list ofClass<?>objects, casting each item in the list to the requested superclass or interface type. Causes the classloader to load the class named by eachClassInfoobject, if it is not already loaded.Important note: since
superclassOrInterfaceTypeis a class reference for an already-loaded class, it is critical thatsuperclassOrInterfaceTypeis loaded by the same classloader as the class referred to by thisClassInfoobject, otherwise the class cast will fail.- Type Parameters:
T- The superclass or interface.- Parameters:
superclassOrInterfaceType- The superclass or interface class reference to cast each loaded class to.ignoreExceptions- If true, ignore any exceptions or errors thrown during classloading, or when attempting to cast the resultingClass<?>reference to the requested type -- instead, skip the element (i.e. the returned list may contain fewer items than this input list). If false,IllegalArgumentExceptionis thrown if the class could not be loaded or could not be cast to the requested type.- Returns:
- The loaded
Class<?>objects corresponding to eachClassInfoobject in this list. - Throws:
java.lang.IllegalArgumentException- if ignoreExceptions is false and an exception or error was thrown while trying to load or cast any of the classes.
-
loadClasses
public <T> java.util.List<java.lang.Class<T>> loadClasses(java.lang.Class<T> superclassOrInterfaceType)
Convert this list ofClassInfoobjects to a list ofClass<?>objects, casting each item in the list to the requested superclass or interface type. Causes the classloader to load the class named by eachClassInfoobject, if it is not already loaded.Important note: since
superclassOrInterfaceTypeis a class reference for an already-loaded class, it is critical thatsuperclassOrInterfaceTypeis loaded by the same classloader as the class referred to by thisClassInfoobject, otherwise the class cast will fail.- Type Parameters:
T- The superclass or interface.- Parameters:
superclassOrInterfaceType- The superclass or interface class reference to cast each loaded class to.- Returns:
- The loaded
Class<?>objects corresponding to eachClassInfoobject in this list. - Throws:
java.lang.IllegalArgumentException- if an exception or error was thrown while trying to load or cast any of the classes.
-
loadClasses
public java.util.List<java.lang.Class<?>> loadClasses(boolean ignoreExceptions)
Convert this list ofClassInfoobjects to a list ofClass<?>objects. Causes the classloader to load the class named by eachClassInfoobject, if it is not already loaded.- Parameters:
ignoreExceptions- If true, ignore any exceptions or errors thrown during classloading. If an exception or error is thrown during classloading, noClass<?>reference is added to the output class for the correspondingClassInfoobject, so the returned list may contain fewer items than this input list. If false,IllegalArgumentExceptionis thrown if the class could not be loaded.- Returns:
- The loaded
Class<?>objects corresponding to eachClassInfoobject in this list. - Throws:
java.lang.IllegalArgumentException- if ignoreExceptions is false and an exception or error was thrown while trying to load any of the classes.
-
loadClasses
public java.util.List<java.lang.Class<?>> loadClasses()
Convert this list ofClassInfoobjects to a list ofClass<?>objects. Causes the classloader to load the class named by eachClassInfoobject, if it is not already loaded.- Returns:
- The loaded
Class<?>objects corresponding to eachClassInfoobject in this list. - Throws:
java.lang.IllegalArgumentException- if an exception or error was thrown while trying to load any of the classes.
-
directOnly
public ClassInfoList directOnly()
Get the list of classes that were directly related, as opposed to reachable through multiple steps. For example, if thisClassInfoListwas produced by querying for all superclasses of a given class, thendirectOnly()will return only the direct superclass of this class.- Returns:
- The list of directly-related classes.
-
union
public ClassInfoList union(ClassInfoList... others)
Find the union of thisClassInfoListwith one or more others.- Parameters:
others- The otherClassInfoLists to union with this one.- Returns:
- The union of this
ClassInfoListwith the others.
-
intersect
public ClassInfoList intersect(ClassInfoList... others)
Find the intersection of thisClassInfoListwith one or more others.- Parameters:
others- The otherClassInfoLists to intersect with this one.- Returns:
- The intersection of this
ClassInfoListwith the others.
-
exclude
public ClassInfoList exclude(ClassInfoList other)
Find the set difference between thisClassInfoListand anotherClassInfoList, i.e. (this \ other).- Parameters:
other- The otherClassInfoListto subtract from this one.- Returns:
- The set difference of this
ClassInfoListand other, i.e. (this \ other).
-
filter
public ClassInfoList filter(ClassInfoList.ClassInfoFilter filter)
Find the subset of thisClassInfoListfor which the given filter predicate is true.- Parameters:
filter- TheClassInfoList.ClassInfoFilterto apply.- Returns:
- The subset of this
ClassInfoListfor which the given filter predicate is true.
-
getStandardClasses
public ClassInfoList getStandardClasses()
Filter thisClassInfoListto include only standard classes (classes that are not interfaces or annotations).- Returns:
- The filtered list, containing only standard classes.
-
getInterfaces
public ClassInfoList getInterfaces()
Filter thisClassInfoListto include only interfaces that are not annotations. See alsogetInterfacesAndAnnotations().- Returns:
- The filtered list, containing only interfaces.
-
getInterfacesAndAnnotations
public ClassInfoList getInterfacesAndAnnotations()
Filter thisClassInfoListto include only interfaces and annotations (annotations are interfaces, and can be implemented). See alsogetInterfaces().- Returns:
- The filtered list, containing only interfaces.
-
getImplementedInterfaces
public ClassInfoList getImplementedInterfaces()
Filter thisClassInfoListto include only implemented interfaces, i.e. non-annotation interfaces, or annotations that have been implemented by a class.- Returns:
- The filtered list, containing only implemented interfaces.
-
getAnnotations
public ClassInfoList getAnnotations()
Filter thisClassInfoListto include only annotations.- Returns:
- The filtered list, containing only annotations.
-
getEnums
public ClassInfoList getEnums()
Filter thisClassInfoListto include onlyEnumclasses.- Returns:
- The filtered list, containing only enums.
-
getRecords
public ClassInfoList getRecords()
Filter thisClassInfoListto include onlyrecordclasses.- Returns:
- The filtered list, containing only
recordclasses.
-
getAssignableTo
public ClassInfoList getAssignableTo(ClassInfo superclassOrInterface)
Filter thisClassInfoListto include only classes that are assignable to the requested class, assignableToClass (i.e. where assignableToClass is a superclass or implemented interface of the list element).- Parameters:
superclassOrInterface- the superclass or interface to filter for.- Returns:
- The filtered list, containing only classes for which
assignableToClassRef.isAssignableFrom(listItemClassRef)is true for the correspondingClass<?>references for assignableToClass and the list items. Returns the empty list if no classes were assignable to the requested class. - Throws:
java.lang.IllegalArgumentException- if classInfo is null.
-
generateGraphVizDotFileFromInterClassDependencies
public java.lang.String generateGraphVizDotFileFromInterClassDependencies(float sizeX, float sizeY, 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 calledClassGraph.enableInterClassDependencies()before scanning to use this method.- Parameters:
sizeX- The GraphViz layout width in inches.sizeY- The GraphViz layout width in inches.includeExternalClasses- If true, and ifClassGraph.enableExternalClasses()was called before scanning, show "external classes" (non-accepted classes) within the dependency graph.- Returns:
- the GraphViz file contents.
- Throws:
java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableInterClassDependencies()was not called before scanning (since there would be nothing to graph).
-
generateGraphVizDotFileFromInterClassDependencies
public java.lang.String generateGraphVizDotFileFromInterClassDependencies(float sizeX, 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 calledClassGraph.enableInterClassDependencies()before scanning to use this method.Equivalent to calling
generateGraphVizDotFileFromInterClassDependencies(float, float, boolean)with parameters of (10.5f, 8f, scanSpec.enableExternalClasses), where scanSpec.enableExternalClasses is true ifClassGraph.enableExternalClasses()was called before scanning.- Parameters:
sizeX- The GraphViz layout width in inches.sizeY- The GraphViz layout width in inches.- Returns:
- the GraphViz file contents.
- Throws:
java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableInterClassDependencies()was not called before scanning (since there would be nothing to graph).
-
generateGraphVizDotFileFromInterClassDependencies
public java.lang.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 calledClassGraph.enableInterClassDependencies()before scanning to use this method.Equivalent to calling
generateGraphVizDotFileFromInterClassDependencies(float, float, boolean)with parameters of (10.5f, 8f, scanSpec.enableExternalClasses), where scanSpec.enableExternalClasses is true ifClassGraph.enableExternalClasses()was called before scanning.- Returns:
- the GraphViz file contents.
- Throws:
java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableInterClassDependencies()was not called before scanning (since there would be nothing to graph).
-
generateGraphVizDotFileFromClassDependencies
@Deprecated public java.lang.String generateGraphVizDotFileFromClassDependencies()
Deprecated.UsegenerateGraphVizDotFileFromInterClassDependencies()instead.Deprecated: usegenerateGraphVizDotFileFromInterClassDependencies()instead.- Returns:
- the GraphViz file contents.
- Throws:
java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableInterClassDependencies()was not called before scanning (since there would be nothing to graph).
-
generateGraphVizDotFile
public java.lang.String generateGraphVizDotFile(float sizeX, float sizeY, boolean showFields, boolean showFieldTypeDependencyEdges, boolean showMethods, boolean showMethodTypeDependencyEdges, boolean showAnnotations, 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
ClassGraph.ignoreClassVisibility()before scanning.To show fields, call
ClassGraph.enableFieldInfo()before scanning. To show non-public fields, also callClassGraph.ignoreFieldVisibility()before scanning.To show methods, call
ClassGraph.enableMethodInfo()before scanning. To show non-public methods, also callClassGraph.ignoreMethodVisibility()before scanning.To show annotations, call
ClassGraph.enableAnnotationInfo()before scanning. To show non-public annotations, also callClassGraph.ignoreFieldVisibility()before scanning (there is no separate visibility modifier for annotations).- Parameters:
sizeX- The GraphViz layout width in inches.sizeY- The GraphViz layout width in inches.showFields- If true, show fields within class nodes in the graph.showFieldTypeDependencyEdges- If true, show edges between classes and the types of their fields.showMethods- If true, show methods within class nodes in the graph.showMethodTypeDependencyEdges- If true, show edges between classes and the return types and/or parameter types of their methods.showAnnotations- If true, show annotations in the graph.useSimpleNames- 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).- Returns:
- the GraphViz file contents.
- Throws:
java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableClassInfo()was not called before scanning (since there would be nothing to graph).
-
generateGraphVizDotFile
public java.lang.String generateGraphVizDotFile(float sizeX, float sizeY, boolean showFields, boolean showFieldTypeDependencyEdges, boolean showMethods, boolean showMethodTypeDependencyEdges, 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
ClassGraph.ignoreClassVisibility()before scanning.To show fields, call
ClassGraph.enableFieldInfo()before scanning. To show non-public fields, also callClassGraph.ignoreFieldVisibility()before scanning.To show methods, call
ClassGraph.enableMethodInfo()before scanning. To show non-public methods, also callClassGraph.ignoreMethodVisibility()before scanning.To show annotations, call
ClassGraph.enableAnnotationInfo()before scanning. To show non-public annotations, also callClassGraph.ignoreFieldVisibility()before scanning (there is no separate visibility modifier for annotations).This method uses simple names for class names in type signatures of fields and methods (package names are stripped).
- Parameters:
sizeX- The GraphViz layout width in inches.sizeY- The GraphViz layout width in inches.showFields- If true, show fields within class nodes in the graph.showFieldTypeDependencyEdges- If true, show edges between classes and the types of their fields.showMethods- If true, show methods within class nodes in the graph.showMethodTypeDependencyEdges- If true, show edges between classes and the return types and/or parameter types of their methods.showAnnotations- If true, show annotations in the graph.- Returns:
- the GraphViz file contents.
- Throws:
java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableClassInfo()was not called before scanning (since there would be nothing to graph).
-
generateGraphVizDotFile
public java.lang.String generateGraphVizDotFile(float sizeX, 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
ClassGraph.enableMethodInfo(),ClassGraph.enableFieldInfo()andClassGraph.enableAnnotationInfo().Only public classes, methods, and fields are shown, unless
ClassGraph.ignoreClassVisibility(),ClassGraph.ignoreMethodVisibility(), and/orClassGraph.ignoreFieldVisibility()has/have been called.- Parameters:
sizeX- The GraphViz layout width in inches.sizeY- The GraphViz layout width in inches.- Returns:
- the GraphViz file contents.
- Throws:
java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableClassInfo()was not called before scanning (since there would be nothing to graph).
-
generateGraphVizDotFile
public java.lang.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
ClassGraph.enableMethodInfo(),ClassGraph.enableFieldInfo()andClassGraph.enableAnnotationInfo().Only public classes, methods, and fields are shown, unless
ClassGraph.ignoreClassVisibility(),ClassGraph.ignoreMethodVisibility(), and/orClassGraph.ignoreFieldVisibility()has/have been called.- Returns:
- the GraphViz file contents.
- Throws:
java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableClassInfo()was not called before scanning (since there would be nothing to graph).
-
generateGraphVizDotFile
public void generateGraphVizDotFile(java.io.File file) throws java.io.IOExceptionGenerate 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
ClassGraph.enableMethodInfo(),ClassGraph.enableFieldInfo()andClassGraph.enableAnnotationInfo().Only public classes, methods, and fields are shown, unless
ClassGraph.ignoreClassVisibility(),ClassGraph.ignoreMethodVisibility(), and/orClassGraph.ignoreFieldVisibility()has/have been called.- Parameters:
file- the file to save the GraphViz .dot file to.- Throws:
java.io.IOException- if the file could not be saved.java.lang.IllegalArgumentException- if thisClassInfoListis empty orClassGraph.enableClassInfo()was not called before scanning (since there would be nothing to graph).
-
equals
public boolean equals(java.lang.Object obj)
-
-