?:. For an expression a?:b if a is neither null
nor an empty String, the value of the expression is a.
If a is null or the empty String, then the value of the expression is b.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | generateCode(MethodVisitor
the ASM MethodVisitor into which code should be generated mv, CodeFlow a context object with info about what is on the stack cf)Overrides org. Generate the bytecode for this node into the supplied visitor. |
| public TypedValue | getValueInternal(ExpressionState
the expression state state)Implements abstract org. Evaluate the condition and if neither null nor an empty String, return it. |
| public boolean | isCompilable()
Overrides org. Check whether a node can be compiled to bytecode. |
| public String | toStringAST()
Implements org. Return the string form of this AST node. |
| Elvis | back to summary |
|---|---|
| public Elvis(int startPos, int endPos, SpelNodeImpl... args) | |
| computeExitTypeDescriptor | back to summary |
|---|---|
| private void computeExitTypeDescriptor() | |
| generateCode | back to summary |
|---|---|
| public void generateCode(MethodVisitor mv, CodeFlow cf) Overrides org. Doc from org. Generate the bytecode for this node into the supplied visitor. Context info about the current expression being compiled is available in the codeflow object, e.g. including information about the type of the object currently on the stack.
| |
| getValueInternal | back to summary |
|---|---|
| public TypedValue getValueInternal(ExpressionState state) throws EvaluationException Implements abstract org. Evaluate the condition and if neither null nor an empty String, return it. If it is null or an empty String, return the other value.
| |
| isCompilable | back to summary |
|---|---|
| public boolean isCompilable() Overrides org. Doc from org. Check whether a node can be compiled to bytecode. The reasoning in each node may be different but will typically involve checking whether the exit type descriptor of the node is known and any relevant child nodes are compilable.
| |
| toStringAST | back to summary |
|---|---|
| public String toStringAST() Implements org. Doc from org. Return the string form of this AST node. | |