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. UseVoidfor visitors that do not need to return results.P- the type of the additional parameter to this visitor's methods. UseVoidfor 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
AnnotatedTypeMirrors.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RThe default value to return as a default action. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates an instance ofSimpleAnnotatedTypeVisitorwith default value beingnull.protectedSimpleAnnotatedTypeVisitor(R defaultValue) Creates an instance ofSimpleAnnotatedTypeVisitorwith the default value being the passed defaultValue. -
Method Summary
Modifier and TypeMethodDescriptionprotected RdefaultAction(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 anulltype.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 ofSimpleAnnotatedTypeVisitorwith default value beingnull. -
SimpleAnnotatedTypeVisitor
Creates an instance ofSimpleAnnotatedTypeVisitorwith 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:AnnotatedTypeVisitorA convenience method equivalent tov.visit(t, null).- Specified by:
visitin interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visit- Returns:
- a visitor-specified result
-
visit
Description copied from interface:AnnotatedTypeVisitorVisits a type.- Specified by:
visitin interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitDeclared
Description copied from interface:AnnotatedTypeVisitorVisits a declared type.- Specified by:
visitDeclaredin interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitIntersection
Description copied from interface:AnnotatedTypeVisitorVisits an intersection type.- Specified by:
visitIntersectionin interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitUnion
Description copied from interface:AnnotatedTypeVisitorVisits an union type.- Specified by:
visitUnionin interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitArray
Description copied from interface:AnnotatedTypeVisitorVisits an array type.- Specified by:
visitArrayin interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitExecutable
Description copied from interface:AnnotatedTypeVisitorVisits an executable type.- Specified by:
visitExecutablein interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitTypeVariable
Description copied from interface:AnnotatedTypeVisitorVisits a type variable.- Specified by:
visitTypeVariablein interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitWildcard
Description copied from interface:AnnotatedTypeVisitorVisits a wildcard type.- Specified by:
visitWildcardin interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitPrimitive
Description copied from interface:AnnotatedTypeVisitorVisits a primitive type.- Specified by:
visitPrimitivein interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitNull
Description copied from interface:AnnotatedTypeVisitorVisits anulltype.- Specified by:
visitNullin interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-
visitNoType
Description copied from interface:AnnotatedTypeVisitorVisits NoType type.- Specified by:
visitNoTypein interfaceAnnotatedTypeVisitor<R,P> - Parameters:
type- the type to visitp- a visitor-specified parameter- Returns:
- a visitor-specified result
-