public class TextParseUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
TextParseUtil.ParsedValueEvaluator
A parsed value evaluator for
TextParseUtil . |
Constructor and Description |
---|
TextParseUtil() |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
commaDelimitedStringToSet(String s)
Returns a set from comma delimited Strings.
|
static Object |
translateVariables(char[] openChars,
String expression,
ValueStack stack,
Class asType,
TextParseUtil.ParsedValueEvaluator evaluator)
Converted object from variable translation.
|
static Object |
translateVariables(char[] openChars,
String expression,
ValueStack stack,
Class asType,
TextParseUtil.ParsedValueEvaluator evaluator,
int maxLoopCount)
Converted object from variable translation.
|
static String |
translateVariables(char open,
String expression,
ValueStack stack)
Converts all instances of ${...} in
expression to the value returned
by a call to ValueStack.findValue(java.lang.String) . |
static Object |
translateVariables(char open,
String expression,
ValueStack stack,
Class asType)
Converted object from variable translation.
|
static Object |
translateVariables(char open,
String expression,
ValueStack stack,
Class asType,
TextParseUtil.ParsedValueEvaluator evaluator)
Converted object from variable translation.
|
static Object |
translateVariables(char open,
String expression,
ValueStack stack,
Class asType,
TextParseUtil.ParsedValueEvaluator evaluator,
int maxLoopCount)
Converted object from variable translation.
|
static String |
translateVariables(String expression,
ValueStack stack)
Converts all instances of ${...}, and %{...} in
expression to the value returned
by a call to ValueStack.findValue(java.lang.String) . |
static String |
translateVariables(String expression,
ValueStack stack,
TextParseUtil.ParsedValueEvaluator evaluator)
Function similarly as
translateVariables(char, String, ValueStack)
except for the introduction of an additional evaluator that allows
the parsed value to be evaluated by the evaluator . |
static Collection<String> |
translateVariablesCollection(char[] openChars,
String expression,
ValueStack stack,
boolean excludeEmptyElements,
TextParseUtil.ParsedValueEvaluator evaluator,
int maxLoopCount)
Resolves given expression on given ValueStack.
|
static Collection<String> |
translateVariablesCollection(String expression,
ValueStack stack,
boolean excludeEmptyElements,
TextParseUtil.ParsedValueEvaluator evaluator) |
public static String translateVariables(String expression, ValueStack stack)
expression
to the value returned
by a call to ValueStack.findValue(java.lang.String)
. If an item cannot
be found on the stack (null is returned), then the entire variable ${...} is not
displayed, just as if the item was on the stack but returned an empty string.expression
- an expression that hasn't yet been translatedstack
- value stackpublic static String translateVariables(String expression, ValueStack stack, TextParseUtil.ParsedValueEvaluator evaluator)
translateVariables(char, String, ValueStack)
except for the introduction of an additional evaluator
that allows
the parsed value to be evaluated by the evaluator
. The evaluator
could be null, if it is it will just be skipped as if it is just calling
translateVariables(char, String, ValueStack)
.
expression
- expression stringstack
- value stackevaluator
- The parsed Value evaluator (could be null).public static String translateVariables(char open, String expression, ValueStack stack)
expression
to the value returned
by a call to ValueStack.findValue(java.lang.String)
. If an item cannot
be found on the stack (null is returned), then the entire variable ${...} is not
displayed, just as if the item was on the stack but returned an empty string.open
- open characterexpression
- expression stringstack
- value stackpublic static Object translateVariables(char open, String expression, ValueStack stack, Class asType)
open
- open characterexpression
- expression stringstack
- value stackasType
- as class typepublic static Object translateVariables(char open, String expression, ValueStack stack, Class asType, TextParseUtil.ParsedValueEvaluator evaluator)
open
- open characterexpression
- expression stringstack
- value stackasType
- as class typeevaluator
- value evaluatorpublic static Object translateVariables(char[] openChars, String expression, ValueStack stack, Class asType, TextParseUtil.ParsedValueEvaluator evaluator)
openChars
- open character arrayexpression
- expression stringstack
- value stackasType
- as class typeevaluator
- value evaluatorpublic static Object translateVariables(char open, String expression, ValueStack stack, Class asType, TextParseUtil.ParsedValueEvaluator evaluator, int maxLoopCount)
open
- open characterexpression
- expression stringstack
- value stackasType
- as class typeevaluator
- value evaluatormaxLoopCount
- max loop countpublic static Object translateVariables(char[] openChars, String expression, ValueStack stack, Class asType, TextParseUtil.ParsedValueEvaluator evaluator, int maxLoopCount)
openChars
- open character arrayexpression
- expression stringstack
- value stackasType
- as class typeevaluator
- value evaluatormaxLoopCount
- max loop countpublic static Collection<String> translateVariablesCollection(String expression, ValueStack stack, boolean excludeEmptyElements, TextParseUtil.ParsedValueEvaluator evaluator)
expression
- expression stringstack
- value stackexcludeEmptyElements
- Whether empty elements shall be excluded.evaluator
- value evaluatortranslateVariablesCollection(char[], String, ValueStack, boolean, ParsedValueEvaluator, int)
public static Collection<String> translateVariablesCollection(char[] openChars, String expression, ValueStack stack, boolean excludeEmptyElements, TextParseUtil.ParsedValueEvaluator evaluator, int maxLoopCount)
openChars
- open character arrayexpression
- expression stringstack
- value stackevaluator
- value evaluatorexcludeEmptyElements
- Whether empty elements shall be excluded.maxLoopCount
- max loop countCopyright © 2000–2020 Apache Software Foundation. All rights reserved.