com.sun.tools.apt.mirror.declaration
Class AnnotationMirrorImpl

java.lang.Object
  extended by com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl
All Implemented Interfaces:
AnnotationMirror

public class AnnotationMirrorImpl
extends java.lang.Object
implements AnnotationMirror

Implementation of AnnotationMirror


Field Summary
protected  Attribute.Compound anno
           
protected  Declaration decl
           
protected  AptEnv env
           
 
Constructor Summary
AnnotationMirrorImpl(AptEnv env, Attribute.Compound anno, Declaration decl)
           
 
Method Summary
 AnnotationType getAnnotationType()
          Returns the annotation type of this annotation.
 Declaration getDeclaration()
           
private  AnnotationTypeElementDeclaration getElement(Symbol.MethodSymbol m)
          Returns the annotation type element for a symbol.
 java.util.Map<AnnotationTypeElementDeclaration,AnnotationValue> getElementValues()
          Returns this annotation's elements and their values.
 SourcePosition getPosition()
          Returns the source position of the beginning of this annotation.
 java.lang.String toString()
          Returns a string representation of this annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

env

protected final AptEnv env

anno

protected final Attribute.Compound anno

decl

protected final Declaration decl
Constructor Detail

AnnotationMirrorImpl

AnnotationMirrorImpl(AptEnv env,
                     Attribute.Compound anno,
                     Declaration decl)
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this annotation. String is of one of the forms:

Overrides:
toString in class java.lang.Object

getAnnotationType

public AnnotationType getAnnotationType()
Returns the annotation type of this annotation.

Specified by:
getAnnotationType in interface AnnotationMirror
Returns:
the annotation type of this annotation

getElementValues

public java.util.Map<AnnotationTypeElementDeclaration,AnnotationValue> getElementValues()
Returns this annotation's elements and their values. This is returned in the form of a map that associates elements with their corresponding values. Only those elements and values explicitly present in the annotation are included, not those that are implicitly assuming their default values. The order of the map matches the order in which the elements appear in the annotation's source.

Specified by:
getElementValues in interface AnnotationMirror
Returns:
this annotation's elements and their values, or an empty map if there are none

getPosition

public SourcePosition getPosition()
Description copied from interface: AnnotationMirror
Returns the source position of the beginning of this annotation. Returns null if the position is unknown or not applicable.

This source position is intended for use in providing diagnostics, and indicates only approximately where an annotation begins.

Specified by:
getPosition in interface AnnotationMirror
Returns:
the source position of the beginning of this annotation or null if the position is unknown or not applicable

getDeclaration

public Declaration getDeclaration()

getElement

private AnnotationTypeElementDeclaration getElement(Symbol.MethodSymbol m)
Returns the annotation type element for a symbol.