public interface javax.lang.model.type
TypeVisitor<R, P>


Show All Login
Java SE 6
  
Implemented by: AbstractTypeVisitor6
Details
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 accept method, the visitXYZ method most applicable to that type is invoked.

Classes implementing this interface may or may not throw a NullPointerException if the additional parameter p is 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.
Rthe return type of this visitor's methods. Use Void for visitors that do not need to return results.
Pthe type of the additional parameter to this visitor's methods. Use Void for visitors that do not need an additional parameter.
version1.5 06/07/31
since1.6


Methods
public Object visit(TypeMirror t, Object p) Details
Visits a type.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visit(TypeMirror t) Details
A convenience method equivalent to v.visit(t, null).
tthe element to visit
returna visitor-specified result
public Object visitArray(ArrayType t, Object p) Details
Visits an array type.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visitDeclared(DeclaredType t, Object p) Details
Visits a declared type.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visitError(ErrorType t, Object p) Details
Visits an error type.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visitExecutable(ExecutableType t, Object p) Details
Visits an executable type.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visitNoType(NoType t, Object p) Details
Visits a NoType instance.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visitNull(NullType t, Object p) Details
Visits the null type.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visitPrimitive(PrimitiveType t, Object p) Details
Visits a primitive type.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visitTypeVariable(TypeVariable t, Object p) Details
Visits a type variable.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
public Object visitUnknown(TypeMirror t, Object p) Details
Visits an unknown kind of type. This can occur if the language evolves and new kinds of types are added to the TypeMirror hierarchy.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result
ThrowsUnknownTypeException: a visitor implementation may optionally throw this exception
public Object visitWildcard(WildcardType t, Object p) Details
Visits a wildcard type.
tthe type to visit
pa visitor-specified parameter
returna visitor-specified result