abstract class ReferenceNode extends ExpressionNode
$
,
such as $x
or $x[$i].foo($j)
.Modifier and Type | Class and Description |
---|---|
(package private) static class |
ReferenceNode.IndexReferenceNode
A node in the parse tree that is an indexing of a reference, like
$x[0] or
$x.foo[$i] . |
(package private) static class |
ReferenceNode.MemberReferenceNode
A node in the parse tree that is a reference to a property of another reference, like
$x.foo or $x[$i].foo . |
(package private) static class |
ReferenceNode.MethodReferenceNode
A node in the parse tree representing a method reference, like
$list.size() . |
(package private) static class |
ReferenceNode.PlainReferenceNode
A node in the parse tree that is a plain reference such as
$x . |
ExpressionNode.BinaryExpressionNode, ExpressionNode.NotExpressionNode
Modifier and Type | Field and Description |
---|---|
private static java.lang.reflect.Method |
CLASS_GET_MODULE_METHOD |
private static java.lang.reflect.Method |
MODULE_IS_EXPORTED_METHOD |
private static java.lang.String |
THIS_PACKAGE |
lineNumber
Constructor and Description |
---|
ReferenceNode(int lineNumber) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
classIsExported(java.lang.Class<?> c) |
private static boolean |
classIsPublic(java.lang.Class<?> c)
Returns whether the given class is public as seen from this class.
|
(package private) java.lang.Object |
invokeMethod(java.lang.reflect.Method method,
java.lang.Object target,
java.util.List<java.lang.Object> argValues)
Invoke the given method on the given target with the given arguments.
|
private static java.lang.String |
packageNameOf(java.lang.Class<?> c) |
(package private) static java.lang.reflect.Method |
visibleMethod(java.lang.reflect.Method method,
java.lang.Class<?> in)
Returns a Method with the same name and parameter types as the given one, but that is in a
public class or interface.
|
intValue, isDefinedAndTrue, isTrue
cons, emptyNode, evaluate, evaluationException, evaluationException
private static final java.lang.String THIS_PACKAGE
private static final java.lang.reflect.Method CLASS_GET_MODULE_METHOD
private static final java.lang.reflect.Method MODULE_IS_EXPORTED_METHOD
java.lang.Object invokeMethod(java.lang.reflect.Method method, java.lang.Object target, java.util.List<java.lang.Object> argValues)
IllegalAccessException
. More than one ancestor might
define the method, but it doesn't matter which one we invoke since ultimately the code that
will run will be the same.private static java.lang.String packageNameOf(java.lang.Class<?> c)
static java.lang.reflect.Method visibleMethod(java.lang.reflect.Method method, java.lang.Class<?> in)
private static boolean classIsPublic(java.lang.Class<?> c)
c
, which is effectively
c.getModule().isExported(c.getPackageName())
. We use reflection so that the code can
compile on earlier Java versions.private static boolean classIsExported(java.lang.Class<?> c)