- java.lang.Object
-
- javax0.jamal.builtins.If
-
- All Implemented Interfaces:
Macro
public class If extends java.lang.Object implements Macro
Define theif
conditional macro. The syntax of the macro is{#if/test/then content/else content}
The result of the evaluated macro will be the
then content
when thetest
is true and theelse
content otherwise. Thetest
is true, if it is the literal"true"
(case insensitive), an integer number and the value is not zero or any other string that contains at least one non-space character, except when thetest
is the literal"false"
(case insensitive) then the test is false.The syntax depicted above using the
/
character as separator. It is only convention. Any non-space character can be used as separator. The first non-space character following theif
will be used as separator character.
-
-
Constructor Summary
Constructors Constructor Description If()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
evaluate(Input input, Processor processor)
-