Class AbstractPatternConverter

  • All Implemented Interfaces:
    PatternConverter
    Direct Known Subclasses:
    IntegerPatternConverter, LogEventPatternConverter

    public abstract class AbstractPatternConverter
    extends java.lang.Object
    implements PatternConverter
    AbstractPatternConverter is an abstract class that provides the formatting functionality that derived classes need.

    Conversion specifiers in a conversion patterns are parsed to individual PatternConverters. Each of which is responsible for converting an object in a converter specific manner.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static Logger LOGGER
      Allow subclasses access to the status logger.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractPatternConverter​(java.lang.String name, java.lang.String style)
      Create a new pattern converter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName()
      This method returns the name of the conversion pattern.
      java.lang.String getStyleClass​(java.lang.Object e)
      This method returns the CSS style class that should be applied to the LoggingEvent passed as parameter, which can be null.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGGER

        protected static final Logger LOGGER
        Allow subclasses access to the status logger.
    • Constructor Detail

      • AbstractPatternConverter

        protected AbstractPatternConverter​(java.lang.String name,
                                           java.lang.String style)
        Create a new pattern converter.
        Parameters:
        name - name for pattern converter.
        style - CSS style for formatted output.
    • Method Detail

      • getName

        public final java.lang.String getName()
        This method returns the name of the conversion pattern.

        The name can be useful to certain Layouts such as HtmlLayout.

        Specified by:
        getName in interface PatternConverter
        Returns:
        the name of the conversion pattern
      • getStyleClass

        public java.lang.String getStyleClass​(java.lang.Object e)
        This method returns the CSS style class that should be applied to the LoggingEvent passed as parameter, which can be null.

        This information is currently used only by HtmlLayout.

        Specified by:
        getStyleClass in interface PatternConverter
        Parameters:
        e - null values are accepted
        Returns:
        the name of the conversion pattern