Class ConditionalExpressionHelper

java.lang.Object
io.quarkus.qute.debug.agent.evaluations.ConditionalExpressionHelper

public class ConditionalExpressionHelper extends Object
Utility class to parse conditional expressions into Qute TemplateNodes.

In the debugger, breakpoints can have conditions (like `x > 5`). This class allows converting such a string condition into a TemplateNode that can be evaluated in the context of a template.

  • Constructor Details

    • ConditionalExpressionHelper

      public ConditionalExpressionHelper()
  • Method Details

    • parseCondition

      public static io.quarkus.qute.TemplateNode parseCondition(String condition)
      Parses a conditional expression string into a TemplateNode.

      The method wraps the condition in a temporary if-else template: {#if <condition>}true{#else}false{/if} and returns the first node, which represents the conditional logic.

      Parameters:
      condition - the condition expression (e.g., "x > 5")
      Returns:
      a TemplateNode representing the parsed conditional expression