APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.classfile

public abstract Class Annotations

extends Attribute
implements Iterable<AnnotationEntry>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Known Direct Subclasses
com.sun.org.apache.bcel.internal.classfile.RuntimeInvisibleAnnotations, com.sun.org.apache.bcel.internal.classfile.RuntimeVisibleAnnotations
Imports
java.io.DataInput, .DataOutputStream, .IOException, java.util.Iterator, java.util.stream.Stream, com.sun.org.apache.bcel.internal.Const

base class for annotations
Since
6.0

Field Summary

Modifier and TypeField and Description
private AnnotationEntry[]
private final boolean
Inherited from com.sun.org.apache.bcel.internal.classfile.Attribute:
constant_poolEMPTY_ARRAYlengthname_indextag

Constructor Summary

AccessConstructor and Description
public
Annotations(final byte
the subclass type of the annotation
annotationType
,
final int
Index pointing to the name Code
nameIndex
,
final int
Content length in bytes
length
,
final AnnotationEntry[]
the actual annotations
annotationTable
,
final ConstantPool
Array of constants
constantPool
,
final boolean
whether this Annotation visible at runtime
isRuntimeVisible
)

Constructs an instance.

pack-priv
Annotations(final byte
the subclass type of the annotation
annotationType
,
final int
Index pointing to the name Code
nameIndex
,
final int
Content length in bytes
length
,
final DataInput
Input stream
input
,
final ConstantPool
Array of constants
constantPool
,
final boolean
whether this Annotation visible at runtime
isRuntimeVisible
)

Constructs an instance.

Method Summary

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

Implements abstract com.sun.org.apache.bcel.internal.classfile.Attribute.accept.

Implements com.sun.org.apache.bcel.internal.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.

public Attribute
public AnnotationEntry[]
getAnnotationEntries()

Gets the array of annotation entries in this annotation

public final int

Returns:

the number of annotation entries in this annotation
getNumAnnotations
()

Gets the number of annotation entries in this annotation.

public boolean
public Iterator<AnnotationEntry>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public final void
setAnnotationTable(final AnnotationEntry[]
the entries to set in this annotation
annotationTable
)

Sets the entries to set in this annotation.

public final String

Returns:

String representation
toString
()

Overrides com.sun.org.apache.bcel.internal.classfile.Attribute.toString.

Converts to a String representation.

protected void
Inherited from com.sun.org.apache.bcel.internal.classfile.Attribute:
addAttributeReaderclonedumpgetConstantPoolgetLengthgetNamegetNameIndexgetTagprintlnreadAttributereadAttributeremoveAttributeReadersetConstantPoolsetLengthsetNameIndex

Field Detail

annotationTableback to summary
private AnnotationEntry[] annotationTable
isRuntimeVisibleback to summary
private final boolean isRuntimeVisible

Constructor Detail

Annotationsback to summary
public Annotations(final byte annotationType, final int nameIndex, final int length, final AnnotationEntry[] annotationTable, final ConstantPool constantPool, final boolean isRuntimeVisible)

Constructs an instance.

Parameters
annotationType:byte

the subclass type of the annotation

nameIndex:int

Index pointing to the name Code

length:int

Content length in bytes

annotationTable:AnnotationEntry[]

the actual annotations

constantPool:ConstantPool

Array of constants

isRuntimeVisible:boolean

whether this Annotation visible at runtime

Annotationsback to summary
pack-priv Annotations(final byte annotationType, final int nameIndex, final int length, final DataInput input, final ConstantPool constantPool, final boolean isRuntimeVisible) throws IOException

Constructs an instance.

Parameters
annotationType:byte

the subclass type of the annotation

nameIndex:int

Index pointing to the name Code

length:int

Content length in bytes

input:DataInput

Input stream

constantPool:ConstantPool

Array of constants

isRuntimeVisible:boolean

whether this Annotation visible at runtime

Exceptions
IOException:
if an I/O error occurs.

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract com.sun.org.apache.bcel.internal.classfile.Attribute.accept.

Implements com.sun.org.apache.bcel.internal.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
copyback to summary
public Attribute copy(final ConstantPool constantPool)

Implements abstract com.sun.org.apache.bcel.internal.classfile.Attribute.copy.

Annotations
@Override
getAnnotationEntriesback to summary
public AnnotationEntry[] getAnnotationEntries()

Gets the array of annotation entries in this annotation

getNumAnnotationsback to summary
public final int getNumAnnotations()

Gets the number of annotation entries in this annotation.

Returns:int

the number of annotation entries in this annotation

isRuntimeVisibleback to summary
public boolean isRuntimeVisible()
iteratorback to summary
public Iterator<AnnotationEntry> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override
setAnnotationTableback to summary
public final void setAnnotationTable(final AnnotationEntry[] annotationTable)

Sets the entries to set in this annotation.

Parameters
annotationTable:AnnotationEntry[]

the entries to set in this annotation

toStringback to summary
public final String toString()

Overrides com.sun.org.apache.bcel.internal.classfile.Attribute.toString.

Converts to a String representation.

Returns:String

String representation

Annotations
@Override
writeAnnotationsback to summary
protected void writeAnnotations(final DataOutputStream dos) throws IOException