Class ExpressionFactory
java.lang.Object
org.glassfish.pfl.dynamic.codegen.impl.ExpressionFactory
Used to create all expressions. BlockStatement is used as the
factory for creating instances of ExpressionFactory. All statements
created by an ExpressionFactory have the BlockStatement that
created this ExpressionFactory as their parent. An ExpressionFactory
should be used only to create Expression instances in statements
inside the creating BlockStatement. Each subtype of Expression is
defined as a static inner class in ExpressionFactory.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
static enum
Representation of binary operators.static final class
static enum
static class
Representation of any sort of method call other than a constructor invocation.static final class
static final class
Class that represents a constant value of any primitive type, a String, or a Class.static class
static class
static final class
static final class
static final class
static final class
static final class
static final class
static final class
static final class
static final class
static final class
static final class
Class used to represent the current object ("this" in java).static final class
static enum
Operators that apply to a single expression.static final class
Representation of the application of a UnaryOperator to an Expression.static final class
static final class
Class that represents a void expression. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Node
private final IdentityHashMap
<Expression, Boolean> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_const
(boolean c) _const
(byte c) _const
(char c) _const
(double c) _const
(float c) _const
(int c) _const
(long c) _const
(short c) _null()
_this()
_void()
arrayIndex
(Expression expr, Expression index) arrayLength
(Expression expr) binaryOperator
(Expression left, ExpressionFactory.BinaryOperator op, Expression right) call
(Expression target, String ident, List<Expression> exprs) Shorthand form to construct invocation that looks up Signature based on the types of the expressions in exprs.call
(Expression target, String ident, Signature signature, List<Expression> exprs) Construct a representation of a non-static method invocation.cast
(Type type, Expression expr) (package private) static List
<Expression> copyExpressionList
(Node newParent, List<Expression> exprs) final Node
efparent()
fieldAccess
(Expression target, String fieldName) fieldAccess
(Type target, String fieldName) ifExpression
(Expression condition, Expression truePart, Expression falsePart) instof
(Expression expr, Type type) newArr
(Type type, Expression size) newArrInit
(Type type, List<Expression> exprs) newObj
(Type type, List<Expression> exprs) newObj
(Type type, Signature signature, List<Expression> args) staticCall
(Type target, String ident, List<Expression> exprs) Shorthand form to construct invocation that looks up Signature based on the types of the expressions in exprs.staticCall
(Type target, String ident, Signature signature, List<Expression> exprs) Construct a representation of a static method invocation.superCall
(String ident, List<Expression> exprs) superCall
(String ident, Signature signature, List<Expression> exprs) superObj
(List<Expression> exprs) Call to superclass constructor.superObj
(Signature signature, List<Expression> exprs) Call to superclass constructor.thisObj
(List<Expression> exprs) Call to another constructor.thisObj
(Signature signature, List<Expression> exprs) Call to another constructor.unaryOp
(ExpressionFactory.UnaryOperator op, Expression expr) final IdentityHashMap
<Expression, Boolean>
-
Field Details
-
efparent
-
unusedExpressions
-
-
Constructor Details
-
ExpressionFactory
-
-
Method Details
-
efparent
-
unusedExpressions
-
copyExpressionList
-
_null
-
_const
-
_const
-
_const
-
_const
-
_const
-
_const
-
_const
-
_const
-
_const
-
_const
-
_void
-
_this
-
call
public Expression call(Expression target, String ident, Signature signature, List<Expression> exprs) Construct a representation of a non-static method invocation. -
call
Shorthand form to construct invocation that looks up Signature based on the types of the expressions in exprs. Can probably be used in most circumstances. -
staticCall
public Expression staticCall(Type target, String ident, Signature signature, List<Expression> exprs) Construct a representation of a static method invocation. -
staticCall
Shorthand form to construct invocation that looks up Signature based on the types of the expressions in exprs. Can probably be used in most circumstances. -
unaryOp
-
binaryOperator
public Expression binaryOperator(Expression left, ExpressionFactory.BinaryOperator op, Expression right) -
cast
-
instof
-
newObj
-
newObj
-
newArrInit
-
newArr
-
superCall
-
superCall
-
superObj
Call to superclass constructor. Must be first in the method. -
superObj
Call to superclass constructor. Must be first in the method. This is a shorthand form that computes the Signature directly from the Expression list exprs. -
thisObj
Call to another constructor. Must be first in the method. -
thisObj
Call to another constructor. Must be first in the method. This is a shorthand form that computes the Signature directly from the Expression list exprs. -
fieldAccess
-
fieldAccess
-
arrayIndex
-
arrayLength
-
ifExpression
-
variable
-