Package org.opencms.jsp.util
Class CmsMacroFormatterResolver
java.lang.Object
org.opencms.jsp.util.CmsMacroFormatterResolver
Resolver for macro formatters.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The parent macro key.static final String
The element macro key.static final String
The parent macro key.static final String
The settings macro key.static final String
Node name.static final String
Node name.static final String
Node name.static final String
Node name. -
Constructor Summary
ConstructorDescriptionCmsMacroFormatterResolver
(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected I_CmsFormatterBean
getFormatterForMacro
(String macro) Returns the formatter bean for the given macro string, ornull
if none available.protected Object
getMacroBeanValue
(Object bean, String property) Returns the property value read from the given JavaBean.protected String
Returns the macro input string.protected void
printMacroValue
(String macro) Prints the macro value to the output stream.void
resolve()
Resolves the macro.
-
Field Details
-
KEY_CMS
The parent macro key.- See Also:
-
KEY_ELEMENT
The element macro key.- See Also:
-
KEY_PARENT
The parent macro key.- See Also:
-
KEY_SETTINGS
The settings macro key.- See Also:
-
N_FORMATTER
Node name.- See Also:
-
N_FORMATTERS
Node name.- See Also:
-
N_MACRO
Node name.- See Also:
-
N_MACRO_NAME
Node name.- See Also:
-
-
Constructor Details
-
CmsMacroFormatterResolver
public CmsMacroFormatterResolver(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Constructor.- Parameters:
context
- the page contextreq
- the requestres
- the response
-
-
Method Details
-
resolve
Resolves the macro.- Throws:
IOException
- in case writing to the page context output stream failsCmsException
- in case reading the macro settings fails
-
getFormatterForMacro
Returns the formatter bean for the given macro string, ornull
if none available.- Parameters:
macro
- the macro- Returns:
- the formatter bean
-
getMacroBeanValue
Returns the property value read from the given JavaBean.- Parameters:
bean
- the JavaBean to read the property fromproperty
- the property to read- Returns:
- the property value read from the given JavaBean
-
getMacroInput
Returns the macro input string.- Returns:
- the macro input string
-
printMacroValue
Prints the macro value to the output stream.- Parameters:
macro
- the macro string- Throws:
IOException
- in case writing to the page context output stream fails
-