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 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 ClassFileLocatorThe actual class file locator to query for all other types.private final Plugin.Engine.Source.ElementThe corresponding source element.private final StringThe name of the represented type.Fields inherited from interface ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSourceEntryPrependingClassFileLocator(String name, Plugin.Engine.Source.Element element, ClassFileLocator delegate) Creates a class file locator that prepends aPlugin.Engine.Source.Element. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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:
locatein 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-