Top Description Fields Constructors Methods
org.apache.bcel.classfile

public Class AnnotationEntry

extends Object
implements Node
Class Inheritance
All Implemented Interfaces
org.apache.bcel.classfile.Node
Imports
java.io.DataInput, .DataOutputStream, .IOException, java.util.ArrayList, .List, java.util.stream.Stream

Represents one annotation in the annotation table
Since
6.0

Field Summary

Modifier and TypeField and Description
private final ConstantPool
private final List<ElementValuePair>
public static final AnnotationEntry[]
private final boolean
private final int

Constructor Summary

AccessConstructor and Description
public
AnnotationEntry(final int typeIndex, final ConstantPool constantPool, final boolean isRuntimeVisible)

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
public void
addElementNameValuePair(final ElementValuePair elementNameValuePair)

public static AnnotationEntry[]
public void
public String

Returns:

the annotation type name
getAnnotationType
()

public int

Returns:

the annotation type index
getAnnotationTypeIndex
()

public ConstantPool
public ElementValuePair[]

Returns:

the element value pairs in this annotation entry
getElementValuePairs
()

public final int

Returns:

the number of element value pairs in this annotation entry
getNumElementValuePairs
()

public int
public boolean
public static AnnotationEntry

Returns:

the entry
read
(final DataInput input, final ConstantPool constantPool, final boolean isRuntimeVisible)

Factory method to create an AnnotionEntry from a DataInput

public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

constantPoolback to summary
private final ConstantPool constantPool
elementValuePairsback to summary
private final List<ElementValuePair> elementValuePairs
EMPTY_ARRAYback to summary
public static final AnnotationEntry[] EMPTY_ARRAY
isRuntimeVisibleback to summary
private final boolean isRuntimeVisible
typeIndexback to summary
private final int typeIndex

Constructor Detail

AnnotationEntryback to summary
public AnnotationEntry(final int typeIndex, final ConstantPool constantPool, final boolean isRuntimeVisible)

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements org.apache.bcel.classfile.Node.accept.

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.

Parameters
v:Visitor

Visitor object

Annotations
@Override
addElementNameValuePairback to summary
public void addElementNameValuePair(final ElementValuePair elementNameValuePair)
createAnnotationEntriesback to summary
public static AnnotationEntry[] createAnnotationEntries(final Attribute[] attrs)
dumpback to summary
public void dump(final DataOutputStream dos) throws IOException
getAnnotationTypeback to summary
public String getAnnotationType()
Returns:String

the annotation type name

getAnnotationTypeIndexback to summary
public int getAnnotationTypeIndex()
Returns:int

the annotation type index

getConstantPoolback to summary
public ConstantPool getConstantPool()
getElementValuePairsback to summary
public ElementValuePair[] getElementValuePairs()
Returns:ElementValuePair[]

the element value pairs in this annotation entry

getNumElementValuePairsback to summary
public final int getNumElementValuePairs()
Returns:int

the number of element value pairs in this annotation entry

getTypeIndexback to summary
public int getTypeIndex()
isRuntimeVisibleback to summary
public boolean isRuntimeVisible()
readback to summary
public static AnnotationEntry read(final DataInput input, final ConstantPool constantPool, final boolean isRuntimeVisible) throws IOException

Factory method to create an AnnotionEntry from a DataInput

Returns:AnnotationEntry

the entry

Exceptions
IOException:
if an I/O error occurs.
toShortStringback to summary
public String toShortString()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override