public class PlaceholderParser extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PlaceholderParser.Fragment
Fragment is a parse result, a parse results in an ordered list of fragments.
|
static class |
PlaceholderParser.ParameterFragment
Represents a parameter in a parsed string of texts and parameters.
|
static class |
PlaceholderParser.TextFragment
Represents a piece of text in a parse string with placeholder values.
|
Constructor and Description |
---|
PlaceholderParser() |
Modifier and Type | Method and Description |
---|---|
static List<PlaceholderParser.Fragment> |
parsePlaceholder(String parseString)
Parses a string to find placeholders of format ${placeholder}.
|
public static List<PlaceholderParser.Fragment> parsePlaceholder(String parseString) throws PlaceholderParseException
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".
parseString
- is the string to parsePlaceholderParseException
- if the string cannot be parsed to indicate syntax errorsCopyright © 2005–2018. All rights reserved.