com.sun.tools.javac.code
Class Attribute.Compound

java.lang.Object
  extended by com.sun.tools.javac.code.Attribute
      extended by com.sun.tools.javac.code.Attribute.Compound
All Implemented Interfaces:
AnnotationMirror, AnnotationValue
Enclosing class:
Attribute

public static class Attribute.Compound
extends Attribute
implements AnnotationMirror

A compound annotation element value, the type of which is an attribute interface.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.tools.javac.code.Attribute
Attribute.Array, Attribute.Class, Attribute.Compound, Attribute.Constant, Attribute.Enum, Attribute.Error, Attribute.Visitor
 
Field Summary
 List<Pair<Symbol.MethodSymbol,Attribute>> values
          The attributes values, as pairs.
 
Fields inherited from class com.sun.tools.javac.code.Attribute
type
 
Constructor Summary
Attribute.Compound(Type type, List<Pair<Symbol.MethodSymbol,Attribute>> values)
           
 
Method Summary
<R,P> R
accept(AnnotationValueVisitor<R,P> v, P p)
          Applies a visitor to this value.
 void accept(Attribute.Visitor v)
           
 DeclaredType getAnnotationType()
          Returns the type of this annotation.
 java.util.Map<Symbol.MethodSymbol,Attribute> getElementValues()
          Returns the values of this annotation's elements.
 Attribute.Compound getValue()
          Returns the value.
 Attribute member(Name member)
           
 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

values

public final List<Pair<Symbol.MethodSymbol,Attribute>> values
The attributes values, as pairs. Each pair contains a reference to the accessing method in the attribute interface and the value to be returned when that method is called to access this attribute.

Constructor Detail

Attribute.Compound

public Attribute.Compound(Type type,
                          List<Pair<Symbol.MethodSymbol,Attribute>> values)
Method Detail

accept

public void accept(Attribute.Visitor v)
Specified by:
accept in class Attribute

toString

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

Specified by:
toString in interface AnnotationValue
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this value

member

public Attribute member(Name member)

getValue

public Attribute.Compound getValue()
Description copied from interface: AnnotationValue
Returns the value.

Specified by:
getValue in interface AnnotationValue
Overrides:
getValue in class Attribute
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
Overrides:
accept in class Attribute
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

getAnnotationType

public DeclaredType getAnnotationType()
Description copied from interface: AnnotationMirror
Returns the type of this annotation.

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

getElementValues

public java.util.Map<Symbol.MethodSymbol,Attribute> getElementValues()
Description copied from interface: AnnotationMirror
Returns the values of this annotation's elements. This is returned in the form of a map that associates elements with their corresponding values. Only those elements with 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 values appear in the annotation's source.

Note that an annotation mirror of a marker annotation type will by definition have an empty map.

To fill in default values, use getElementValuesWithDefaults.

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