@HashCodeAndEqualsPlugin.Enhance public static class ClassFileLocator.ForUrl extends java.lang.Object implements ClassFileLocator
URLClassLoader
.
Doing so, boot loader resources might be located additionally to those found via the specified URLs.Modifier and Type | Class and Description |
---|---|
protected static class |
ClassFileLocator.ForUrl.ClassLoaderCreationAction
An action to create a class loader with the purpose of locating classes from an URL location.
|
ClassFileLocator.AgentBased, ClassFileLocator.Compound, ClassFileLocator.ForClassLoader, ClassFileLocator.ForFolder, ClassFileLocator.ForJarFile, ClassFileLocator.ForModule, ClassFileLocator.ForModuleFile, ClassFileLocator.ForUrl, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Resolution, ClassFileLocator.Simple
Modifier and Type | Field and Description |
---|---|
private java.lang.ClassLoader |
classLoader
The class loader that delegates to the URLs.
|
CLASS_FILE_EXTENSION
Constructor and Description |
---|
ForUrl(java.util.Collection<? extends java.net.URL> urls)
Creates a new class file locator for the given URLs.
|
ForUrl(java.net.URL... url)
Creates a new class file locator for the given URLs.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
ClassFileLocator.Resolution |
locate(java.lang.String name)
Locates the class file for a given type and returns the binary data of the class file.
|
private final java.lang.ClassLoader classLoader
public ForUrl(java.net.URL... url)
url
- The URLs to search for class files.public ForUrl(java.util.Collection<? extends java.net.URL> urls)
urls
- The URLs to search for class files.public ClassFileLocator.Resolution locate(java.lang.String name) throws java.io.IOException
locate
in interface ClassFileLocator
name
- The name of the type to locate a class file representation for.java.io.IOException
- If reading a class file causes an error.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException