org.apache.bcel.generic

## Class AnnotationEntryGen

- java.lang.Object
- - org.apache.bcel.generic.AnnotationEntryGen

-     public class AnnotationEntryGen
      extends Object

  Since:
    6.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationEntryGen(AnnotationEntry a, ConstantPoolGen cpool, boolean copyPoolEntries)` Here we are taking a fixed annotation of type Annotation and building a modifiable AnnotationGen object.
    `AnnotationEntryGen(ObjectType type, List<ElementValuePairGen> elements, boolean vis, ConstantPoolGen cpool)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addElementNameValuePair(ElementValuePairGen evp)`
    `void` | `dump(DataOutputStream dos)`
    `AnnotationEntry` | `getAnnotation()` Retrieve an immutable version of this AnnotationGen
    `int` | `getTypeIndex()`
    `String` | `getTypeName()`
    `String` | `getTypeSignature()`
    `List<ElementValuePairGen>` | `getValues()` Returns list of ElementNameValuePair objects
    `boolean` | `isRuntimeVisible()`
    `static AnnotationEntryGen` | `read(DataInput dis, ConstantPoolGen cpool, boolean b)`
    `String` | `toShortString()`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### AnnotationEntryGen

          public AnnotationEntryGen(AnnotationEntry a,
                                    ConstantPoolGen cpool,
                                    boolean copyPoolEntries)

      Here we are taking a fixed annotation of type Annotation and building a modifiable AnnotationGen object. If the pool passed in is for a different class file, then copyPoolEntries should have been passed as true as that will force us to do a deep copy of the annotation and move the cpool entries across. We need to copy the type and the element name value pairs and the visibility.

    - #### AnnotationEntryGen

          public AnnotationEntryGen(ObjectType type,
                                    List<ElementValuePairGen> elements,
                                    boolean vis,
                                    ConstantPoolGen cpool)

  - ### Method Detail

    - #### read

          public static AnnotationEntryGen read(DataInput dis,
                                                ConstantPoolGen cpool,
                                                boolean b)
                                         throws IOException

      Throws:
        `IOException`

    - #### addElementNameValuePair

          public void addElementNameValuePair(ElementValuePairGen evp)

    - #### dump

          public void dump(DataOutputStream dos)
                    throws IOException

      Throws:
        `IOException`

    - #### getAnnotation

          public AnnotationEntry getAnnotation()

      Retrieve an immutable version of this AnnotationGen

    - #### getTypeIndex

          public int getTypeIndex()

    - #### getTypeName

          public final String getTypeName()

    - #### getTypeSignature

          public final String getTypeSignature()

    - #### getValues

          public List<ElementValuePairGen> getValues()

      Returns list of ElementNameValuePair objects

    - #### isRuntimeVisible

          public boolean isRuntimeVisible()

    - #### toShortString

          public String toShortString()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.