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.element
interface ElementVisitor

All Known Implementing Classes:
AbstractElementVisitor6, ElementScanner6, SimpleElementVisitor6, ElementKindVisitor6

public interface ElementVisitor

A visitor of program elements, in the style of the visitor design pattern. Classes implementing this interface are used to operate on an element when the kind of element is unknown at compile time. When a visitor is passed to an element's {@link Element#accept accept} method, the visitXYZ method most applicable to that element 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 an element.
 Object

          Visits an executable element.
 Object

          Visits a package element.
 Object

          Visits a type element.
 Object

          Visits a type parameter element.
 Object

          Visits an unknown kind of element.
 Object

          Visits a variable element.
 

Method Detail

visit

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

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

visit

public Object visit(Element e,
                    Object p)
Visits an element.

Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitExecutable

public Object visitExecutable(ExecutableElement e,
                              Object p)
Visits an executable element.

Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitPackage

public Object visitPackage(PackageElement e,
                           Object p)
Visits a package element.

Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitType

public Object visitType(TypeElement e,
                        Object p)
Visits a type element.

Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitTypeParameter

public Object visitTypeParameter(TypeParameterElement e,
                                 Object p)
Visits a type parameter element.

Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitUnknown

public Object visitUnknown(Element e,
                           Object p)
Visits an unknown kind of element. This can occur if the language evolves and new kinds of elements are added to the {@code Element} hierarchy.

Parameters:
e - the element to visit
p - a visitor-specified parameter
Returns:
a visitor-specified result

visitVariable

public Object visitVariable(VariableElement e,
                            Object p)
Visits a variable element.

Parameters:
e - the element 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/.