- 
- Type Parameters:
- R- the return type of this visitor's methods. Use- Voidfor visitors that do not need to return results.
- P- the type of the additional parameter to this visitor's methods. Use- Voidfor visitors that do not need an additional parameter.
 - All Known Implementing Classes:
- AbstractTypeVisitor6,- AbstractTypeVisitor7,- AbstractTypeVisitor8,- AbstractTypeVisitor9,- SimpleTypeVisitor6,- SimpleTypeVisitor7,- SimpleTypeVisitor8,- SimpleTypeVisitor9,- TypeKindVisitor6,- TypeKindVisitor7,- TypeKindVisitor8,- TypeKindVisitor9
 
 public interface TypeVisitor<R,P>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'sacceptmethod, thevisitXyzmethod most applicable to that type is invoked.Classes implementing this interface may or may not throw a NullPointerExceptionif the additional parameterpisnull; 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. Note that methods to accommodate new language constructs could be added in a source compatible way if they were added as default methods. However, default methods are only available on Java SE 8 and higher releases and the javax.lang.model.*packages bundled in Java SE 8 were required to also be runnable on Java SE 7. Therefore, default methods were not used when extendingjavax.lang.model.*to cover Java SE 8 language features. However, default methods are used in subsequent revisions of thejavax.lang.model.*packages that are only required to run on Java SE 8 and higher platform versions.- Since:
- 1.6
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Rvisit(TypeMirror t)A convenience method equivalent tovisit(t, null).Rvisit(TypeMirror t, P p)Visits a type.RvisitArray(ArrayType t, P p)Visits an array type.RvisitDeclared(DeclaredType t, P p)Visits a declared type.RvisitError(ErrorType t, P p)Visits an error type.RvisitExecutable(ExecutableType t, P p)Visits an executable type.RvisitIntersection(IntersectionType t, P p)Visits an intersection type.RvisitNoType(NoType t, P p)Visits aNoTypeinstance.RvisitNull(NullType t, P p)Visits the null type.RvisitPrimitive(PrimitiveType t, P p)Visits a primitive type.RvisitTypeVariable(TypeVariable t, P p)Visits a type variable.RvisitUnion(UnionType t, P p)Visits a union type.RvisitUnknown(TypeMirror t, P p)Visits an unknown kind of type.RvisitWildcard(WildcardType t, P p)Visits a wildcard type.
 
- 
- 
- 
Method Detail- 
visitR visit(TypeMirror t, P p) Visits a type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitdefault R visit(TypeMirror t) A convenience method equivalent tovisit(t, null).- Implementation Requirements:
- The default implementation is visit(t, null).
- Parameters:
- t- the element to visit
- Returns:
- a visitor-specified result
 
 - 
visitPrimitiveR visitPrimitive(PrimitiveType t, P p) Visits a primitive type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitNullR visitNull(NullType t, P p) Visits the null type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitArrayR visitArray(ArrayType t, P p) Visits an array type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitDeclaredR visitDeclared(DeclaredType t, P p) Visits a declared type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitErrorR visitError(ErrorType t, P p) Visits an error type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitTypeVariableR visitTypeVariable(TypeVariable t, P p) Visits a type variable.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitWildcardR visitWildcard(WildcardType t, P p) Visits a wildcard type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitExecutableR visitExecutable(ExecutableType t, P p) Visits an executable type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitNoTypeR visitNoType(NoType t, P p) Visits aNoTypeinstance.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
 
 - 
visitUnknownR visitUnknown(TypeMirror t, P p) Visits an unknown kind of type. This can occur if the language evolves and new kinds of types are added to theTypeMirrorhierarchy.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
- Throws:
- UnknownTypeException- a visitor implementation may optionally throw this exception
 
 - 
visitUnionR visitUnion(UnionType t, P p) Visits a union type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
- Since:
- 1.7
 
 - 
visitIntersectionR visitIntersection(IntersectionType t, P p) Visits an intersection type.- Parameters:
- t- the type to visit
- p- a visitor-specified parameter
- Returns:
- a visitor-specified result
- Since:
- 1.8
 
 
- 
 
-