Class SimpleAnnotatedTypeVisitor<R,P>
java.lang.Object
org.checkerframework.framework.type.visitor.SimpleAnnotatedTypeVisitor<R,P>
- Type Parameters:
R
- the return type of this visitor's methods. UseVoid
for visitors that do not need to return results.P
- the type of the additional parameter to this visitor's methods. UseVoid
for visitors that do not need an additional parameter.
- All Implemented Interfaces:
AnnotatedTypeVisitor<R,
P>
public abstract class SimpleAnnotatedTypeVisitor<R,P>
extends Object
implements AnnotatedTypeVisitor<R,P>
A simple visitor for
AnnotatedTypeMirror
s.-
Field Summary
Modifier and TypeFieldDescriptionprotected final R
The default value to return as a default action. -
Constructor Summary
ModifierConstructorDescriptionprotected
Creates an instance ofSimpleAnnotatedTypeVisitor
with default value beingnull
.protected
SimpleAnnotatedTypeVisitor
(R defaultValue) Creates an instance ofSimpleAnnotatedTypeVisitor
with the default value being the passed defaultValue. -
Method Summary
Modifier and TypeMethodDescriptionprotected R
defaultAction
(AnnotatedTypeMirror type, P p) Performs the default action for visiting trees, if subclasses do not override the visitFOO node.visit
(AnnotatedTypeMirror type) A convenience method equivalent tov.visit(t, null)
.visit
(AnnotatedTypeMirror type, P p) Visits a type.Visits an array type.Visits a declared type.Visits an executable type.Visits an intersection type.Visits NoType type.Visits anull
type.Visits a primitive type.Visits a type variable.Visits an union type.Visits a wildcard type.
-
Field Details
-
DEFAULT_VALUE
The default value to return as a default action.
-
-
Constructor Details
-
SimpleAnnotatedTypeVisitor
protected SimpleAnnotatedTypeVisitor()Creates an instance ofSimpleAnnotatedTypeVisitor
with default value beingnull
. -
SimpleAnnotatedTypeVisitor
Creates an instance ofSimpleAnnotatedTypeVisitor
with the default value being the passed defaultValue.- Parameters:
defaultValue
- the default value this class should return
-
-
Method Details
-
defaultAction
Performs the default action for visiting trees, if subclasses do not override the visitFOO node.This implementation merely returns the default value (as specified by the protected field
DEFAULT_VALUE
). -
visit
Description copied from interface:AnnotatedTypeVisitor
A convenience method equivalent tov.visit(t, null)
.- Specified by:
visit
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visit- Returns:
- a visitor-specified result
-
visit
Description copied from interface:AnnotatedTypeVisitor
Visits a type.- Specified by:
visit
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitDeclared
Description copied from interface:AnnotatedTypeVisitor
Visits a declared type.- Specified by:
visitDeclared
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitIntersection
Description copied from interface:AnnotatedTypeVisitor
Visits an intersection type.- Specified by:
visitIntersection
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitUnion
Description copied from interface:AnnotatedTypeVisitor
Visits an union type.- Specified by:
visitUnion
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitArray
Description copied from interface:AnnotatedTypeVisitor
Visits an array type.- Specified by:
visitArray
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitExecutable
Description copied from interface:AnnotatedTypeVisitor
Visits an executable type.- Specified by:
visitExecutable
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitTypeVariable
Description copied from interface:AnnotatedTypeVisitor
Visits a type variable.- Specified by:
visitTypeVariable
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitWildcard
Description copied from interface:AnnotatedTypeVisitor
Visits a wildcard type.- Specified by:
visitWildcard
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitPrimitive
Description copied from interface:AnnotatedTypeVisitor
Visits a primitive type.- Specified by:
visitPrimitive
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitNull
Description copied from interface:AnnotatedTypeVisitor
Visits anull
type.- Specified by:
visitNull
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitNoType
Description copied from interface:AnnotatedTypeVisitor
Visits NoType type.- Specified by:
visitNoType
in interfaceAnnotatedTypeVisitor<R,
P> - Parameters:
type
- the type to visitp
- a visitor-specified parameter- Returns:
- a visitor-specified result
-