Class OffsetDependentTypesHelper
- java.lang.Object
-
- org.checkerframework.framework.util.dependenttypes.DependentTypesHelper
-
- org.checkerframework.checker.index.OffsetDependentTypesHelper
-
public class OffsetDependentTypesHelper extends DependentTypesHelper
Dependent type helper for array offset expressions. Each array offset expression may be the addition or subtraction of several Java expressions. For example,array.length - 1
.
-
-
Field Summary
-
Fields inherited from class org.checkerframework.framework.util.dependenttypes.DependentTypesHelper
atypeFactory, objectTM
-
-
Constructor Summary
Constructors Constructor Description OffsetDependentTypesHelper(AnnotatedTypeFactory atypeFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreeAnnotator
createDependentTypesTreeAnnotator()
Creates a TreeAnnotator that viewpoint-adapts dependent type annotations.protected @Nullable JavaExpression
transform(JavaExpression javaExpr)
This method is for subclasses to override to change JavaExpressions in some way before they are inserted into new annotations.-
Methods inherited from class org.checkerframework.framework.util.dependenttypes.DependentTypesHelper
atConstructorInvocation, atExpression, atFieldAccess, atLocalVariable, atMethodBody, atMethodInvocation, atParameterizedTypeUse, atTypeDecl, atVariableDeclaration, buildAnnotation, checkAnnotationForErrorExpressions, checkClassForErrorExpressions, checkMethodForErrorExpressions, checkTypeForErrorExpressions, convertAnnotatedTypeMirror, convertAnnotationMirror, createError, createError, delocalize, delocalizeAtCallsite, hasDependentAnnotations, reportErrors, shouldPassThroughExpression
-
-
-
-
Constructor Detail
-
OffsetDependentTypesHelper
public OffsetDependentTypesHelper(AnnotatedTypeFactory atypeFactory)
-
-
Method Detail
-
transform
protected @Nullable JavaExpression transform(JavaExpression javaExpr)
Description copied from class:DependentTypesHelper
This method is for subclasses to override to change JavaExpressions in some way before they are inserted into new annotations. This method is called after parsing and viewpoint-adaptation have occurred.javaExpr
may be aDependentTypesHelper.PassThroughExpression
.If
null
is returned then the expression is not added to the new annotation.The default implementation returns the argument, but subclasses may override it.
- Overrides:
transform
in classDependentTypesHelper
- Parameters:
javaExpr
- a JavaExpression- Returns:
- a transformed JavaExpression or
null
if no transformation exists
-
createDependentTypesTreeAnnotator
public TreeAnnotator createDependentTypesTreeAnnotator()
Description copied from class:DependentTypesHelper
Creates a TreeAnnotator that viewpoint-adapts dependent type annotations.- Overrides:
createDependentTypesTreeAnnotator
in classDependentTypesHelper
- Returns:
- a new TreeAnnotator that viewpoint-adapts dependent type annotations
-
-