Package org.codehaus.janino.util

# Class ClassFile.Annotation

java.lang.Object
org.codehaus.janino.util.ClassFile.Annotation

All Implemented Interfaces:
  `ClassFile.ElementValue`

Enclosing class:
  `ClassFile`

public static class ClassFile.Annotation extends Object implements ClassFile.ElementValue
The structure of the `annotations` array as described in JVMS8 4.7.16.

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.codehaus.janino.util.ClassFile.ElementValue

`ClassFile.ElementValue.Visitor<R,EX extends Throwable>`

## Field Summary

Fields
Modifier and Type
Field
Description
`final Map<Short,ClassFile.ElementValue>`
`elementValuePairs`
The "element_value_pairs" field of the `annotation` type as described in JVMS8 4.7.16.
`final short`
`typeIndex`
The "type_index" field of the `annotation` type as described in JVMS8 4.7.16.

## Constructor Summary

Constructors
Constructor
Description
`Annotation(short typeIndex, Map<Short,ClassFile.ElementValue> elementValuePairs)`

## Method Summary

Modifier and Type
Method
Description
`<R, EX extends Throwable>
R`
`accept(ClassFile.ElementValue.Visitor<R,EX> visitor)`
Invokes the respective method of the `ClassFile.ElementValue.Visitor`.
`byte`
`getTag()`
`void`
`store(DataOutputStream dos)`
Writes this element value in an element-value-type dependent way; see JVMS8 4.7.16.1.

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

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

## Field Details

### typeIndex

public final short typeIndex
The "type_index" field of the `annotation` type as described in JVMS8 4.7.16. The constant pool entry at that index must be a CONSTANT_Utf8_info structure representing a field descriptor.

### elementValuePairs

public final Map<Short,ClassFile.ElementValue> elementValuePairs
The "element_value_pairs" field of the `annotation` type as described in JVMS8 4.7.16. Key is the "`element_name_index`" (a constant pool index to a `ClassFile.ConstantUtf8Info`); value is an `ClassFile.ElementValue`.

## Constructor Details

### Annotation

public Annotation(short typeIndex, Map<Short,ClassFile.ElementValue> elementValuePairs)

Parameters:
  `typeIndex` - UTF 8 constant pool entry index; field descriptor
  `elementValuePairs` - Maps element name index (`ClassFile.ConstantUtf8Info`) to `ClassFile.ElementValue`s

## Method Details

### getTag

public byte getTag()

Specified by:
  `getTag` in interface `ClassFile.ElementValue`
Returns:
  The "tag" byte to use when storing this "value" in an "element_value" structure

### store

public void store(DataOutputStream dos) throws IOException
Description copied from interface: `ClassFile.ElementValue`
Writes this element value in an element-value-type dependent way; see JVMS8 4.7.16.1. The "tag" byte is snot part of this writing!

Specified by:
  `store` in interface `ClassFile.ElementValue`
Throws:
  `IOException`

### accept

@Nullable public <R, EX extends Throwable> R accept(ClassFile.ElementValue.Visitor<R,EX> visitor) throws EX
Description copied from interface: `ClassFile.ElementValue`
Invokes the respective method of the `ClassFile.ElementValue.Visitor`.

Specified by:
  `accept` in interface `ClassFile.ElementValue`
Throws:
  `EX`