|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.util.TemplateParser
public final class TemplateParser
TemplateParser
is a simple string parser that will substitute
tokens in a string with values supplied in a Map.
Nested Class Summary | |
---|---|
static class |
TemplateParser.PatternInfo
|
static interface |
TemplateParser.TemplateCallback
|
Field Summary | |
---|---|
static Pattern |
ANT_TEMPLATE_PATTERN
|
static String |
ANT_TEMPLATE_STYLE
|
static Pattern |
CURLY_TEMPLATE_PATTERN
|
static String |
CURLY_TEMPLATE_STYLE
|
protected static Log |
logger
logger used by this class |
static Pattern |
SQUARE_TEMPLATE_PATTERN
|
static String |
SQUARE_TEMPLATE_STYLE
|
static Pattern |
WIGGLY_MULE_TEMPLATE_PATTERN
|
static String |
WIGGLY_MULE_TEMPLATE_STYLE
|
Method Summary | |
---|---|
static TemplateParser |
createAntStyleParser()
|
static TemplateParser |
createCurlyBracesStyleParser()
|
static TemplateParser |
createMuleStyleParser()
|
static TemplateParser |
createSquareBracesStyleParser()
|
TemplateParser.PatternInfo |
getStyle()
|
boolean |
isContainsTemplate(String value)
|
boolean |
isValid(String expression)
|
List |
parse(Map props,
List templates)
Matches one or more templates against a Map of key value pairs. |
Map |
parse(Map props,
Map templates)
Matches one or more templates against a Map of key value pairs. |
String |
parse(Map props,
String template)
Matches one or more templates against a Map of key value pairs. |
protected String |
parse(Map props,
String template,
TemplateParser.TemplateCallback callback)
|
Map |
parse(TemplateParser.TemplateCallback callback,
Map templates)
|
String |
parse(TemplateParser.TemplateCallback callback,
String template)
Matches one or more templates against a Map of key value pairs. |
void |
validate(String expression)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ANT_TEMPLATE_STYLE
public static final String SQUARE_TEMPLATE_STYLE
public static final String CURLY_TEMPLATE_STYLE
public static final String WIGGLY_MULE_TEMPLATE_STYLE
protected static final Log logger
public static final Pattern ANT_TEMPLATE_PATTERN
public static final Pattern SQUARE_TEMPLATE_PATTERN
public static final Pattern CURLY_TEMPLATE_PATTERN
public static final Pattern WIGGLY_MULE_TEMPLATE_PATTERN
Method Detail |
---|
public static TemplateParser createAntStyleParser()
public static TemplateParser createSquareBracesStyleParser()
public static TemplateParser createCurlyBracesStyleParser()
public static TemplateParser createMuleStyleParser()
public String parse(Map props, String template)
props
- the key/value pairs to match againsttemplate
- the string containing the template place holders i.e. My name
is ${name}
public String parse(TemplateParser.TemplateCallback callback, String template)
callback
- a callback used to resolve the property nametemplate
- the string containing the template place holders i.e. My name
is ${name}
protected String parse(Map props, String template, TemplateParser.TemplateCallback callback)
public List parse(Map props, List templates)
props
- the key/value pairs to match againsttemplates
- A List of templates
public Map parse(Map props, Map templates)
props
- the key/value pairs to match againsttemplates
- A Map of templates. The values for each map entry will be
parsed
public Map parse(TemplateParser.TemplateCallback callback, Map templates)
public TemplateParser.PatternInfo getStyle()
public boolean isContainsTemplate(String value)
public boolean isValid(String expression)
public void validate(String expression) throws IllegalArgumentException
IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |