Package org.apache.bcel.classfile

# Class AnnotationEntry

java.lang.Object
org.apache.bcel.classfile.AnnotationEntry

All Implemented Interfaces:
  `Node`

public class AnnotationEntry extends Object implements Node
Represents one annotation in the annotation table

Since:
  6.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final AnnotationEntry[]`
  `EMPTY_ARRAY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AnnotationEntry(int typeIndex, ConstantPool constantPool, boolean isRuntimeVisible)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `accept(Visitor v)`
  Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
  `void`
  `addElementNameValuePair(ElementValuePair elementNameValuePair)`
  `static AnnotationEntry[]`
  `createAnnotationEntries(Attribute[] attributes)`
  `void`
  `dump(DataOutputStream dos)`
  `String`
  `getAnnotationType()`
  `int`
  `getAnnotationTypeIndex()`
  `ConstantPool`
  `getConstantPool()`
  `ElementValuePair[]`
  `getElementValuePairs()`
  `final int`
  `getNumElementValuePairs()`
  `int`
  `getTypeIndex()`
  `boolean`
  `isRuntimeVisible()`
  `static AnnotationEntry`
  `read(DataInput input, ConstantPool constantPool, boolean isRuntimeVisible)`
  Factory method to create an AnnotionEntry from a DataInput
  `String`
  `toShortString()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### EMPTY_ARRAY

    public static final AnnotationEntry[] EMPTY_ARRAY

- ## Constructor Details

  - ### AnnotationEntry

    public AnnotationEntry(int typeIndex, ConstantPool constantPool, boolean isRuntimeVisible)

- ## Method Details

  - ### createAnnotationEntries

    public static AnnotationEntry[] createAnnotationEntries(Attribute[] attributes)

  - ### read

    public static AnnotationEntry read(DataInput input, ConstantPool constantPool, boolean isRuntimeVisible) throws IOException
    Factory method to create an AnnotionEntry from a DataInput
    Parameters:
      `input` -
      `constantPool` -
      `isRuntimeVisible` -
    Returns:
      the entry
    Throws:
      `IOException` - if an I/O error occurs.

  - ### accept

    public void accept(Visitor v)
    Called by objects that are traversing the nodes of the tree implicitly 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

  - ### addElementNameValuePair

    public void addElementNameValuePair(ElementValuePair elementNameValuePair)

  - ### dump

    public void dump(DataOutputStream dos) throws IOException
    Throws:
      `IOException`

  - ### getAnnotationType

    public String getAnnotationType()
    Returns:
      the annotation type name

  - ### getAnnotationTypeIndex

    public int getAnnotationTypeIndex()
    Returns:
      the annotation type index

  - ### getConstantPool

    public ConstantPool getConstantPool()

  - ### getElementValuePairs

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

  - ### getNumElementValuePairs

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

  - ### getTypeIndex

    public int getTypeIndex()

  - ### isRuntimeVisible

    public boolean isRuntimeVisible()

  - ### toShortString

    public String toShortString()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`