Class PlaceholderParser

java.lang.Object
com.espertech.esper.common.internal.util.PlaceholderParser

public class PlaceholderParser extends Object
Parser for strings with substitution parameters of the form ${parameter}.
  • Constructor Details

    • PlaceholderParser

      public PlaceholderParser()
  • Method Details

    • parsePlaceholder

      public static List<PlaceholderParser.Fragment> parsePlaceholder(String parseString) throws PlaceholderParseException
      Parses a string to find placeholders of format ${placeholder}.

      Example: "My ${thing} is ${color}"

      The example above parses into 4 fragements: a text fragment of value "My ", a parameter fragment "thing", a text fragement " is " and a parameter fragment "color".

      Parameters:
      parseString - is the string to parse
      Returns:
      list of fragements that can be either text fragments or placeholder fragments
      Throws:
      PlaceholderParseException - if the string cannot be parsed to indicate syntax errors