Class ExpressionNode

    • Constructor Detail

      • ExpressionNode

        ExpressionNode​(java.lang.String resourceName,
                       int lineNumber)
    • Method Detail

      • isTrue

        boolean isTrue​(EvaluationContext context)
        True if evaluating this expression yields a value that is considered true by Velocity's rules. A value is false if it is null or equal to Boolean.FALSE. Every other value is true.

        Note that the text at the similar link here states that empty collections and empty strings are also considered false, but that is not true.

      • isDefinedAndTrue

        boolean isDefinedAndTrue​(EvaluationContext context)
        True if this is a defined value and it evaluates to true. This is the same as isTrue(com.google.auto.value.processor.escapevelocity.EvaluationContext) except that it is allowed for this to be undefined variable, in which it evaluates to false. The method is overridden for plain references so that undefined is the same as false. The reason is to support Velocity's idiom #if ($var), where it is not an error if $var is undefined.
      • intValue

        int intValue​(EvaluationContext context)
        The integer result of evaluating this expression.
        Throws:
        EvaluationException - if evaluating the expression produces an exception, or if it yields a value that is not an integer.
      • show

        private static java.lang.String show​(java.lang.Object value)
        Returns a string representing the given value, for use in error messages. The string includes both the value's toString() and its type.