public static class ClassFileLocator.ForClassLoader extends Object implements ClassFileLocator
ClassFileLocator.AgentBased, ClassFileLocator.Compound, ClassFileLocator.ForClassLoader, ClassFileLocator.ForFolder, ClassFileLocator.ForJarFile, ClassFileLocator.NoOp, ClassFileLocator.Resolution, ClassFileLocator.Simple
CLASS_FILE_EXTENSION
Modifier | Constructor and Description |
---|---|
protected |
ForClassLoader(ClassLoader classLoader)
Creates a new class file locator for the given class loader.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
ClassFileLocator.Resolution |
locate(String typeName)
Locates the class file for a given type and returns the binary data of the class file.
|
static ClassFileLocator |
of(ClassLoader classLoader)
Creates a class file locator for a given class loader.
|
static ClassFileLocator |
ofClassPath()
Creates a class file locator that queries the system class loader.
|
static ClassFileLocator.Resolution |
read(Class<?> type)
Attemts to create a binary representation of a loaded type by requesting data from its
ClassLoader . |
String |
toString() |
protected ForClassLoader(ClassLoader classLoader)
classLoader
- The class loader to query which must not be the bootstrap class loader, i.e. null
.public static ClassFileLocator ofClassPath()
public static ClassFileLocator of(ClassLoader classLoader)
classLoader
- The class loader to be used. If this class loader represents the bootstrap class
loader which is represented by the null
value, this system class loader
is used instead.public static ClassFileLocator.Resolution read(Class<?> type)
ClassLoader
.type
- The type of interest.public ClassFileLocator.Resolution locate(String typeName) throws IOException
ClassFileLocator
locate
in interface ClassFileLocator
typeName
- The name of the type to locate a class file representation for.IOException
- If reading a class file causes an error.Copyright © 2014–2015. All rights reserved.