@HashCodeAndEqualsPlugin.Enhance public static class ClassFileLocator.Compound extends java.lang.Object implements ClassFileLocator, java.io.Closeable
ClassFileLocator
that chains several locators.
Any class file locator is queried in the supplied order until one locator is able to provide an input
stream of the class file.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.util.List<ClassFileLocator> |
classFileLocators
The
ClassFileLocator s which are represented by this compound
class file locator in the order of their application. |
CLASS_FILE_EXTENSION
Constructor and Description |
---|
Compound(ClassFileLocator... classFileLocator)
Creates a new compound class file locator.
|
Compound(java.util.List<? extends ClassFileLocator> classFileLocators)
Creates a new compound class file locator.
|
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.util.List<ClassFileLocator> classFileLocators
ClassFileLocator
s which are represented by this compound
class file locator in the order of their application.public Compound(ClassFileLocator... classFileLocator)
classFileLocator
- The ClassFileLocator
s to be
represented by this compound class file locator in the order of their application.public Compound(java.util.List<? extends ClassFileLocator> classFileLocators)
classFileLocators
- The ClassFileLocator
s to be represented by this compound class file locator in
the order of their application.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