|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Describes a macro mapper, which is used to efficiently resolve macros
in the form of ${key}
in an input String.
The macro replacement is pre-implemented in
.CmsMacroResolver.resolveMacros(String, I_CmsMacroResolver)
Field Summary | |
static char |
MACRO_DELIMITER
Delimiter char '$' for a macro - old style. |
static char |
MACRO_DELIMITER_NEW
Delimiter char '%' for a macro - new style. |
static char |
MACRO_END
End char '}' for a macro - old style. |
static char |
MACRO_END_NEW
End char ')' for a macro - new style. |
static char |
MACRO_START
Start char '{' for a macro - old style. |
static char |
MACRO_START_NEW
Start char '(' for a macro - new style. |
Method Summary | |
java.lang.String |
getMacroValue(java.lang.String macro)
Resolves a single macro to the macro value, returns null if the macro could not be resolved. |
boolean |
isKeepEmptyMacros()
Returns true if macros that could not be resolved are kept "as is" in the
input String, false if they are replaced by an empty String. |
java.lang.String |
resolveMacros(java.lang.String input)
Resolves all macros in the input, replacing them with the macro values. |
Field Detail |
public static final char MACRO_DELIMITER
'$'
for a macro - old style.
public static final char MACRO_DELIMITER_NEW
'%'
for a macro - new style.
public static final char MACRO_END
'}'
for a macro - old style.
public static final char MACRO_END_NEW
')'
for a macro - new style.
public static final char MACRO_START
'{'
for a macro - old style.
public static final char MACRO_START_NEW
'('
for a macro - new style.
Method Detail |
public java.lang.String getMacroValue(java.lang.String macro)
null
if the macro could not be resolved.
macro
- the macro to resolve
null
if the macro could not be resolvedpublic boolean isKeepEmptyMacros()
true
if macros that could not be resolved are kept "as is" in the
input String, false
if they are replaced by an empty String.
true
if macros that could not be resolved are kept "as is" in the
input String, false
if they are replaced by an empty Stringpublic java.lang.String resolveMacros(java.lang.String input)
The flag isKeepEmptyMacros()
controls how to deal with
macros found in the input that can not be resolved.
input
- the input to resolve the macros in
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |