Class ScalarExp

java.lang.Object
org.apache.cayenne.exp.Expression
org.apache.cayenne.exp.ScalarExp
All Implemented Interfaces:
XMLSerializable

public final class ScalarExp extends Expression
A plain value in the place of an expression, e.g. a constant select column or a whole where clause. A value that is an operand of another expression is not wrapped in a scalar node; it is stored as is.
Since:
5.0
  • Field Details

    • value

      protected Object value
  • Constructor Details

    • ScalarExp

      public ScalarExp(Object... operands)
      Creates a scalar with the value passed as the only argument, or a null-valued scalar without arguments.
  • Method Details

    • evaluateNode

      protected Object evaluateNode(Object o) throws Exception
      Description copied from class: Expression
      Evaluates itself with object, pushing result on the stack.
      Specified by:
      evaluateNode in class Expression
      Throws:
      Exception
    • shallowCopy

      public Expression shallowCopy()
      Creates a copy of this expression node, without copying children.
      Specified by:
      shallowCopy in class Expression
    • appendAsString

      public void appendAsString(Appendable out) throws IOException
      Description copied from class: Expression
      Appends own content as a String to the provided Appendable: the operands separated by the operator.
      Overrides:
      appendAsString in class Expression
      Throws:
      IOException
    • setValue

      public void setValue(Object value)
    • getValue

      public Object getValue()
      Returns the value, resolving an EnumRef to its enum constant.
    • getExpressionOperator

      protected String getExpressionOperator(int index)
      Description copied from class: Expression
      Returns the operator printed between the operands, before the operand at the given index.
      Specified by:
      getExpressionOperator in class Expression
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Expression
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Expression
    • parenthesizeAsOperand

      protected boolean parenthesizeAsOperand()
      Description copied from class: Expression
      Whether this node is wrapped in parentheses when printed as an operand of another node. Compound nodes are, leaves and nodes with their own delimiters (function calls, lists) are not.
      Overrides:
      parenthesizeAsOperand in class Expression