Package net.bytebuddy.dynamic
Class ClassFileLocator.Compound
- java.lang.Object
-
- net.bytebuddy.dynamic.ClassFileLocator.Compound
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ClassFileLocator
- Enclosing interface:
- ClassFileLocator
@Enhance public static class ClassFileLocator.Compound extends java.lang.Object implements ClassFileLocator, java.io.Closeable
A compoundClassFileLocator
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.AgentBased, ClassFileLocator.Compound, ClassFileLocator.ForClassLoader, ClassFileLocator.ForFolder, ClassFileLocator.ForJarFile, ClassFileLocator.ForModule, ClassFileLocator.ForModuleFile, ClassFileLocator.ForUrl, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Resolution, ClassFileLocator.Simple
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ClassFileLocator>
classFileLocators
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
-
-
Constructor Summary
Constructors Constructor Description Compound(java.util.List<? extends ClassFileLocator> classFileLocators)
Creates a new compound class file locator.Compound(ClassFileLocator... classFileLocator)
Creates a new compound class file locator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
classFileLocators
private final java.util.List<ClassFileLocator> classFileLocators
TheClassFileLocator
s which are represented by this compound class file locator in the order of their application.
-
-
Constructor Detail
-
Compound
public Compound(ClassFileLocator... classFileLocator)
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
public Compound(java.util.List<? extends ClassFileLocator> classFileLocators)
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 Detail
-
locate
public ClassFileLocator.Resolution locate(java.lang.String name) throws java.io.IOException
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:
java.io.IOException
- If reading a class file causes an error.
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-