|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.util.TextParseUtil
public class TextParseUtil
Utility class for text parsing.
Nested Class Summary | |
---|---|
static interface |
TextParseUtil.ParsedValueEvaluator
A parsed value evaluator for TextParseUtil . |
Constructor Summary | |
---|---|
TextParseUtil()
|
Method Summary | |
---|---|
static java.util.Set |
commaDelimitedStringToSet(java.lang.String s)
Returns a set from comma delimted Strings. |
static java.lang.String |
translateVariables(char open,
java.lang.String expression,
OgnlValueStack stack)
Converts all instances of ${...} in expression to the value returned
by a call to OgnlValueStack.findValue(java.lang.String) . |
static java.lang.Object |
translateVariables(char open,
java.lang.String expression,
OgnlValueStack stack,
java.lang.Class asType)
Converted object from variable translation. |
static java.lang.Object |
translateVariables(char open,
java.lang.String expression,
OgnlValueStack stack,
java.lang.Class asType,
TextParseUtil.ParsedValueEvaluator evaluator)
Converted object from variable translation. |
static java.lang.String |
translateVariables(java.lang.String expression,
OgnlValueStack stack)
Converts all instances of ${...} in expression to the value returned
by a call to OgnlValueStack.findValue(java.lang.String) . |
static java.lang.String |
translateVariables(java.lang.String expression,
OgnlValueStack stack,
TextParseUtil.ParsedValueEvaluator evaluator)
Function similarly as translateVariables(char, String, OgnlValueStack)
except for the introduction of an additional evaluator that allows
the parsed value to be evaluated by the evaluator . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextParseUtil()
Method Detail |
---|
public static java.lang.String translateVariables(java.lang.String expression, OgnlValueStack stack)
expression
to the value returned
by a call to OgnlValueStack.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 translated
public static java.lang.String translateVariables(java.lang.String expression, OgnlValueStack stack, TextParseUtil.ParsedValueEvaluator evaluator)
translateVariables(char, String, OgnlValueStack)
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, OgnlValueStack)
.
A typical use-case would be when we need to URL Encode the parsed value. To do so
we could just supply a URLEncodingEvaluator for example.
expression
- stack
- evaluator
- The parsed Value evaluator (could be null).
TextParseUtil.ParsedValueEvaluator}
public static java.lang.String translateVariables(char open, java.lang.String expression, OgnlValueStack stack)
expression
to the value returned
by a call to OgnlValueStack.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
- expression
- stack
-
public static java.lang.Object translateVariables(char open, java.lang.String expression, OgnlValueStack stack, java.lang.Class asType)
open
- expression
- stack
- asType
-
public static java.lang.Object translateVariables(char open, java.lang.String expression, OgnlValueStack stack, java.lang.Class asType, TextParseUtil.ParsedValueEvaluator evaluator)
open
- expression
- stack
- asType
- evaluator
-
public static java.util.Set commaDelimitedStringToSet(java.lang.String s)
s
- The String to parse.
|
XWork Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |