Package net.bytebuddy.build
Class Plugin.Engine.Default.SourceEntryPrependingClassFileLocator
- java.lang.Object
-
- net.bytebuddy.build.Plugin.Engine.Default.SourceEntryPrependingClassFileLocator
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ClassFileLocator
- Enclosing class:
- Plugin.Engine.Default
@Enhance protected static class Plugin.Engine.Default.SourceEntryPrependingClassFileLocator extends java.lang.Object implements ClassFileLocator
A class file locator that shadows a givenPlugin.Engine.Source.Element
's type with the explicit element. This avoids that caching yields the wrong class file in case of multi-release jars.
-
-
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
Fields Modifier and Type Field Description private ClassFileLocator
delegate
The actual class file locator to query for all other types.private Plugin.Engine.Source.Element
element
The corresponding source element.private java.lang.String
name
The name of the represented type.-
Fields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SourceEntryPrependingClassFileLocator(java.lang.String name, Plugin.Engine.Source.Element element, ClassFileLocator delegate)
Creates a class file locator that prepends aPlugin.Engine.Source.Element
.
-
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
-
name
private final java.lang.String name
The name of the represented type.
-
element
private final Plugin.Engine.Source.Element element
The corresponding source element.
-
delegate
private final ClassFileLocator delegate
The actual class file locator to query for all other types.
-
-
Constructor Detail
-
SourceEntryPrependingClassFileLocator
protected SourceEntryPrependingClassFileLocator(java.lang.String name, Plugin.Engine.Source.Element element, ClassFileLocator delegate)
Creates a class file locator that prepends aPlugin.Engine.Source.Element
.- Parameters:
name
- The name of the represented type.element
- The corresponding source element.delegate
- The actual class file locator to query for all other types.
-
-
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
-
-