APIdia Launch Partner
Top Description Fields Constructors Methods
javax.lang.model.util

public Class ElementKindVisitor6<R, P>

extends SimpleElementVisitor6<R, P>
Class Inheritance
Known Direct Subclasses
javax.lang.model.util.ElementKindVisitor7
Annotations
@SupportedSourceVersion:RELEASE_6
Type Parameters
<R>
the return type of this visitor's methods. Use Void for visitors that do not need to return results.
<P>
the type of the additional parameter to this visitor's methods. Use Void for visitors that do not need an additional parameter.
Imports
javax.lang.model.element.*, javax.annotation.processing.SupportedSourceVersion, javax.lang.model.SourceVersion

A visitor of program elements based on their kind with default behavior appropriate for the RELEASE_6 source version. For elements Xyz that may have more than one kind, the visitXyz methods in this class delegate to the visitXyzAsKind method corresponding to the first argument's kind. The visitXyzAsKind methods call defaultAction, passing their arguments to defaultAction's corresponding parameters.

API Note

Methods in this class may be overridden subject to their general contract.

WARNING: The ElementVisitor interface implemented by this class may have methods added to it or the ElementKind enum used in this class may have constants added to it in the future to accommodate new, currently unknown, language structures added to future versions of the Java programming language. Therefore, methods whose names begin with "visit" may be added to this class in the future; to avoid incompatibilities, classes and subclasses which extend this class should not declare any instance methods with names beginning with "visit".

When such a new visit method is added, the default implementation in this class will be to directly or indirectly call the visitUnknown method. A new abstract element kind visitor class will also be introduced to correspond to the new language level; this visitor will have different default behavior for the visit method in question. When a new visitor is introduced, portions of this visitor class may be deprecated, including its constructors.

Since
1.6
See Also
ElementKindVisitor7, ElementKindVisitor8, ElementKindVisitor9, ElementKindVisitor14

Field Summary

Inherited from javax.lang.model.util.SimpleElementVisitor6:
DEFAULT_VALUE

Constructor Summary

AccessConstructor and Description
protected
ElementKindVisitor6()
Deprecated since 9. Release 6 is obsolete; update to a visitor for a newer release level.

Constructor for concrete subclasses; uses null for the default value.

protected
ElementKindVisitor6(R
the value to assign to DEFAULT_VALUE
defaultValue
)
Deprecated since 9. Release 6 is obsolete; update to a visitor for a newer release level.

Constructor for concrete subclasses; uses the argument for the default value.

Method Summary

Modifier and TypeMethod and Description
public R

Returns:

the result of the kind-specific visit method
visitExecutable
(ExecutableElement e, P p)

Overrides javax.lang.model.util.SimpleElementVisitor6.visitExecutable.

Implements javax.lang.model.element.ElementVisitor.visitExecutable.

Visits an executable element.

public R

Returns:

the result of defaultAction
visitExecutableAsConstructor
(ExecutableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a CONSTRUCTOR executable element.

public R

Returns:

the result of defaultAction
visitExecutableAsInstanceInit
(ExecutableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits an INSTANCE_INIT executable element.

public R

Returns:

the result of defaultAction
visitExecutableAsMethod
(ExecutableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a METHOD executable element.

public R

Returns:

the result of defaultAction
visitExecutableAsStaticInit
(ExecutableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a STATIC_INIT executable element.

public R
public R

Returns:

the result of the kind-specific visit method
visitType
(TypeElement e, P p)

Overrides javax.lang.model.util.SimpleElementVisitor6.visitType.

Implements javax.lang.model.element.ElementVisitor.visitType.

Visits a type element.

public R

Returns:

the result of defaultAction
visitTypeAsAnnotationType
(TypeElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits an ANNOTATION_TYPE type element.

public R

Returns:

the result of defaultAction
visitTypeAsClass
(TypeElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a CLASS type element.

public R

Returns:

the result of defaultAction
visitTypeAsEnum
(TypeElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits an ENUM type element.

public R

Returns:

the result of defaultAction
visitTypeAsInterface
(TypeElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits an INTERFACE type element.

public R

Returns:

the result of visitUnknown
visitTypeAsRecord
(TypeElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a RECORD type element.

public R
public R

Returns:

the result of the kind-specific visit method
visitVariable
(VariableElement e, P p)

Overrides javax.lang.model.util.SimpleElementVisitor6.visitVariable.

Implements javax.lang.model.element.ElementVisitor.visitVariable.

Visits a variable element.

public R

Returns:

the result of visitUnknown
visitVariableAsBindingVariable
(VariableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a BINDING_VARIABLE variable element.

public R

Returns:

the result of defaultAction
visitVariableAsEnumConstant
(VariableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits an ENUM_CONSTANT variable element.

public R

Returns:

the result of defaultAction
visitVariableAsExceptionParameter
(VariableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits an EXCEPTION_PARAMETER variable element.

public R

Returns:

the result of defaultAction
visitVariableAsField
(VariableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a FIELD variable element.

public R

Returns:

the result of defaultAction
visitVariableAsLocalVariable
(VariableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a LOCAL_VARIABLE variable element.

public R

Returns:

the result of defaultAction
visitVariableAsParameter
(VariableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a PARAMETER variable element.

public R

Returns:

the result of visitUnknown
visitVariableAsResourceVariable
(VariableElement
the element to visit
e
,
P
a visitor-specified parameter
p
)

Visits a RESOURCE_VARIABLE variable element.

Inherited from javax.lang.model.util.SimpleElementVisitor6:
defaultAction

Constructor Detail

ElementKindVisitor6back to summary
protected ElementKindVisitor6()

Deprecated

since 9.

Release 6 is obsolete; update to a visitor for a newer release level.

Constructor for concrete subclasses; uses null for the default value.

Annotations
@Deprecated
since:9
ElementKindVisitor6back to summary
protected ElementKindVisitor6(R defaultValue)

Deprecated

since 9.

Release 6 is obsolete; update to a visitor for a newer release level.

Constructor for concrete subclasses; uses the argument for the default value.

Parameters
defaultValue:R

the value to assign to DEFAULT_VALUE

Annotations
@Deprecated
since:9

Method Detail

visitExecutableback to summary
public R visitExecutable(ExecutableElement e, P p)

Overrides javax.lang.model.util.SimpleElementVisitor6.visitExecutable.

Implements javax.lang.model.element.ElementVisitor.visitExecutable.

Doc from javax.lang.model.element.ElementVisitor.visitExecutable.

Visits an executable element.

Implementation Specification

This implementation dispatches to the visit method for the specific kind of executable, CONSTRUCTOR, INSTANCE_INIT, METHOD, or STATIC_INIT.

Returns:R

the result of the kind-specific visit method

Annotations
@Override
visitExecutableAsConstructorback to summary
public R visitExecutableAsConstructor(ExecutableElement e, P p)

Visits a CONSTRUCTOR executable element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:ExecutableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitExecutableAsInstanceInitback to summary
public R visitExecutableAsInstanceInit(ExecutableElement e, P p)

Visits an INSTANCE_INIT executable element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:ExecutableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitExecutableAsMethodback to summary
public R visitExecutableAsMethod(ExecutableElement e, P p)

Visits a METHOD executable element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:ExecutableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitExecutableAsStaticInitback to summary
public R visitExecutableAsStaticInit(ExecutableElement e, P p)

Visits a STATIC_INIT executable element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:ExecutableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitPackageback to summary
public R visitPackage(PackageElement e, P p)

Overrides javax.lang.model.util.SimpleElementVisitor6.visitPackage.

Implements javax.lang.model.element.ElementVisitor.visitPackage.

Doc from javax.lang.model.element.ElementVisitor.visitPackage.

Visits a package element. The element argument has kind PACKAGE.

Implementation Specification

This implementation calls defaultAction.

Annotations
@Override
visitTypeback to summary
public R visitType(TypeElement e, P p)

Overrides javax.lang.model.util.SimpleElementVisitor6.visitType.

Implements javax.lang.model.element.ElementVisitor.visitType.

Doc from javax.lang.model.element.ElementVisitor.visitType.

Visits a type element.

Implementation Specification

This implementation dispatches to the visit method for the specific kind of type, ANNOTATION_TYPE, CLASS, ENUM, or INTERFACE.

Returns:R

the result of the kind-specific visit method

Annotations
@Override
visitTypeAsAnnotationTypeback to summary
public R visitTypeAsAnnotationType(TypeElement e, P p)

Visits an ANNOTATION_TYPE type element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:TypeElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitTypeAsClassback to summary
public R visitTypeAsClass(TypeElement e, P p)

Visits a CLASS type element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:TypeElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitTypeAsEnumback to summary
public R visitTypeAsEnum(TypeElement e, P p)

Visits an ENUM type element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:TypeElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitTypeAsInterfaceback to summary
public R visitTypeAsInterface(TypeElement e, P p)

Visits an INTERFACE type element.

Implementation Specification

This implementation calls defaultAction. .

Parameters
e:TypeElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitTypeAsRecordback to summary
public R visitTypeAsRecord(TypeElement e, P p)

Visits a RECORD type element.

Implementation Specification

This implementation calls visitUnknown. .

Parameters
e:TypeElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of visitUnknown

Since
16
visitTypeParameterback to summary
public R visitTypeParameter(TypeParameterElement e, P p)

Overrides javax.lang.model.util.SimpleElementVisitor6.visitTypeParameter.

Implements javax.lang.model.element.ElementVisitor.visitTypeParameter.

Doc from javax.lang.model.element.ElementVisitor.visitTypeParameter.

Visits a type parameter element. The element argument has kind TYPE_PARAMETER.

Implementation Specification

This implementation calls defaultAction.

Annotations
@Override
visitVariableback to summary
public R visitVariable(VariableElement e, P p)

Overrides javax.lang.model.util.SimpleElementVisitor6.visitVariable.

Implements javax.lang.model.element.ElementVisitor.visitVariable.

Doc from javax.lang.model.element.ElementVisitor.visitVariable.

Visits a variable element.

Implementation Specification

This implementation dispatches to the visit method for the specific kind of variable, ENUM_CONSTANT, EXCEPTION_PARAMETER, FIELD, LOCAL_VARIABLE, PARAMETER, or RESOURCE_VARIABLE.

Returns:R

the result of the kind-specific visit method

Annotations
@Override
visitVariableAsBindingVariableback to summary
public R visitVariableAsBindingVariable(VariableElement e, P p)

Visits a BINDING_VARIABLE variable element.

Implementation Specification

This implementation calls visitUnknown.

Parameters
e:VariableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of visitUnknown

Since
14
visitVariableAsEnumConstantback to summary
public R visitVariableAsEnumConstant(VariableElement e, P p)

Visits an ENUM_CONSTANT variable element.

Implementation Specification

This implementation calls defaultAction. .

Parameters
e:VariableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitVariableAsExceptionParameterback to summary
public R visitVariableAsExceptionParameter(VariableElement e, P p)

Visits an EXCEPTION_PARAMETER variable element.

Implementation Specification

This implementation calls defaultAction. .

Parameters
e:VariableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitVariableAsFieldback to summary
public R visitVariableAsField(VariableElement e, P p)

Visits a FIELD variable element.

Implementation Specification

This implementation calls defaultAction. .

Parameters
e:VariableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitVariableAsLocalVariableback to summary
public R visitVariableAsLocalVariable(VariableElement e, P p)

Visits a LOCAL_VARIABLE variable element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:VariableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitVariableAsParameterback to summary
public R visitVariableAsParameter(VariableElement e, P p)

Visits a PARAMETER variable element.

Implementation Specification

This implementation calls defaultAction.

Parameters
e:VariableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of defaultAction

visitVariableAsResourceVariableback to summary
public R visitVariableAsResourceVariable(VariableElement e, P p)

Visits a RESOURCE_VARIABLE variable element.

Implementation Specification

This implementation calls visitUnknown.

Parameters
e:VariableElement

the element to visit

p:P

a visitor-specified parameter

Returns:R

the result of visitUnknown

Since
1.7