Package org.objectweb.asm.tree
Class ClassNode
java.lang.Object
org.objectweb.asm.ClassVisitor
org.objectweb.asm.tree.ClassNode
public class ClassNode
extends org.objectweb.asm.ClassVisitor
A node that represents a class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe class's access flags (seeOpcodes).List<org.objectweb.asm.Attribute>The non standard attributes of this class.The fields of this class.The inner classes of this class.The internal names of the interfaces directly implemented by this class (seeType.getInternalName()).The runtime invisible annotations of this class.The runtime invisible type annotations of this class.The methods of this class.The module stored in this class.The internal name of this class (seeType.getInternalName()).The internal name of the nest host class of this class (seeType.getInternalName()).The internal names of the nest members of this class (seeType.getInternalName()).The internal name of the enclosing class of this class (seeType.getInternalName()).The name of the method that contains the class, or null if the class has no enclosing class, or is not enclosed in a method or constructor of its enclosing class (e.g. if it is enclosed in an instance initializer, static initializer, instance variable initializer, or class variable initializer).The descriptor of the method that contains the class, or null if the class has no enclosing class, or is not enclosed in a method or constructor of its enclosing class (e.g. if it is enclosed in an instance initializer, static initializer, instance variable initializer, or class variable initializer).The internal names of the permitted subclasses of this class (seeType.getInternalName()).The record components of this class.The signature of this class.The correspondence between source and compiled elements of this class.The name of the source file from which this class was compiled.The internal of name of the super class (seeType.getInternalName()).intThe class version.The runtime visible annotations of this class.The runtime visible type annotations of this class.Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(org.objectweb.asm.ClassVisitor classVisitor) Makes the given class visitor visit this class.voidcheck(int api) Checks that this class node is compatible with the given ASM API version.voidvisit(int version, int access, String name, String signature, String superName, String[] interfaces) org.objectweb.asm.AnnotationVisitorvisitAnnotation(String descriptor, boolean visible) voidvisitAttribute(org.objectweb.asm.Attribute attribute) voidvisitEnd()org.objectweb.asm.FieldVisitorvisitField(int access, String name, String descriptor, String signature, Object value) voidvisitInnerClass(String name, String outerName, String innerName, int access) org.objectweb.asm.MethodVisitorvisitMethod(int access, String name, String descriptor, String signature, String[] exceptions) org.objectweb.asm.ModuleVisitorvisitModule(String name, int access, String version) voidvisitNestHost(String nestHost) voidvisitNestMember(String nestMember) voidvisitOuterClass(String owner, String name, String descriptor) voidvisitPermittedSubclass(String permittedSubclass) org.objectweb.asm.RecordComponentVisitorvisitRecordComponent(String name, String descriptor, String signature) voidvisitSource(String file, String debug) org.objectweb.asm.AnnotationVisitorvisitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate
-
Field Details
-
version
public int versionThe class version. The minor version is stored in the 16 most significant bits, and the major version in the 16 least significant bits. -
access
public int accessThe class's access flags (seeOpcodes). This field also indicates if the class is deprecatedOpcodes.ACC_DEPRECATEDor a recordOpcodes.ACC_RECORD. -
name
The internal name of this class (seeType.getInternalName()). -
signature
The signature of this class. May be null. -
superName
-
interfaces
The internal names of the interfaces directly implemented by this class (seeType.getInternalName()). -
sourceFile
The name of the source file from which this class was compiled. May be null. -
sourceDebug
The correspondence between source and compiled elements of this class. May be null. -
module
The module stored in this class. May be null. -
outerClass
The internal name of the enclosing class of this class (seeType.getInternalName()). Must be null if this class is not a local or anonymous class. -
outerMethod
The name of the method that contains the class, or null if the class has no enclosing class, or is not enclosed in a method or constructor of its enclosing class (e.g. if it is enclosed in an instance initializer, static initializer, instance variable initializer, or class variable initializer). -
outerMethodDesc
The descriptor of the method that contains the class, or null if the class has no enclosing class, or is not enclosed in a method or constructor of its enclosing class (e.g. if it is enclosed in an instance initializer, static initializer, instance variable initializer, or class variable initializer). -
visibleAnnotations
The runtime visible annotations of this class. May be null. -
invisibleAnnotations
The runtime invisible annotations of this class. May be null. -
visibleTypeAnnotations
The runtime visible type annotations of this class. May be null. -
invisibleTypeAnnotations
The runtime invisible type annotations of this class. May be null. -
attrs
The non standard attributes of this class. May be null. -
innerClasses
The inner classes of this class. -
nestHostClass
The internal name of the nest host class of this class (seeType.getInternalName()). May be null. -
nestMembers
The internal names of the nest members of this class (seeType.getInternalName()). May be null. -
permittedSubclasses
The internal names of the permitted subclasses of this class (seeType.getInternalName()). May be null. -
recordComponents
The record components of this class. May be null. -
fields
The fields of this class. -
methods
The methods of this class.
-
-
Constructor Details
-
ClassNode
public ClassNode()Constructs a newClassNode. Subclasses must not use this constructor. Instead, they must use theClassNode(int)version.- Throws:
IllegalStateException- If a subclass calls this constructor.
-
ClassNode
public ClassNode(int api) Constructs a newClassNode.- Parameters:
api- the ASM API version implemented by this visitor. Must be one of theASMx values inOpcodes.
-
-
Method Details
-
visit
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) - Overrides:
visitin classorg.objectweb.asm.ClassVisitor
-
visitSource
- Overrides:
visitSourcein classorg.objectweb.asm.ClassVisitor
-
visitModule
- Overrides:
visitModulein classorg.objectweb.asm.ClassVisitor
-
visitNestHost
- Overrides:
visitNestHostin classorg.objectweb.asm.ClassVisitor
-
visitOuterClass
- Overrides:
visitOuterClassin classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
- Overrides:
visitAnnotationin classorg.objectweb.asm.ClassVisitor
-
visitTypeAnnotation
public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) - Overrides:
visitTypeAnnotationin classorg.objectweb.asm.ClassVisitor
-
visitAttribute
public void visitAttribute(org.objectweb.asm.Attribute attribute) - Overrides:
visitAttributein classorg.objectweb.asm.ClassVisitor
-
visitNestMember
- Overrides:
visitNestMemberin classorg.objectweb.asm.ClassVisitor
-
visitPermittedSubclass
- Overrides:
visitPermittedSubclassin classorg.objectweb.asm.ClassVisitor
-
visitInnerClass
- Overrides:
visitInnerClassin classorg.objectweb.asm.ClassVisitor
-
visitRecordComponent
public org.objectweb.asm.RecordComponentVisitor visitRecordComponent(String name, String descriptor, String signature) - Overrides:
visitRecordComponentin classorg.objectweb.asm.ClassVisitor
-
visitField
public org.objectweb.asm.FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) - Overrides:
visitFieldin classorg.objectweb.asm.ClassVisitor
-
visitMethod
public org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) - Overrides:
visitMethodin classorg.objectweb.asm.ClassVisitor
-
visitEnd
public void visitEnd()- Overrides:
visitEndin classorg.objectweb.asm.ClassVisitor
-
check
public void check(int api) Checks that this class node is compatible with the given ASM API version. This method checks that this node, and all its children recursively, do not contain elements that were introduced in more recent versions of the ASM API than the given version.- Parameters:
api- an ASM API version. Must be one of theASMx values inOpcodes.
-
accept
public void accept(org.objectweb.asm.ClassVisitor classVisitor) Makes the given class visitor visit this class.- Parameters:
classVisitor- a class visitor.
-