public abstract class PatternConverter
extends java.lang.Object
PatternConverter 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.
限定符 | 构造器和说明 |
---|---|
protected |
PatternConverter(java.lang.String name,
java.lang.String style)
Create a new pattern converter.
|
限定符和类型 | 方法和说明 |
---|---|
abstract void |
format(java.lang.Object obj,
java.lang.StringBuffer toAppendTo)
Formats an object into a string buffer.
|
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.
|
protected PatternConverter(java.lang.String name, java.lang.String style)
name
- name for pattern converter.style
- CSS style for formatted output.public abstract void format(java.lang.Object obj, java.lang.StringBuffer toAppendTo)
obj
- event to format, may not be null.toAppendTo
- string buffer to which the formatted event will be appended. May not be null.public final java.lang.String getName()
public java.lang.String getStyleClass(java.lang.Object e)
e
- null values are accepted