Package net.bytebuddy.dynamic
Class ClassFileLocator.Filtering
- java.lang.Object
-
- net.bytebuddy.dynamic.ClassFileLocator.Filtering
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ClassFileLocator
- Enclosing interface:
- ClassFileLocator
@Enhance public static class ClassFileLocator.Filtering extends java.lang.Object implements ClassFileLocator
A class file locator that only applies for matched names.
-
-
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 delegate class file locator.private ElementMatcher<? super java.lang.String>
matcher
The matcher to determine if the delegate matcher is considered.-
Fields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS
-
-
Constructor Summary
Constructors Constructor Description Filtering(ElementMatcher<? super java.lang.String> matcher, ClassFileLocator delegate)
Creates a new filtering 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
-
matcher
private final ElementMatcher<? super java.lang.String> matcher
The matcher to determine if the delegate matcher is considered.
-
delegate
private final ClassFileLocator delegate
The delegate class file locator.
-
-
Constructor Detail
-
Filtering
public Filtering(ElementMatcher<? super java.lang.String> matcher, ClassFileLocator delegate)
Creates a new filtering class file locator.- Parameters:
matcher
- The matcher to determine if the delegate matcher is considered.delegate
- The delegate class file locator.
-
-
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
-
-