| |
|
| java.lang.Object org.ofbiz.base.util.FlexibleStringExpander
FlexibleStringExpander | public class FlexibleStringExpander (Code) | | Expands string values with in a Map context supporting the ${} syntax for
variable placeholders and the "." (dot) and "[]" (square-brace) syntax
elements for accessing Map entries and List elements in the context.
author: David E. Jones version: $Revision: 1.2 $ since: 2.2 |
Inner Class :public static interface StringElement | |
Inner Class :public static class ConstantElement implements StringElement | |
Inner Class :public static class VariableElement implements StringElement | |
Inner Class :public static interface ParseElementHandler | |
Inner Class :public static class PreParseHandler implements ParseElementHandler | |
Inner Class :public static class OnTheFlyHandler implements ParseElementHandler | |
FlexibleStringExpander | public FlexibleStringExpander(String original)(Code) | | |
expandString | public String expandString(Map context)(Code) | | This expands the pre-parsed String given the context passed in. Note that
pre-parsing can only parse the top-level place-holders and if there are
nested expansions they will be done on the fly instead of pre-parsed because
they are dependent on the context which isn't known until expansion time.
Parameters: context - A context Map containing the variable values The original String expanded by replacing varaible place holders. |
expandString | public String expandString(Map context, Locale locale)(Code) | | This expands the pre-parsed String given the context passed in. Note that
pre-parsing can only parse the top-level place-holders and if there are
nested expansions they will be done on the fly instead of pre-parsed because
they are dependent on the context which isn't known until expansion time.
Parameters: context - A context Map containing the variable values The original String expanded by replacing varaible place holders. |
expandString | public static String expandString(String original, Map context)(Code) | | Does on-the-fly parsing and expansion of the original String using
varaible values from the passed context. Variables are denoted with
the "${}" syntax and the variable name inside the curly-braces can use
the "." (dot) syntax to access sub-Map entries and the "[]" square-brace
syntax to access List elements.
Parameters: original - The original String that will be expanded Parameters: context - A context Map containing the variable values The original String expanded by replacing varaible place holders. |
expandString | public static String expandString(String original, Map context, Locale locale)(Code) | | Does on-the-fly parsing and expansion of the original String using
varaible values from the passed context. Variables are denoted with
the "${}" syntax and the variable name inside the curly-braces can use
the "." (dot) syntax to access sub-Map entries and the "[]" square-brace
syntax to access List elements.
Parameters: original - The original String that will be expanded Parameters: context - A context Map containing the variable values The original String expanded by replacing varaible place holders. |
isEmpty | public boolean isEmpty()(Code) | | |
parseString | public static void parseString(String original, ParseElementHandler handler)(Code) | | |
|
|
|