| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeVisitor
A visitor of types, in the style of the visitor design pattern. Classes implementing this interface are used to operate on a type when the kind of type is unknown at compile time. When a visitor is passed to a type's {@link TypeMirror#accept accept} method, the visitXYZ method most applicable to that type 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(TypeMirror t) A convenience method equivalent to . |
Object |
visit(TypeMirror t, Object p) Visits a type. |
Object |
visitArray(ArrayType t, Object p) Visits an array type. |
Object |
visitDeclared(DeclaredType t, Object p) Visits a declared type. |
Object |
visitError(ErrorType t, Object p) Visits an error type. |
Object |
Visits an executable type. |
Object |
visitNoType(NoType t, Object p) Visits a javax.lang.model.type.NoType instance. |
Object |
Visits the null type. |
Object |
Visits a primitive type. |
Object |
Visits a type variable. |
Object |
visitUnknown(TypeMirror t, Object p) Visits an unknown kind of type. |
Object |
visitWildcard(WildcardType t, Object p) Visits a wildcard type. |
Method Detail |
---|
public Object visit(TypeMirror t)
t
- the element to visitpublic Object visit(TypeMirror t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitArray(ArrayType t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitDeclared(DeclaredType t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitError(ErrorType t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitExecutable(ExecutableType t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitNoType(NoType t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitNull(NullType t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitPrimitive(PrimitiveType t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitTypeVariable(TypeVariable t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitUnknown(TypeMirror t, Object p)
t
- the type to visitp
- a visitor-specified parameterpublic Object visitWildcard(WildcardType t, Object p)
t
- the type to visitp
- a visitor-specified parameter
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |