Class AnnotationEntry

java.lang.Object
org.apache.bcel.classfile.AnnotationEntry
All Implemented Interfaces:
Node, Constants

public class AnnotationEntry extends Object implements Node, Constants
represents one annotation in the annotation table
Since:
5.3
Version:
$Id: AnnotationEntry
Author:
D. Brosius
  • Constructor Details

    • AnnotationEntry

      public AnnotationEntry(int type_index, ConstantPool constant_pool, boolean isRuntimeVisible)
      Construct object from file stream.
      Parameters:
      file - Input stream
      Throws:
      IOException
  • Method Details

    • read

      public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool, boolean isRuntimeVisible) throws IOException
      Throws:
      IOException
    • accept

      public void accept(Visitor v)
      Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
      Specified by:
      accept in interface Node
      Parameters:
      v - Visitor object
    • getAnnotationType

      public String getAnnotationType()
      Returns:
      the annotation type name
    • getAnnotationTypeIndex

      public int getAnnotationTypeIndex()
      Returns:
      the annotation type index
    • getNumElementValuePairs

      public final int getNumElementValuePairs()
      Returns:
      the number of element value pairs in this annotation entry
    • getElementValuePairs

      public ElementValuePair[] getElementValuePairs()
      Returns:
      the element value pairs in this annotation entry
    • dump

      public void dump(DataOutputStream dos) throws IOException
      Throws:
      IOException
    • isRuntimeVisible

      public boolean isRuntimeVisible()
    • addElementNameValuePair

      public void addElementNameValuePair(ElementValuePair elementNameValuePair)
    • toShortString

      public String toShortString()