java.lang.Object
- All Implemented Interfaces:
TypeVisitor<TypeMirror,
Element>
A
SimpleTypeVisitor14
that, given a TypeMirror
and an Element
, attempts to find a supertype
of that TypeMirror
whose defining element is equal to (normally is identical to) the supplied Element
.
For example, given a type denoted by List<String>
, and a TypeElement
denoted by Collection
, the result of visitation will be the type denoted by Collection<String>
.
So "as super" is probably derived from the fact that after this visitor runs you get a view, of sorts, of your parameterized type "as" a parameterized "super" type of a particular kind.
javac
does odd things with this and arrays and it is not clear that its documentation matches its
code. Consequently I don't have a lot of faith in the visitArray(ArrayType, Element)
method as of this
writing.
The compiler's asSuper
method documentation says, in part:
Return the (most specific) base type of t
that starts with the given symbol. If none exists,
return null.
-
Field Summary
Fields inherited from class javax.lang.model.util.SimpleTypeVisitor6
DEFAULT_VALUE
-
Constructor Summary
ConstructorDescriptionAsSuperVisitor
(TypeAndElementSource tes, Equality equality, Types types, SupertypeVisitor supertypeVisitor) -
Method Summary
Modifier and TypeMethodDescriptionfinal TypeMirror
visitArray
(ArrayType t, Element element) final TypeMirror
visitDeclared
(DeclaredType t, Element element) final TypeMirror
visitError
(ErrorType t, Element element) final TypeMirror
visitIntersection
(IntersectionType t, Element element) final TypeMirror
visitTypeVariable
(TypeVariable t, Element element) final AsSuperVisitor
withSubtypeVisitor
(SubtypeVisitor subtypeVisitor) final AsSuperVisitor
withSupertypeVisitor
(SupertypeVisitor supertypeVisitor) Methods inherited from class javax.lang.model.util.SimpleTypeVisitor7
visitUnion
Methods inherited from class javax.lang.model.util.SimpleTypeVisitor6
defaultAction, visitExecutable, visitNoType, visitNull, visitPrimitive, visitWildcard
Methods inherited from class javax.lang.model.util.AbstractTypeVisitor6
visit, visit, visitUnknown
-
Constructor Details
-
AsSuperVisitor
public AsSuperVisitor(TypeAndElementSource tes, Equality equality, Types types, SupertypeVisitor supertypeVisitor)
-
-
Method Details
-
withSupertypeVisitor
-
withSubtypeVisitor
-
visitArray
- Specified by:
visitArray
in interfaceTypeVisitor<TypeMirror,
Element> - Overrides:
visitArray
in classSimpleTypeVisitor6<TypeMirror,
Element>
-
visitDeclared
- Specified by:
visitDeclared
in interfaceTypeVisitor<TypeMirror,
Element> - Overrides:
visitDeclared
in classSimpleTypeVisitor6<TypeMirror,
Element>
-
visitError
- Specified by:
visitError
in interfaceTypeVisitor<TypeMirror,
Element> - Overrides:
visitError
in classSimpleTypeVisitor6<TypeMirror,
Element>
-
visitIntersection
- Specified by:
visitIntersection
in interfaceTypeVisitor<TypeMirror,
Element> - Overrides:
visitIntersection
in classSimpleTypeVisitor8<TypeMirror,
Element>
-
visitTypeVariable
- Specified by:
visitTypeVariable
in interfaceTypeVisitor<TypeMirror,
Element> - Overrides:
visitTypeVariable
in classSimpleTypeVisitor6<TypeMirror,
Element>
-