This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.lang.model.element
interface AnnotationValueVisitor

All Known Implementing Classes:
AbstractAnnotationValueVisitor6, SimpleAnnotationValueVisitor6

public interface AnnotationValueVisitor

A visitor of the values of annotation type elements, using a variant of the visitor design pattern. Unlike a standard visitor which dispatches based on the concrete type of a member of a type hierarchy, this visitor dispatches based on the type of data stored; there are no distinct subclasses for storing, for example, {@code boolean} values versus {@code int} values. Classes implementing this interface are used to operate on a value when the type of that value is unknown at compile time. When a visitor is passed to a value's {@link AnnotationValue#accept accept} method, the visitXYZ method applicable to that value is invoked.

Classes implementing this interface may or may not throw a {@code NullPointerException} if the additional parameter {@code p} is {@code null}; see documentation of the implementing class for details.

WARNING: It is possible that methods will be added to this interface to accommodate new, currently unknown, language structures added to future versions of the Java™ programming language. Therefore, visitor classes directly implementing this interface may be source incompatible with future versions of the platform. To avoid this source incompatibility, visitor implementations are encouraged to instead extend the appropriate abstract visitor class that implements this interface. However, an API should generally use this visitor interface as the type for parameters, return type, etc. rather than one of the abstract classes.


Method Summary
 Object

          A convenience method equivalent to .
 Object

          Visits an annotation value.
 Object

          Visits an annotation value in an annotation.
 Object

          Visits an array value in an annotation.
 Object
visitBoolean(boolean b, Object p)

          Visits a value in an annotation.
 Object
visitByte(byte b, Object p)

          Visits a value in an annotation.
 Object
visitChar(char c, Object p)

          Visits a value in an annotation.
 Object
visitDouble(double d, Object p)

          Visits a value in an annotation.
 Object

          Visits an value in an annotation.
 Object
visitFloat(float f, Object p)

          Visits a value in an annotation.
 Object
visitInt(int i, Object p)

          Visits an value in an annotation.
 Object
visitLong(long i, Object p)

          Visits a value in an annotation.
 Object
visitShort(short s, Object p)

          Visits a value in an annotation.
 Object

          Visits a string value in an annotation.
 Object

          Visits a type value in an annotation.
 Object

          Visits an unknown kind of annotation value.
 

Method Detail

visit

public Object visit(AnnotationValue av)
A convenience method equivalent to {@code v.visit(av, null)}.

Parameters:
av - the value to visit
Returns:
a visitor-specified result

visit

public Object visit(AnnotationValue av,
                    Object p)
Visits an annotation value.

Parameters:
av - the value to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitAnnotation

public Object visitAnnotation(AnnotationMirror a,
                              Object p)
Visits an annotation value in an annotation.

Parameters:
a - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitArray

public Object visitArray(List vals,
                         Object p)
Visits an array value in an annotation.

Parameters:
vals - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitBoolean

public Object visitBoolean(boolean b,
                           Object p)
Visits a {@code boolean} value in an annotation.

Parameters:
b - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitByte

public Object visitByte(byte b,
                        Object p)
Visits a {@code byte} value in an annotation.

Parameters:
b - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitChar

public Object visitChar(char c,
                        Object p)
Visits a {@code char} value in an annotation.

Parameters:
c - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitDouble

public Object visitDouble(double d,
                          Object p)
Visits a {@code double} value in an annotation.

Parameters:
d - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitEnumConstant

public Object visitEnumConstant(VariableElement c,
                                Object p)
Visits an {@code enum} value in an annotation.

Parameters:
c - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitFloat

public Object visitFloat(float f,
                         Object p)
Visits a {@code float} value in an annotation.

Parameters:
f - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitInt

public Object visitInt(int i,
                       Object p)
Visits an {@code int} value in an annotation.

Parameters:
i - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitLong

public Object visitLong(long i,
                        Object p)
Visits a {@code long} value in an annotation.

Parameters:
i - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitShort

public Object visitShort(short s,
                         Object p)
Visits a {@code short} value in an annotation.

Parameters:
s - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitString

public Object visitString(String s,
                          Object p)
Visits a string value in an annotation.

Parameters:
s - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitType

public Object visitType(TypeMirror t,
                        Object p)
Visits a type value in an annotation.

Parameters:
t - the value being visited
p - a visitor-specified parameter
Returns:
the result of the visit

visitUnknown

public Object visitUnknown(AnnotationValue av,
                           Object p)
Visits an unknown kind of annotation value. This can occur if the language evolves and new kinds of value can be stored in an annotation.

Parameters:
av - the unknown value being visited
p - a visitor-specified parameter
Returns:
the result of the visit


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.