public class FlowExpressionParseUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FlowExpressionParseUtil.FlowExpressionContext
Context used to parse a flow expression.
|
static class |
FlowExpressionParseUtil.FlowExpressionParseException
An exception that indicates a parse error.
|
Modifier and Type | Field and Description |
---|---|
protected static java.util.regex.Pattern |
arrayPattern
Matches an array access
|
protected static java.util.regex.Pattern |
dotPattern
Matches a field access
|
protected static java.util.regex.Pattern |
identifierPattern
Matches an identifier
|
protected static java.lang.String |
identifierRegex
Regular expression for an identifier
|
protected static java.util.regex.Pattern |
intPattern
Matches integer literals
|
protected static java.util.regex.Pattern |
longPattern
Matches long literals
|
protected static java.util.regex.Pattern |
methodPattern
Matches a method call
|
protected static java.util.regex.Pattern |
nullPattern
Matches the null literal
|
protected static java.util.regex.Pattern |
parameterPattern
Matches a parameter
|
protected static java.util.regex.Pattern |
parametersPattern
Finds all parameters
|
protected static java.util.regex.Pattern |
selfPattern
Matches the self reference.
|
protected static java.util.regex.Pattern |
stringPattern
Matches string literals
|
protected static java.util.regex.Pattern |
superPattern
Matches 'super'
|
Constructor and Description |
---|
FlowExpressionParseUtil() |
protected static final java.lang.String identifierRegex
protected static final java.util.regex.Pattern parameterPattern
protected static final java.util.regex.Pattern parametersPattern
protected static final java.util.regex.Pattern selfPattern
protected static final java.util.regex.Pattern superPattern
protected static final java.util.regex.Pattern identifierPattern
protected static final java.util.regex.Pattern methodPattern
protected static final java.util.regex.Pattern arrayPattern
protected static final java.util.regex.Pattern dotPattern
protected static final java.util.regex.Pattern intPattern
protected static final java.util.regex.Pattern longPattern
protected static final java.util.regex.Pattern stringPattern
protected static final java.util.regex.Pattern nullPattern
public static FlowExpressions.Receiver parse(java.lang.String s, FlowExpressionParseUtil.FlowExpressionContext context, com.sun.source.util.TreePath path) throws FlowExpressionParseUtil.FlowExpressionParseException
FlowExpressions.Receiver
, or
throw an FlowExpressionParseUtil.FlowExpressionParseException
. The expression is assumed
to be used in the context of a method.s
- The string to parse.context
- information about any receiver and argumentspath
- The current tree path.FlowExpressionParseUtil.FlowExpressionParseException
public static java.util.List<java.lang.Integer> parameterIndices(java.lang.String s)
s
, identified by the
number of the parameter (starting at 1).public static FlowExpressionParseUtil.FlowExpressionContext buildFlowExprContextForDeclaration(com.sun.source.tree.MethodTree node, com.sun.source.tree.Tree classTree, AnnotatedTypeFactory factory)
FlowExpressionParseUtil.FlowExpressionContext
for the method node
as
seen at the method declaration.public static FlowExpressionParseUtil.FlowExpressionContext buildFlowExprContextForDeclaration(com.sun.source.tree.MethodTree node, javax.lang.model.type.TypeMirror classType, AnnotatedTypeFactory factory)
FlowExpressionParseUtil.FlowExpressionContext
for the method node
as
seen at the method declaration.public static FlowExpressionParseUtil.FlowExpressionContext buildFlowExprContextForDeclaration(com.sun.source.tree.MethodTree node, com.sun.source.util.TreePath currentPath, AnnotatedTypeFactory factory)
FlowExpressionParseUtil.FlowExpressionContext
for the method node
as
seen at the method declaration.public static FlowExpressionParseUtil.FlowExpressionContext buildFlowExprContextForUse(MethodInvocationNode n, AnnotatedTypeFactory factory)
FlowExpressionParseUtil.FlowExpressionContext
for the method node
(represented as a Node
as seen at the method use (i.e.,
at a method call site).