public class RecursiveTypeVisitor extends TypeVisitor
An implementation of TypeVisitor which provides recursion over the related types specified by the arguments passed to constructor. Supertypes of parameterized types are visited without those type arguments passed through.
This means that if the type List<String>
is visited, the supertype
Collections<E>
will be visited subsequently, rather than
Collection<String>
. If the type String is visited, on the other hand,
the supertype Comparable<String>
will be visited. If the raw type
List is visited, then the raw supertype Collection will be visited
subsequently.
Modifier and Type | Class and Description |
---|---|
static class |
RecursiveTypeVisitor.Builder
A builder for specifying the behavior of a new
RecursiveTypeVisitor
instance. |
Modifier and Type | Method and Description |
---|---|
static RecursiveTypeVisitor.Builder |
build() |
protected void |
visitClass(java.lang.Class<?> type) |
protected void |
visitGenericArrayType(java.lang.reflect.GenericArrayType type) |
protected void |
visitInferenceVariable(InferenceVariable type) |
protected void |
visitIntersectionType(IntersectionType type) |
protected void |
visitParameterizedType(java.lang.reflect.ParameterizedType type) |
protected void |
visitTypeVariable(java.lang.reflect.TypeVariable<?> type) |
protected void |
visitTypeVariableCapture(TypeVariableCapture type) |
protected void |
visitWildcardType(java.lang.reflect.WildcardType type) |
visit, visit, visit, visitNull
public static RecursiveTypeVisitor.Builder build()
RecursiveTypeVisitor.Builder
with which to describe a new
RecursiveTypeVisitor
.protected void visitClass(java.lang.Class<?> type)
visitClass
in class TypeVisitor
protected void visitGenericArrayType(java.lang.reflect.GenericArrayType type)
visitGenericArrayType
in class TypeVisitor
protected void visitParameterizedType(java.lang.reflect.ParameterizedType type)
visitParameterizedType
in class TypeVisitor
protected void visitTypeVariableCapture(TypeVariableCapture type)
visitTypeVariableCapture
in class TypeVisitor
protected void visitTypeVariable(java.lang.reflect.TypeVariable<?> type)
visitTypeVariable
in class TypeVisitor
protected void visitWildcardType(java.lang.reflect.WildcardType type)
visitWildcardType
in class TypeVisitor
protected void visitIntersectionType(IntersectionType type)
visitIntersectionType
in class TypeVisitor
protected void visitInferenceVariable(InferenceVariable type)
visitInferenceVariable
in class TypeVisitor