org.apache.bcel.classfile

Class Annotations

public abstract class Annotations extends Attribute

base class for annotations

Since: 5.3

Version: $Id: Annotations

Author: D. Brosius

Constructor Summary
Annotations(byte annotation_type, int name_index, int length, DataInputStream file, ConstantPool constant_pool, boolean isRuntimeVisible)
Annotations(byte annotation_type, int name_index, int length, AnnotationEntry[] annotation_table, ConstantPool constant_pool, boolean isRuntimeVisible)
Method Summary
voidaccept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
AnnotationEntry[]getAnnotationEntries()
returns the array of annotation entries in this annotation
intgetNumAnnotations()
booleanisRuntimeVisible()
voidsetAnnotationTable(AnnotationEntry[] annotation_table)
protected voidwriteAnnotations(DataOutputStream dos)

Constructor Detail

Annotations

public Annotations(byte annotation_type, int name_index, int length, DataInputStream file, ConstantPool constant_pool, boolean isRuntimeVisible)

Parameters: annotation_type the subclass type of the annotation name_index Index pointing to the name Code length Content length in bytes file Input stream constant_pool Array of constants

Annotations

public Annotations(byte annotation_type, int name_index, int length, AnnotationEntry[] annotation_table, ConstantPool constant_pool, boolean isRuntimeVisible)

Parameters: annotation_type the subclass type of the annotation name_index Index pointing to the name Code length Content length in bytes annotation_table the actual annotations constant_pool Array of constants

Method Detail

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.

Parameters: v Visitor object

getAnnotationEntries

public AnnotationEntry[] getAnnotationEntries()
returns the array of annotation entries in this annotation

getNumAnnotations

public final int getNumAnnotations()

Returns: the number of annotation entries in this annotation

isRuntimeVisible

public boolean isRuntimeVisible()

setAnnotationTable

public final void setAnnotationTable(AnnotationEntry[] annotation_table)

Parameters: annotation_table the entries to set in this annotation

writeAnnotations

protected void writeAnnotations(DataOutputStream dos)
Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.