Class AsSuperVisitor

All Implemented Interfaces:
TypeVisitor<TypeMirror,Element>

public final class AsSuperVisitor extends SimpleTypeVisitor14<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.