public class Subsequence extends Object
HasSubsequence annotations.| Modifier and Type | Field and Description |
|---|---|
String |
array
Name of the Subsequence.
|
String |
from
First index of the subsequence in the backing sequence.
|
String |
to
Last index of the subsequence in the backing sequence.
|
| Modifier and Type | Method and Description |
|---|---|
static JavaExpressionParseUtil.JavaExpressionContext |
getContextFromJavaExpression(JavaExpression expr,
SourceChecker checker)
If the passed expression is a FieldAccess, returns the context associated with it.
|
static Subsequence |
getSubsequenceFromReceiver(JavaExpression expr,
AnnotatedTypeFactory factory,
TreePath currentPath,
JavaExpressionParseUtil.JavaExpressionContext context)
Returns a Subsequence representing the
HasSubsequence annotation on the declaration
of rec or null if there is not such annotation. |
static Subsequence |
getSubsequenceFromTree(Tree varTree,
AnnotatedTypeFactory factory)
Returns a Subsequence representing the
HasSubsequence annotation on the declaration
of varTree or null if there is not such annotation. |
static String |
negateString(String s,
TreePath currentPath,
JavaExpressionParseUtil.JavaExpressionContext context)
Returns the additive inverse of the given String.
|
String |
toString() |
public final String array
public final String from
public final String to
public static Subsequence getSubsequenceFromTree(Tree varTree, AnnotatedTypeFactory factory)
HasSubsequence annotation on the declaration
of varTree or null if there is not such annotation.
Note that this method does not standardize or viewpoint adapt the arguments to the annotation, unlike getSubsequenceFromReceiver.
varTree - some treefactory - an AnnotatedTypeFactoryvarTreepublic static Subsequence getSubsequenceFromReceiver(JavaExpression expr, AnnotatedTypeFactory factory, TreePath currentPath, JavaExpressionParseUtil.JavaExpressionContext context)
HasSubsequence annotation on the declaration
of rec or null if there is not such annotation.expr - some treefactory - an AnnotatedTypeFactorycurrentPath - the path at which to viewpoint adapt the subsequencecontext - the context in which to viewpoint adapt the subsequencevarTreepublic static JavaExpressionParseUtil.JavaExpressionContext getContextFromJavaExpression(JavaExpression expr, SourceChecker checker)
Used to standardize and viewpoint adapt arguments to HasSubsequence annotations.
expr - the expression from which to obtain a contextchecker - the type-checkerpublic static String negateString(String s, TreePath currentPath, JavaExpressionParseUtil.JavaExpressionContext context)
The passed String is standardized and viewpoint adapted before this transformation is applied.