Class PlaceholderParser
java.lang.Object
com.espertech.esper.common.internal.util.PlaceholderParser
Parser for strings with substitution parameters of the form ${parameter}.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Fragment is a parse result, a parse results in an ordered list of fragments.static class
Represents a parameter in a parsed string of texts and parameters.static class
Represents a piece of text in a parse string with placeholder values. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<PlaceholderParser.Fragment>
parsePlaceholder
(String parseString) Parses a string to find placeholders of format ${placeholder}.
-
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
-