Constructor and Description |
---|
NodeUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isArrayLengthFieldAccess(Node node)
Returns true iff
node is a FieldAccessNode that is an access to an array's
length. |
static boolean |
isBooleanTypeNode(Node node)
Returns true iff
node corresponds to a boolean typed expression (either the primitive
type boolean , or class type Boolean ). |
static boolean |
isConstantBoolean(Node n,
boolean value)
Returns true if the given node statically evaluates to
value and has no side effects. |
static boolean |
isMethodInvocation(Node node,
ExecutableElement method,
ProcessingEnvironment env)
Returns true iff
node is an invocation of the given method. |
static Node |
removeCasts(Node node)
Remove any
TypeCastNode s wrapping a node, returning the operand nested within the type
casts. |
public static boolean isBooleanTypeNode(Node node)
node
corresponds to a boolean typed expression (either the primitive
type boolean
, or class type Boolean
).node
corresponds to a boolean typed expression (either the primitive
type boolean
, or class type Boolean
)public static boolean isArrayLengthFieldAccess(Node node)
node
is a FieldAccessNode
that is an access to an array's
length.node
is a FieldAccessNode
that is an access to an array's
lengthpublic static boolean isMethodInvocation(Node node, ExecutableElement method, ProcessingEnvironment env)
node
is an invocation of the given method.public static boolean isConstantBoolean(Node n, boolean value)
value
and has no side effects.n
- a nodevalue
- the boolean value that the node is tested againstvalue
public static Node removeCasts(Node node)
TypeCastNode
s wrapping a node, returning the operand nested within the type
casts.node
- a node