Package net.bytebuddy.utility
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 java.lang.Object implements AsmClassReader
A class reader that is based upon the Class File API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
AsmClassReader.ForClassFileApi.JdkClassReader
A dispatcher to interact withcodes.rafael.asmjdkbridge.JdkClassReader
.-
Nested classes/interfaces inherited from interface net.bytebuddy.utility.AsmClassReader
AsmClassReader.Factory, AsmClassReader.ForAsm, AsmClassReader.ForClassFileApi
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
classReader
The class reader that represents the class file to be read.protected static AsmClassReader.ForClassFileApi.JdkClassReader
DISPATCHER
A dispatcher to interact withcodes.rafael.asmjdkbridge.JdkClassReader
.-
Fields inherited from interface net.bytebuddy.utility.AsmClassReader
NO_ATTRIBUTES
-
-
Constructor Summary
Constructors Constructor Description ForClassFileApi(java.lang.Object classReader)
Creates a new class reader that is based upon the Class File API.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(org.objectweb.asm.ClassVisitor classVisitor, int flags)
Accepts a class visitor to read a class.private static <T> T
doPrivileged(java.security.PrivilegedAction<T> action)
A proxy forjava.security.AccessController#doPrivileged
that is activated if available.java.util.List<java.lang.String>
getInterfaceInternalNames()
Returns the internal names of the represented class's interfaces.java.lang.String[]
getInterfaceTypeName()
java.lang.String
getInternalName()
Returns the internal name of the represented class.int
getModifiers()
Returns the modifiers of the represented class.java.lang.String
getSuperClassInternalName()
Returns the internal name of the represented class's super class, ornull
if no such class exists.java.lang.String
getSuperClassName()
<T> T
unwrap(java.lang.Class<T> type)
Unwraps a class reader to the underlying reader mechanism.
-
-
-
Field Detail
-
DISPATCHER
protected static final AsmClassReader.ForClassFileApi.JdkClassReader DISPATCHER
A dispatcher to interact withcodes.rafael.asmjdkbridge.JdkClassReader
.
-
classReader
private final java.lang.Object classReader
The class reader that represents the class file to be read.
-
-
Method Detail
-
doPrivileged
@Enhance private static <T> T doPrivileged(java.security.PrivilegedAction<T> action)
A proxy forjava.security.AccessController#doPrivileged
that 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
@MaybeNull public <T> T unwrap(java.lang.Class<T> type)
Unwraps a class reader to the underlying reader mechanism.- Specified by:
unwrap
in interfaceAsmClassReader
- Type Parameters:
T
- The type to unwrap.- Parameters:
type
- The type of the reader that should be unwrapped.- Returns:
- The unwrapped instance or
null
if 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:
getModifiers
in interfaceAsmClassReader
- Returns:
- The modifiers of the represented class.
-
getInternalName
public java.lang.String getInternalName()
Returns the internal name of the represented class. The property is read, if possible, without parsing the entire class file.- Specified by:
getInternalName
in interfaceAsmClassReader
- Returns:
- The internal name of the represented class.
-
getSuperClassInternalName
@MaybeNull public java.lang.String getSuperClassInternalName()
Returns the internal name of the represented class's super class, ornull
if no such class exists. The property is read, if possible, without parsing the entire class file.- Specified by:
getSuperClassInternalName
in interfaceAsmClassReader
- Returns:
- The internal name of the represented class's super class, or
null
if no such class exists.
-
getInterfaceInternalNames
public java.util.List<java.lang.String> 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:
getInterfaceInternalNames
in interfaceAsmClassReader
- Returns:
- Returns the internal names of the represented class's interfaces.
-
getSuperClassName
@MaybeNull public java.lang.String getSuperClassName()
-
getInterfaceTypeName
@MaybeNull public java.lang.String[] getInterfaceTypeName()
-
accept
public void accept(org.objectweb.asm.ClassVisitor classVisitor, int flags)
Accepts a class visitor to read a class.- Specified by:
accept
in 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.
-
-