|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ofbiz.base.util.string.FlexibleStringExpander
public class FlexibleStringExpander
Expands String values that contain Unified Expression Language syntax. Also supports the execution of bsh scripts by using the 'bsh:' prefix. Further it is possible to control the output by specifying the suffix '?currency(XXX)' to format the output according the current locale and specified (XXX) currency.
This class extends the UEL by allowing nested expressions.
Nested Class Summary | |
---|---|
protected static class |
FlexibleStringExpander.BshElem
|
protected static class |
FlexibleStringExpander.ConstElem
|
protected static class |
FlexibleStringExpander.CurrElem
|
protected static class |
FlexibleStringExpander.GroovyElem
|
protected static class |
FlexibleStringExpander.NestedVarElem
|
protected static interface |
FlexibleStringExpander.StrElem
|
protected static class |
FlexibleStringExpander.VarElem
|
Field Summary | |
---|---|
static java.lang.String |
closeBracket
|
protected static UtilCache<java.lang.String,FlexibleStringExpander> |
exprCache
|
protected int |
hint
|
static java.lang.String |
module
|
protected static FlexibleStringExpander |
nullExpr
|
static java.lang.String |
openBracket
|
protected java.lang.String |
orig
|
protected java.util.List<FlexibleStringExpander.StrElem> |
strElems
|
Constructor Summary | |
---|---|
protected |
FlexibleStringExpander(java.lang.String original)
|
Method Summary | |
---|---|
java.lang.String |
expandString(java.util.Map<java.lang.String,? extends java.lang.Object> context)
This expands the pre-parsed String given the context passed in. |
java.lang.String |
expandString(java.util.Map<java.lang.String,? extends java.lang.Object> context,
java.util.Locale locale)
This expands the pre-parsed String given the context passed in. |
java.lang.String |
expandString(java.util.Map<java.lang.String,? extends java.lang.Object> context,
java.util.TimeZone timeZone,
java.util.Locale locale)
This expands the pre-parsed String given the context passed in. |
static java.lang.String |
expandString(java.lang.String original,
java.util.Map<java.lang.String,? extends java.lang.Object> context)
Does on-the-fly parsing and expansion of the original String using variable values from the passed context. |
static java.lang.String |
expandString(java.lang.String original,
java.util.Map<java.lang.String,? extends java.lang.Object> context,
java.util.Locale locale)
Does on-the-fly parsing and expansion of the original String using variable values from the passed context. |
static java.lang.String |
expandString(java.lang.String original,
java.util.Map<java.lang.String,? extends java.lang.Object> context,
java.util.TimeZone timeZone,
java.util.Locale locale)
Does on-the-fly parsing and expansion of the original String using variable values from the passed context. |
static FlexibleStringExpander |
getInstance(java.lang.String original)
Returns a FlexibleStringExpander instance. |
java.lang.String |
getOriginal()
|
protected static java.util.List<FlexibleStringExpander.StrElem> |
getStrElems(java.lang.String original)
Protected helper method. |
boolean |
isEmpty()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String module
public static final java.lang.String openBracket
public static final java.lang.String closeBracket
protected static final UtilCache<java.lang.String,FlexibleStringExpander> exprCache
protected static final FlexibleStringExpander nullExpr
protected final java.lang.String orig
protected final java.util.List<FlexibleStringExpander.StrElem> strElems
protected int hint
Constructor Detail |
---|
protected FlexibleStringExpander(java.lang.String original)
original
- Method Detail |
---|
public boolean isEmpty()
public java.lang.String getOriginal()
public java.lang.String expandString(java.util.Map<java.lang.String,? extends java.lang.Object> context)
context
- A context Map containing the variable values
public java.lang.String expandString(java.util.Map<java.lang.String,? extends java.lang.Object> context, java.util.Locale locale)
context
- A context Map containing the variable valueslocale
- the current set locale
public java.lang.String expandString(java.util.Map<java.lang.String,? extends java.lang.Object> context, java.util.TimeZone timeZone, java.util.Locale locale)
context
- A context Map containing the variable valuestimeZone
- the current set time zonelocale
- the current set locale
public static FlexibleStringExpander getInstance(java.lang.String original)
original
- The original String expression
public static java.lang.String expandString(java.lang.String original, java.util.Map<java.lang.String,? extends java.lang.Object> context)
original
- The original String that will be expandedcontext
- A context Map containing the variable values
public static java.lang.String expandString(java.lang.String original, java.util.Map<java.lang.String,? extends java.lang.Object> context, java.util.Locale locale)
original
- The original String that will be expandedcontext
- A context Map containing the variable values
public static java.lang.String expandString(java.lang.String original, java.util.Map<java.lang.String,? extends java.lang.Object> context, java.util.TimeZone timeZone, java.util.Locale locale)
original
- The original String that will be expandedcontext
- A context Map containing the variable values
protected static java.util.List<FlexibleStringExpander.StrElem> getStrElems(java.lang.String original)
original
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |