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
ConstructorsConstructorDescriptionAsSuperVisitor(TypeAndElementSource tes, Equality equality, Types types, SupertypeVisitor supertypeVisitor) -
Method Summary
Modifier and TypeMethodDescriptionfinal TypeMirrorvisitArray(ArrayType t, Element element) final TypeMirrorvisitDeclared(DeclaredType t, Element element) final TypeMirrorvisitError(ErrorType t, Element element) final TypeMirrorvisitIntersection(IntersectionType t, Element element) final TypeMirrorvisitTypeVariable(TypeVariable t, Element element) final AsSuperVisitorwithSubtypeVisitor(SubtypeVisitor subtypeVisitor) final AsSuperVisitorwithSupertypeVisitor(SupertypeVisitor supertypeVisitor) Methods inherited from class javax.lang.model.util.SimpleTypeVisitor7
visitUnionMethods inherited from class javax.lang.model.util.SimpleTypeVisitor6
defaultAction, visitExecutable, visitNoType, visitNull, visitPrimitive, visitWildcardMethods 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:
visitArrayin interfaceTypeVisitor<TypeMirror,Element> - Overrides:
visitArrayin classSimpleTypeVisitor6<TypeMirror,Element>
-
visitDeclared
- Specified by:
visitDeclaredin interfaceTypeVisitor<TypeMirror,Element> - Overrides:
visitDeclaredin classSimpleTypeVisitor6<TypeMirror,Element>
-
visitError
- Specified by:
visitErrorin interfaceTypeVisitor<TypeMirror,Element> - Overrides:
visitErrorin classSimpleTypeVisitor6<TypeMirror,Element>
-
visitIntersection
- Specified by:
visitIntersectionin interfaceTypeVisitor<TypeMirror,Element> - Overrides:
visitIntersectionin classSimpleTypeVisitor8<TypeMirror,Element>
-
visitTypeVariable
- Specified by:
visitTypeVariablein interfaceTypeVisitor<TypeMirror,Element> - Overrides:
visitTypeVariablein classSimpleTypeVisitor6<TypeMirror,Element>
-