Class CmsMacroFormatterResolver

    • 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, or null 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 context
        req - the request
        res - 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 fails
        CmsException - 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, or null 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 from
        property - 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