Package org.objectweb.asm.tree
Class FieldNode
- java.lang.Object
-
- org.objectweb.asm.FieldVisitor
-
- org.objectweb.asm.tree.FieldNode
-
public class FieldNode extends org.objectweb.asm.FieldVisitorA node that represents a field.
-
-
Field Summary
Fields Modifier and Type Field Description intaccessThe field's access flags (seeOpcodes).java.util.List<org.objectweb.asm.Attribute>attrsThe non standard attributes of this field. * May be null.java.lang.StringdescThe field's descriptor (seeType).java.util.List<AnnotationNode>invisibleAnnotationsThe runtime invisible annotations of this field.java.util.List<TypeAnnotationNode>invisibleTypeAnnotationsThe runtime invisible type annotations of this field.java.lang.StringnameThe field's name.java.lang.StringsignatureThe field's signature.java.lang.ObjectvalueThe field's initial value.java.util.List<AnnotationNode>visibleAnnotationsThe runtime visible annotations of this field.java.util.List<TypeAnnotationNode>visibleTypeAnnotationsThe runtime visible type annotations of this field.
-
Constructor Summary
Constructors Constructor Description FieldNode(int api, int access, java.lang.String name, java.lang.String descriptor, java.lang.String signature, java.lang.Object value)Constructs a newFieldNode.FieldNode(int access, java.lang.String name, java.lang.String descriptor, java.lang.String signature, java.lang.Object value)Constructs a newFieldNode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(org.objectweb.asm.ClassVisitor classVisitor)Makes the given class visitor visit this field.voidcheck(int api)Checks that this field node is compatible with the given ASM API version.org.objectweb.asm.AnnotationVisitorvisitAnnotation(java.lang.String descriptor, boolean visible)voidvisitAttribute(org.objectweb.asm.Attribute attribute)voidvisitEnd()org.objectweb.asm.AnnotationVisitorvisitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)
-
-
-
Field Detail
-
access
public int access
The field's access flags (seeOpcodes). This field also indicates if the field is synthetic and/or deprecated.
-
name
public java.lang.String name
The field's name.
-
desc
public java.lang.String desc
The field's descriptor (seeType).
-
signature
public java.lang.String signature
The field's signature. May be null.
-
value
public java.lang.Object value
The field's initial value. This field, which may be null if the field does not have an initial value, must be anInteger, aFloat, aLong, aDoubleor aString.
-
visibleAnnotations
public java.util.List<AnnotationNode> visibleAnnotations
The runtime visible annotations of this field. May be null.
-
invisibleAnnotations
public java.util.List<AnnotationNode> invisibleAnnotations
The runtime invisible annotations of this field. May be null.
-
visibleTypeAnnotations
public java.util.List<TypeAnnotationNode> visibleTypeAnnotations
The runtime visible type annotations of this field. May be null.
-
invisibleTypeAnnotations
public java.util.List<TypeAnnotationNode> invisibleTypeAnnotations
The runtime invisible type annotations of this field. May be null.
-
attrs
public java.util.List<org.objectweb.asm.Attribute> attrs
The non standard attributes of this field. * May be null.
-
-
Constructor Detail
-
FieldNode
public FieldNode(int access, java.lang.String name, java.lang.String descriptor, java.lang.String signature, java.lang.Object value)Constructs a newFieldNode. Subclasses must not use this constructor. Instead, they must use theFieldNode(int, int, String, String, String, Object)version.- Parameters:
access- the field's access flags (seeOpcodes). This parameter also indicates if the field is synthetic and/or deprecated.name- the field's name.descriptor- the field's descriptor (seeType).signature- the field's signature.value- the field's initial value. This parameter, which may be null if the field does not have an initial value, must be anInteger, aFloat, aLong, aDoubleor aString.- Throws:
java.lang.IllegalStateException- If a subclass calls this constructor.
-
FieldNode
public FieldNode(int api, int access, java.lang.String name, java.lang.String descriptor, java.lang.String signature, java.lang.Object value)Constructs a newFieldNode.- Parameters:
api- the ASM API version implemented by this visitor. Must be one ofOpcodes.ASM4,Opcodes.ASM5,Opcodes.ASM6,Opcodes.ASM7,Opcodes.ASM8orOpcodes.ASM9.access- the field's access flags (seeOpcodes). This parameter also indicates if the field is synthetic and/or deprecated.name- the field's name.descriptor- the field's descriptor (seeType).signature- the field's signature.value- the field's initial value. This parameter, which may be null if the field does not have an initial value, must be anInteger, aFloat, aLong, aDoubleor aString.
-
-
Method Detail
-
visitAnnotation
public org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String descriptor, boolean visible)- Overrides:
visitAnnotationin classorg.objectweb.asm.FieldVisitor
-
visitTypeAnnotation
public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)- Overrides:
visitTypeAnnotationin classorg.objectweb.asm.FieldVisitor
-
visitAttribute
public void visitAttribute(org.objectweb.asm.Attribute attribute)
- Overrides:
visitAttributein classorg.objectweb.asm.FieldVisitor
-
visitEnd
public void visitEnd()
- Overrides:
visitEndin classorg.objectweb.asm.FieldVisitor
-
check
public void check(int api)
Checks that this field 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 ofOpcodes.ASM4,Opcodes.ASM5,Opcodes.ASM6orOpcodes.ASM7.
-
accept
public void accept(org.objectweb.asm.ClassVisitor classVisitor)
Makes the given class visitor visit this field.- Parameters:
classVisitor- a class visitor.
-
-