public abstract class PatternConverter extends 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.
Modifier | Constructor and Description |
---|---|
protected |
PatternConverter(String name,
String style)
Create a new pattern converter.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
format(Object obj,
StringBuffer toAppendTo)
Formats an object into a string buffer.
|
String |
getName()
This method returns the name of the conversion pattern.
|
String |
getStyleClass(Object e)
This method returns the CSS style class that should be applied to the LoggingEvent passed as parameter, which can
be null.
|
public abstract void format(Object obj, 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 String getName()
The name can be useful to certain Layouts such as HTMLLayout.
public String getStyleClass(Object e)
This information is currently used only by HTMLLayout.
e
- null values are acceptedCopyright © 1999–2023 QOS.CH Sarl (Switzerland). All rights reserved.