com.espertech.esper.util
Class PlaceholderParser

java.lang.Object
  extended by com.espertech.esper.util.PlaceholderParser

public class PlaceholderParser
extends java.lang.Object

Parser for strings with substitution parameters of the form ${parameter}.


Nested Class Summary
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 Summary
PlaceholderParser()
           
 
Method Summary
static java.util.List<PlaceholderParser.Fragment> parsePlaceholder(java.lang.String parseString)
          Parses a string to find placeholders of format ${placeholder}.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlaceholderParser

public PlaceholderParser()
Method Detail

parsePlaceholder

public static java.util.List<PlaceholderParser.Fragment> parsePlaceholder(java.lang.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

© 2006-2016 EsperTech Inc.
All rights reserved.
Visit us at espertech.com