Package org.opencms.jsp.util
Class CmsMacroFormatterResolver
- java.lang.Object
-
- org.opencms.jsp.util.CmsMacroFormatterResolver
-
public class CmsMacroFormatterResolver extends java.lang.Object
Resolver for macro formatters.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
KEY_CMS
The parent macro key.static java.lang.String
KEY_ELEMENT
The element macro key.static java.lang.String
KEY_PARENT
The parent macro key.static java.lang.String
KEY_SETTINGS
The settings macro key.static java.lang.String
N_FORMATTER
Node name.static java.lang.String
N_FORMATTERS
Node name.static java.lang.String
N_MACRO
Node name.static java.lang.String
N_MACRO_NAME
Node name.
-
Constructor Summary
Constructors Constructor Description CmsMacroFormatterResolver(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected I_CmsFormatterBean
getFormatterForMacro(java.lang.String macro)
Returns the formatter bean for the given macro string, ornull
if none available.protected java.lang.Object
getMacroBeanValue(java.lang.Object bean, java.lang.String property)
Returns the property value read from the given JavaBean.protected java.lang.String
getMacroInput()
Returns the macro input string.protected void
printMacroValue(java.lang.String macro)
Prints the macro value to the output stream.void
resolve()
Resolves the macro.
-
-
-
Field Detail
-
KEY_CMS
public static final java.lang.String KEY_CMS
The parent macro key.- See Also:
- Constant Field Values
-
KEY_ELEMENT
public static final java.lang.String KEY_ELEMENT
The element macro key.- See Also:
- Constant Field Values
-
KEY_PARENT
public static final java.lang.String KEY_PARENT
The parent macro key.- See Also:
- Constant Field Values
-
KEY_SETTINGS
public static final java.lang.String KEY_SETTINGS
The settings macro key.- See Also:
- Constant Field Values
-
N_FORMATTER
public static final java.lang.String N_FORMATTER
Node name.- See Also:
- Constant Field Values
-
N_FORMATTERS
public static final java.lang.String N_FORMATTERS
Node name.- See Also:
- Constant Field Values
-
N_MACRO
public static final java.lang.String N_MACRO
Node name.- See Also:
- Constant Field Values
-
N_MACRO_NAME
public static final java.lang.String N_MACRO_NAME
Node name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
resolve
public void resolve() throws java.io.IOException, CmsException
Resolves the macro.- Throws:
java.io.IOException
- in case writing to the page context output stream failsCmsException
- in case reading the macro settings fails
-
getFormatterForMacro
protected I_CmsFormatterBean getFormatterForMacro(java.lang.String macro)
Returns the formatter bean for the given macro string, ornull
if none available.- Parameters:
macro
- the macro- Returns:
- the formatter bean
-
getMacroBeanValue
protected java.lang.Object getMacroBeanValue(java.lang.Object bean, java.lang.String property)
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
protected java.lang.String getMacroInput()
Returns the macro input string.- Returns:
- the macro input string
-
printMacroValue
protected void printMacroValue(java.lang.String macro) throws java.io.IOException
Prints the macro value to the output stream.- Parameters:
macro
- the macro string- Throws:
java.io.IOException
- in case writing to the page context output stream fails
-
-