Module jamal.core

Class If

  • All Implemented Interfaces:
    Macro

    public class If
    extends java.lang.Object
    implements Macro
    Define the if 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 the test is true and the else content otherwise. The test 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 the test 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 the if 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax0.jamal.api.Macro

        getId