Class IfCommand

All Implemented Interfaces:
Command

public class IfCommand extends AbstractCommand
Implements if-else logic
Author:
Leonid Vysochyn
  • Field Details

  • Constructor Details

    • IfCommand

      public IfCommand()
    • IfCommand

      public IfCommand(String condition)
      Parameters:
      condition - JEXL expression for boolean condition to evaluate
    • IfCommand

      public IfCommand(String condition, XlsArea ifArea)
    • IfCommand

      public IfCommand(String condition, Area ifArea, Area elseArea)
  • Method Details

    • getName

      public String getName()
      Returns:
      command name
    • getCondition

      public String getCondition()
      Gets test condition as JEXL expression string
      Returns:
      test condition
    • setCondition

      public void setCondition(String condition)
      Sets test condition as JEXL expression string
      Parameters:
      condition - condition to test
    • getIfArea

      public Area getIfArea()
      Gets an area to render when the condition is evaluated to 'true'
      Returns:
      if Area
    • getElseArea

      public Area getElseArea()
      Gets an area to render when the condition is evaluated to 'false'
      Returns:
      else Area
    • addArea

      public Command addArea(Area area)
      Description copied from interface: Command
      Adds an area to this command
      Specified by:
      addArea in interface Command
      Overrides:
      addArea in class AbstractCommand
      Parameters:
      area - to be added area
      Returns:
      this command instance
    • applyAt

      public Size applyAt(CellRef cellRef, Context context)
      Description copied from interface: Command
      Applies a command at the given cell reference
      Parameters:
      cellRef - cell reference where the command must be applied
      context - bean context to use
      Returns:
      size of enclosing command area after transformation