|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object momelog.Formatter
public abstract class Formatter
Abstract class that every class intended to format logging events should
extend. Contains three methods to convert LogEvent
instance to
String
or other object.
format(LogEvent, StringBuffer)
abstract method is intended to
convert given logging event to string and append it to the specified
StringBuffer
instance. format(LogEvent)
method converts given logging event to
String
and returns it. Implementation of this method makes use of
format(LogEvent, StringBuffer)
method. formatAsObject(LogEvent)
is general method intended to convert
logging event to an Object
. Implementation of this method returns
formatted string as format(LogEvent)
method does.
Formatter class extending Formatter
can override just the abstract
format(LogEvent, StringBuffer)
method or all methods of this class.
Constructor Summary | |
---|---|
Formatter()
|
Method Summary | |
---|---|
String |
format(LogEvent event)
Converts given logging event to String . |
abstract void |
format(LogEvent event,
StringBuffer buffer)
Abstract method intended to convert specified logging event to string and append it to the given StringBuffer . |
Object |
formatAsObject(LogEvent event)
General method intended to convert given logging event to Object . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Formatter()
Method Detail |
---|
public abstract void format(LogEvent event, StringBuffer buffer)
StringBuffer
. Formatter
implementation should override this method and provide needed conversion
mechanism.
event
- LogEvent
instance to convert.buffer
- StringBuffer
where to append formatted string.public String format(LogEvent event)
String
. Implementation of this
method makes use of format(LogEvent, StringBuffer)
method.
Formatter
implementation can override this method to change it's
functionality.
event
- LogEvent
instance to convert.
public Object formatAsObject(LogEvent event)
Object
.
Implementation of this method returns formatted string as
format(LogEvent)
method does. Formatter
implementation can
override this method to change it's functionality.
event
- LogEvent
instance to convert.
Object
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |