public class CmsJspLinkMacroResolver extends java.lang.Object implements I_CmsMacroResolver
The only supported macro is the 'link' macro.
限定符和类型 | 字段和说明 |
---|---|
static char |
KEY_SEPARATOR
Identifier for the link macro separator.
|
static java.lang.String |
MACRO_LINK
Identifier for the link macro name.
|
static java.lang.String |
MACRO_LINK_STRONG
Identifier for the link macro name.
|
static java.lang.String |
MACRO_LINK_WEAK
Identifier for the link macro name.
|
static java.lang.String[] |
VALUE_NAME_ARRAY
Identifier for link commands.
|
static java.util.List<java.lang.String> |
VALUE_NAMES
The link commands wrapped in a List.
|
MACRO_DELIMITER, MACRO_DELIMITER_OLD, MACRO_END, MACRO_END_OLD, MACRO_START, MACRO_START_OLD
构造器和说明 |
---|
CmsJspLinkMacroResolver(CmsObject cms,
java.lang.String jspRootPath,
boolean forRfs)
Default constructor.
|
限定符和类型 | 方法和说明 |
---|---|
java.util.List<CmsLink> |
getLinks()
Returns the links.
|
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 the JSP link management macros in the given input.
|
public static final char KEY_SEPARATOR
public static final java.lang.String MACRO_LINK
public static final java.lang.String MACRO_LINK_STRONG
public static final java.lang.String MACRO_LINK_WEAK
public static final java.lang.String[] VALUE_NAME_ARRAY
public static final java.util.List<java.lang.String> VALUE_NAMES
public CmsJspLinkMacroResolver(CmsObject cms, java.lang.String jspRootPath, boolean forRfs)
cms
- the cms contextjspRootPath
- the (optional) jsp root path, needed for saving from the editor to resolve relative linksforRfs
- Only if true
the macros get really resolved to valid vfs pathspublic java.util.List<CmsLink> getLinks()
public java.lang.String getMacroValue(java.lang.String macro)
I_CmsMacroResolver
null
if the macro could not be resolved.getMacroValue
在接口中 I_CmsMacroResolver
macro
- the macro to resolvenull
if the macro could not be resolvedI_CmsMacroResolver.getMacroValue(java.lang.String)
public boolean isKeepEmptyMacros()
I_CmsMacroResolver
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.isKeepEmptyMacros
在接口中 I_CmsMacroResolver
true
if macros that could not be resolved are kept "as is" in the
input String, false
if they are replaced by an empty StringI_CmsMacroResolver.isKeepEmptyMacros()
public java.lang.String resolveMacros(java.lang.String input)
Calls
once for each macro in the input.
This means "nested" macros are not supported in this implementation, which is fine since
it can't happen in JSP link management anyway.resolveMacros(String)
resolveMacros
在接口中 I_CmsMacroResolver
input
- the input to resolve the macros inI_CmsMacroResolver.resolveMacros(java.lang.String)