This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.lang.model.type
interface TypeVisitor

All Known Implementing Classes:
AbstractTypeVisitor6, SimpleTypeVisitor6, TypeKindVisitor6

public interface TypeVisitor

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's {@link TypeMirror#accept accept} method, the visitXYZ method most applicable to that type is invoked.

Classes implementing this interface may or may not throw a {@code NullPointerException} if the additional parameter {@code p} is {@code null}; 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.


Method Summary
 Object

          A convenience method equivalent to .
 Object

          Visits a type.
 Object

          Visits an array type.
 Object

          Visits a declared type.
 Object

          Visits an error type.
 Object

          Visits an executable type.
 Object

          Visits a javax.lang.model.type.NoType instance.
 Object

          Visits the null type.
 Object

          Visits a primitive type.
 Object

          Visits a type variable.
 Object

          Visits an unknown kind of type.
 Object

          Visits a wildcard type.
 

Method Detail

visit

public Object visit(TypeMirror t)
A convenience method equivalent to {@code v.visit(t, null)}.

Parameters:
t - the element to visit
Returns:
a visitor-specified result

visit

public Object visit(TypeMirror t,
                    Object p)
Visits a type.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitArray

public Object visitArray(ArrayType t,
                         Object p)
Visits an array type.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitDeclared

public Object visitDeclared(DeclaredType t,
                            Object p)
Visits a declared type.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitError

public Object visitError(ErrorType t,
                         Object p)
Visits an error type.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitExecutable

public Object visitExecutable(ExecutableType t,
                              Object p)
Visits an executable type.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitNoType

public Object visitNoType(NoType t,
                          Object p)
Visits a {@link NoType} instance.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitNull

public Object visitNull(NullType t,
                        Object p)
Visits the null type.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitPrimitive

public Object visitPrimitive(PrimitiveType t,
                             Object p)
Visits a primitive type.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitTypeVariable

public Object visitTypeVariable(TypeVariable t,
                                Object p)
Visits a type variable.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitUnknown

public Object visitUnknown(TypeMirror t,
                           Object p)
Visits an unknown kind of type. This can occur if the language evolves and new kinds of types are added to the {@code TypeMirror} hierarchy.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitWildcard

public Object visitWildcard(WildcardType t,
                            Object p)
Visits a wildcard type.

Parameters:
t - the type to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.