java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
All Implemented Interfaces:
ToCondition, ToExpression
Direct Known Subclasses:
Condition, Expression, Parameter

public abstract class SyntaxElement extends Object implements ToCondition, ToExpression
A class that is coercible into Conditions and Expressions for use in composing rule-sets in code.
  • Constructor Details

    • SyntaxElement

      public SyntaxElement()
  • Method Details

    • booleanEqual

      public final BooleanEquals booleanEqual(boolean value)
      Returns a BooleanEquals expression comparing this expression to the provided boolean value.
      Parameters:
      value - the value to compare against.
      Returns:
      the BooleanEquals function.
    • stringEqual

      public final StringEquals stringEqual(String value)
      Returns a StringEquals function of this expression and the given string value.
      Parameters:
      value - the string value to compare this expression to.
      Returns:
      the StringEquals function.
    • getAttr

      public final GetAttr getAttr(String path)
      Returns a GetAttr function containing the given path string.
      Parameters:
      path - the path.
      Returns:
      the GetAttr function.
    • getAttr

      public final GetAttr getAttr(Identifier path)
      Returns a GetAttr function containing the given identifier.
      Parameters:
      path - the path.
      Returns:
      the GetAttr function.
    • isSet

      public final IsSet isSet()
      Returns an IsSet expression for this instance.
      Returns:
      the IsSet function.
    • isValidHostLabel

      public final IsValidHostLabel isValidHostLabel(boolean allowDots)
      Returns an isValidHostLabel expression of this expression.
      Parameters:
      allowDots - whether the UTF-8 . is considered valid within a host label.
      Returns:
      the IsValidHostLabel function.
    • not

      public final Not not()
      Returns a Not expression of this instance.
      Returns:
      the Not function.
    • parseUrl

      public final ParseUrl parseUrl()
      Returns a parseUrl expression of this expression.
      Returns:
      the ParseUrl function.
    • substring

      public final Substring substring(int startIndex, int stopIndex, boolean reverse)
      Returns a Substring expression of this expression.
      Parameters:
      startIndex - the starting index of the string.
      stopIndex - the ending index of the string.
      reverse - whether the indexing is should start from end of the string to start.
      Returns:
      the Substring function.
    • template

      public String template()
      Converts this expression to a string template. By default, this implementation returns a RuntimeException.
      Returns:
      the String template.