com.sun.tools.javac.code
Class Attribute

java.lang.Object
  extended by com.sun.tools.javac.code.Attribute
All Implemented Interfaces:
AnnotationValue
Direct Known Subclasses:
Attribute.Array, Attribute.Class, Attribute.Compound, Attribute.Constant, Attribute.Enum, Attribute.Error, ClassReader.ArrayAttributeProxy, ClassReader.CompoundAnnotationProxy, ClassReader.EnumAttributeProxy

public abstract class Attribute
extends java.lang.Object
implements AnnotationValue

An annotation value.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Nested Class Summary
static class Attribute.Array
          The value for an annotation element of an array type.
static class Attribute.Class
          The value for an annotation element of type java.lang.Class, represented as a ClassSymbol.
static class Attribute.Compound
          A compound annotation element value, the type of which is an attribute interface.
static class Attribute.Constant
          The value for an annotation element of primitive type or String.
static class Attribute.Enum
          The value for an annotation element of an enum type.
static class Attribute.Error
           
static interface Attribute.Visitor
          A visitor type for dynamic dispatch on the kind of attribute value.
 
Field Summary
 Type type
          The type of the annotation element.
 
Constructor Summary
Attribute(Type type)
           
 
Method Summary
<R,P> R
accept(AnnotationValueVisitor<R,P> v, P p)
          Applies a visitor to this value.
abstract  void accept(Attribute.Visitor v)
           
 java.lang.Object getValue()
          Returns the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.lang.model.element.AnnotationValue
toString
 

Field Detail

type

public Type type
The type of the annotation element.

Constructor Detail

Attribute

public Attribute(Type type)
Method Detail

accept

public abstract void accept(Attribute.Visitor v)

getValue

public java.lang.Object getValue()
Description copied from interface: AnnotationValue
Returns the value.

Specified by:
getValue in interface AnnotationValue
Returns:
the value

accept

public <R,P> R accept(AnnotationValueVisitor<R,P> v,
                      P p)
Description copied from interface: AnnotationValue
Applies a visitor to this value.

Specified by:
accept in interface AnnotationValue
Type Parameters:
R - the return type of the visitor's methods
P - the type of the additional parameter to the visitor's methods
Parameters:
v - the visitor operating on this value
p - additional parameter to the visitor
Returns:
a visitor-specified result