Class AsmClassReader.ForClassFileApi
java.lang.Object
net.bytebuddy.utility.AsmClassReader.ForClassFileApi
- All Implemented Interfaces:
AsmClassReader
- Enclosing interface:
AsmClassReader
@Enhance
public static class AsmClassReader.ForClassFileApi
extends Object
implements AsmClassReader
A class reader that is based upon the Class File API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceA dispatcher to interact withcodes.rafael.asmjdkbridge.JdkClassReader.Nested classes/interfaces inherited from interface AsmClassReader
AsmClassReader.Factory, AsmClassReader.ForAsm, AsmClassReader.ForClassFileApi -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ObjectThe class reader that represents the class file to be read.protected static final AsmClassReader.ForClassFileApi.JdkClassReaderA dispatcher to interact withcodes.rafael.asmjdkbridge.JdkClassReader.Fields inherited from interface AsmClassReader
NO_ATTRIBUTES -
Constructor Summary
ConstructorsConstructorDescriptionForClassFileApi(Object classReader) Creates a new class reader that is based upon the Class File API. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(org.objectweb.asm.ClassVisitor classVisitor, int flags) Accepts a class visitor to read a class.private static <T> TdoPrivileged(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.Returns the internal names of the represented class's interfaces.String[]Returns the internal name of the represented class.intReturns the modifiers of the represented class.Returns the internal name of the represented class's super class, ornullif no such class exists.<T> TUnwraps a class reader to the underlying reader mechanism.
-
Field Details
-
DISPATCHER
A dispatcher to interact withcodes.rafael.asmjdkbridge.JdkClassReader. -
classReader
The class reader that represents the class file to be read.
-
-
Constructor Details
-
ForClassFileApi
Creates a new class reader that is based upon the Class File API.- Parameters:
classReader- The class reader that represents the class file to be read.
-
-
Method Details
-
doPrivileged
A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.- Type Parameters:
T- The type of the action's resolved value.- Parameters:
action- The action to execute from a privileged context.- Returns:
- The action's resolved value.
-
unwrap
Unwraps a class reader to the underlying reader mechanism.- Specified by:
unwrapin interfaceAsmClassReader- Type Parameters:
T- The type to unwrap.- Parameters:
type- The type of the reader that should be unwrapped.- Returns:
- The unwrapped instance or
nullif the underlying instance does not represent this type.
-
getModifiers
public int getModifiers()Returns the modifiers of the represented class. The property is read, if possible, without parsing the entire class file.- Specified by:
getModifiersin interfaceAsmClassReader- Returns:
- The modifiers of the represented class.
-
getInternalName
Returns the internal name of the represented class. The property is read, if possible, without parsing the entire class file.- Specified by:
getInternalNamein interfaceAsmClassReader- Returns:
- The internal name of the represented class.
-
getSuperClassInternalName
Returns the internal name of the represented class's super class, ornullif no such class exists. The property is read, if possible, without parsing the entire class file.- Specified by:
getSuperClassInternalNamein interfaceAsmClassReader- Returns:
- The internal name of the represented class's super class, or
nullif no such class exists.
-
getInterfaceInternalNames
Returns the internal names of the represented class's interfaces. The property is read, if possible, without parsing the entire class file.- Specified by:
getInterfaceInternalNamesin interfaceAsmClassReader- Returns:
- Returns the internal names of the represented class's interfaces.
-
getSuperClassName
-
getInterfaceTypeName
-
accept
public void accept(org.objectweb.asm.ClassVisitor classVisitor, int flags) Accepts a class visitor to read a class.- Specified by:
acceptin interfaceAsmClassReader- Parameters:
classVisitor- The class visitor who should be used as a callback for a class file.flags- The flags to consider while reading a class.
-