Package net.bytebuddy.dynamic
Class ClassFileLocator.Compound
java.lang.Object
net.bytebuddy.dynamic.ClassFileLocator.Compound
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClassFileLocator
- Enclosing interface:
ClassFileLocator
@Enhance
public static class ClassFileLocator.Compound
extends Object
implements ClassFileLocator, Closeable
A compound
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.ClassFileLocator
ClassFileLocator.Compound, ClassFileLocator.Filtering, ClassFileLocator.ForClassLoader, ClassFileLocator.ForFolder, ClassFileLocator.ForInstrumentation, ClassFileLocator.ForJarFile, ClassFileLocator.ForModule, ClassFileLocator.ForModuleFile, ClassFileLocator.ForUrl, ClassFileLocator.MultiReleaseAware, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Resolution, ClassFileLocator.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<ClassFileLocator> TheClassFileLocator
s which are represented by this compound class file locator in the order of their application.Fields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS
-
Constructor Summary
ConstructorsConstructorDescriptionCompound
(List<? extends ClassFileLocator> classFileLocators) Creates a new compound class file locator.Compound
(ClassFileLocator... classFileLocator) Creates a new compound class file locator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Locates the class file for a given type and returns the binary data of the class file.
-
Field Details
-
classFileLocators
TheClassFileLocator
s which are represented by this compound class file locator in the order of their application.
-
-
Constructor Details
-
Compound
Creates a new compound class file locator.- Parameters:
classFileLocator
- TheClassFileLocator
s to be represented by this compound class file locator in the order of their application.
-
Compound
Creates a new compound class file locator.- Parameters:
classFileLocators
- TheClassFileLocator
s to be represented by this compound class file locator in the order of their application.
-
-
Method Details
-
locate
Locates the class file for a given type and returns the binary data of the class file.- Specified by:
locate
in interfaceClassFileLocator
- Parameters:
name
- The name of the type to locate a class file representation for.- Returns:
- Any binary representation of the type which might be illegal.
- Throws:
IOException
- If reading a class file causes an error.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-