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

public Class ClassFinder

extends Object
Class Inheritance
Imports
java.io.IOException, java.lang.classfile.ClassFile, .ClassModel, java.net.URI, java.nio.file.FileSystem, .FileSystems, .Files, .NoSuchFileException, .Path, .Paths, java.util.ArrayList, .List, .Optional, java.util.jar.JarEntry, .JarFile, java.util.stream.Stream

A simple search path for classes.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
ClassFinder.DirPathEntry

An entry that represents a directory containing a class hierarchy.

pack-priv class
ClassFinder.JarPathEntry

An entry that represents a jar file.

pack-priv class
ClassFinder.JrtPathEntry

An entry that represents the JRT filesystem in the running image.

pack-priv static interface
ClassFinder.PathEntry

An entry in this finder's class path.

Field Summary

Modifier and TypeField and Description
pack-priv final List<ClassFinder.PathEntry>
pack-priv final boolean

Constructor Summary

AccessConstructor and Description
public
ClassFinder(boolean verbose)

Method Summary

Modifier and TypeMethod and Description
public void
addDir(String
the directory to add
dirName
)

Adds a directory to this finder's search path, ignoring errors.

public void
addJar(String
the jar file name to add
jarName
)

Adds a jar file to this finder's search path, ignoring errors.

public void
addJrt()

Adds the JRT filesystem to this finder's search path.

public ClassModel

Returns:

a ClassFile instance, or null if not found
find
(String
the class to search for
className
)

Searches the class path for a class with the given name, returning a ClassFile for it.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

listback to summary
pack-priv final List<ClassFinder.PathEntry> list
verboseback to summary
pack-priv final boolean verbose

Constructor Detail

ClassFinderback to summary
public ClassFinder(boolean verbose)

Method Detail

addDirback to summary
public void addDir(String dirName)

Adds a directory to this finder's search path, ignoring errors.

Parameters
dirName:String

the directory to add

addJarback to summary
public void addJar(String jarName)

Adds a jar file to this finder's search path, ignoring errors.

Parameters
jarName:String

the jar file name to add

addJrtback to summary
public void addJrt()

Adds the JRT filesystem to this finder's search path.

findback to summary
public ClassModel find(String className)

Searches the class path for a class with the given name, returning a ClassFile for it. Returns null if not found.

Parameters
className:String

the class to search for

Returns:ClassModel

a ClassFile instance, or null if not found

com.sun.tools.jdeprscan.scan back to summary

pack-priv Class ClassFinder.DirPathEntry

extends Object
implements PathEntry
Class Inheritance
All Implemented Interfaces
com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry

An entry that represents a directory containing a class hierarchy.

Field Summary

Modifier and TypeField and Description
pack-priv final Path

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ClassModel
find(String className)

Implements com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Returns a ClassFile instance corresponding to this name, or null if it's not present in this entry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dirback to summary
pack-priv final Path dir

Constructor Detail

DirPathEntryback to summary
pack-priv DirPathEntry(Path dir)

Method Detail

findback to summary
public ClassModel find(String className)

Implements com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Doc from com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Returns a ClassFile instance corresponding to this name, or null if it's not present in this entry.

Annotations
@Override
com.sun.tools.jdeprscan.scan back to summary

pack-priv Class ClassFinder.JarPathEntry

extends Object
implements PathEntry
Class Inheritance
All Implemented Interfaces
com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry

An entry that represents a jar file.

Field Summary

Modifier and TypeField and Description
pack-priv final JarFile

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ClassModel
find(String className)

Implements com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Returns a ClassFile instance corresponding to this name, or null if it's not present in this entry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jarFileback to summary
pack-priv final JarFile jarFile

Constructor Detail

JarPathEntryback to summary
pack-priv JarPathEntry(JarFile jf)

Method Detail

findback to summary
public ClassModel find(String className)

Implements com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Doc from com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Returns a ClassFile instance corresponding to this name, or null if it's not present in this entry.

Annotations
@Override
com.sun.tools.jdeprscan.scan back to summary

pack-priv Class ClassFinder.JrtPathEntry

extends Object
implements PathEntry
Class Inheritance
All Implemented Interfaces
com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry

An entry that represents the JRT filesystem in the running image. JRT filesystem structure is: /packages// where modlink is a symbolic link to /modules/ which is the top of the usual package-class hierarchy

Field Summary

Modifier and TypeField and Description
pack-priv final FileSystem

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ClassModel
find(String className)

Implements com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Returns a ClassFile instance corresponding to this name, or null if it's not present in this entry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fsback to summary
pack-priv final FileSystem fs

Constructor Detail

JrtPathEntryback to summary
pack-priv JrtPathEntry()

Method Detail

findback to summary
public ClassModel find(String className)

Implements com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Doc from com.sun.tools.jdeprscan.scan.ClassFinder.PathEntry.find.

Returns a ClassFile instance corresponding to this name, or null if it's not present in this entry.

Annotations
@Override
com.sun.tools.jdeprscan.scan back to summary

pack-priv Interface ClassFinder.PathEntry

Known Direct Implementers
com.sun.tools.jdeprscan.scan.ClassFinder.JarPathEntry, com.sun.tools.jdeprscan.scan.ClassFinder.DirPathEntry, com.sun.tools.jdeprscan.scan.ClassFinder.JrtPathEntry

An entry in this finder's class path.

Method Summary

Modifier and TypeMethod and Description
public ClassModel

Returns:

a ClassFile instance, or null if not found
find
(String
the class to search for
className
)

Returns a ClassFile instance corresponding to this name, or null if it's not present in this entry.

Method Detail

findback to summary
public ClassModel find(String className)

Returns a ClassFile instance corresponding to this name, or null if it's not present in this entry.

Parameters
className:String

the class to search for

Returns:ClassModel

a ClassFile instance, or null if not found