Package org.opencms.jsp.util
Class CmsMacroFormatterResolver
java.lang.Object
org.opencms.jsp.util.CmsMacroFormatterResolver
Resolver for macro formatters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe parent macro key.static final StringThe element macro key.static final StringThe parent macro key.static final StringThe settings macro key.static final StringNode name.static final StringNode name.static final StringNode name.static final StringNode name. -
Constructor Summary
ConstructorsConstructorDescriptionCmsMacroFormatterResolver(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected I_CmsFormatterBeangetFormatterForMacro(String macro) Returns the formatter bean for the given macro string, ornullif none available.protected ObjectgetMacroBeanValue(Object bean, String property) Returns the property value read from the given JavaBean.protected StringReturns the macro input string.protected voidprintMacroValue(String macro) Prints the macro value to the output stream.voidresolve()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, ornullif 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
-