|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.umber.core.text.filters.TextResolver
Text filter which performs variable lookup and substitution from a Map of values. The syntax of the variable can be defined by either a start and end token, or by a regular expression.
Constructor Summary | |
TextResolver(java.util.Map map,
boolean swallowUndefined)
Creates a new instance of TextResolver with default token delimiters "${" and "}". |
|
TextResolver(java.util.Map map,
java.lang.String regexp,
boolean swallowUndefined)
Creates a new instance of TextResolver with static start and end token delimiters. |
|
TextResolver(java.util.Map map,
java.lang.String startToken,
java.lang.String endToken,
boolean swallowUndefined)
Creates a new instance of TextResolver with static start and end token delimiters. |
Method Summary | |
java.lang.String |
filterText(java.lang.String text)
Sends input document through a modifying filter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextResolver(java.util.Map map, boolean swallowUndefined)
map
- variable resolution lookup mapswallowUndefined
- true to remove variables that don't exist in
lookup map, or false to pass them through untouchedpublic TextResolver(java.util.Map map, java.lang.String startToken, java.lang.String endToken, boolean swallowUndefined)
map
- variable resolution lookup mapstartToken
- start token to find variablesendToken
- end token to find variablesswallowUndefined
- true to remove variables that don't exist in
lookup map, or false to pass them through untouchedpublic TextResolver(java.util.Map map, java.lang.String regexp, boolean swallowUndefined)
map
- variable resolution lookup mapregexp
- regular expression to find variablesswallowUndefined
- true to remove variables that don't exist in
lookup map, or false to pass them through untouchedMethod Detail |
public java.lang.String filterText(java.lang.String text)
This implementation finds and replaces all matching variables by values in the lookup map.
filterText
in interface ITextFilter
text
- input text document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |