| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
visit(AnnotationValue av) A convenience method equivalent to . |
Object |
visit(AnnotationValue av, Object p) Visits an annotation value. |
Object |
Visits an annotation value in an annotation. |
Object |
visitArray(List vals, Object p) Visits an array value in an annotation. |
Object |
visitBoolean(boolean b, Object p) Visits a value in an annotation. |
Object |
Visits a value in an annotation. |
Object |
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 |
Visits an value in an annotation. |
Object |
Visits a value in an annotation. |
Object |
visitShort(short s, Object p) Visits a value in an annotation. |
Object |
visitString(String s, Object p) Visits a string value in an annotation. |
Object |
visitType(TypeMirror t, Object p) Visits a type value in an annotation. |
Object |
visitUnknown(AnnotationValue av, Object p) Visits an unknown kind of annotation value. |
Method Detail |
---|
public Object visit(AnnotationValue av)
av
- the value to visitpublic Object visit(AnnotationValue av, Object p)
av
- the value to visitp
- a visitor-specified parameterpublic Object visitAnnotation(AnnotationMirror a, Object p)
a
- the value being visitedp
- a visitor-specified parameterpublic Object visitArray(List vals, Object p)
vals
- the value being visitedp
- a visitor-specified parameterpublic Object visitBoolean(boolean b, Object p)
b
- the value being visitedp
- a visitor-specified parameterpublic Object visitByte(byte b, Object p)
b
- the value being visitedp
- a visitor-specified parameterpublic Object visitChar(char c, Object p)
c
- the value being visitedp
- a visitor-specified parameterpublic Object visitDouble(double d, Object p)
d
- the value being visitedp
- a visitor-specified parameterpublic Object visitEnumConstant(VariableElement c, Object p)
c
- the value being visitedp
- a visitor-specified parameterpublic Object visitFloat(float f, Object p)
f
- the value being visitedp
- a visitor-specified parameterpublic Object visitInt(int i, Object p)
i
- the value being visitedp
- a visitor-specified parameterpublic Object visitLong(long i, Object p)
i
- the value being visitedp
- a visitor-specified parameterpublic Object visitShort(short s, Object p)
s
- the value being visitedp
- a visitor-specified parameterpublic Object visitString(String s, Object p)
s
- the value being visitedp
- a visitor-specified parameterpublic Object visitType(TypeMirror t, Object p)
t
- the value being visitedp
- a visitor-specified parameterpublic Object visitUnknown(AnnotationValue av, Object p)
av
- the unknown value being visitedp
- a visitor-specified parameter
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |