Package net.bytebuddy.build
Class Plugin.Engine.Default.SourceEntryPrependingClassFileLocator
java.lang.Object
net.bytebuddy.build.Plugin.Engine.Default.SourceEntryPrependingClassFileLocator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClassFileLocator
- Enclosing class:
Plugin.Engine.Default
@Enhance
protected static class Plugin.Engine.Default.SourceEntryPrependingClassFileLocator
extends Object
implements ClassFileLocator
A class file locator that shadows a given
Plugin.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
FieldsModifier and TypeFieldDescriptionprivate final ClassFileLocator
The actual class file locator to query for all other types.private final Plugin.Engine.Source.Element
The corresponding source element.private final String
The name of the represented type.Fields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SourceEntryPrependingClassFileLocator
(String name, Plugin.Engine.Source.Element element, ClassFileLocator delegate) Creates a class file locator that prepends aPlugin.Engine.Source.Element
. -
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
-
name
The name of the represented type. -
element
The corresponding source element. -
delegate
The actual class file locator to query for all other types.
-
-
Constructor Details
-
SourceEntryPrependingClassFileLocator
protected SourceEntryPrependingClassFileLocator(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 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
-