|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.logging.AbstractLogWriter<T>
public abstract class AbstractLogWriter<T>
provides filtering capabilities for a LogWriter.
Extending classes only need to implement writeLogPattern(Object).
| Field Summary | |
|---|---|
protected Filter<LogEntry> |
filter
may be null (in which case all LogEntry objects are written) |
| Constructor Summary | |
|---|---|
protected |
AbstractLogWriter(LogEntryFormatter<T> formatter)
|
protected |
AbstractLogWriter(LogEntryFormatter<T> formatter,
Filter<LogEntry> filter)
|
| Method Summary | |
|---|---|
boolean |
accept(LogEntry entry)
returns true if either the filter is null or the filter accepts the given entry |
Filter<LogEntry> |
getLogFilter()
|
LogEntryFormatter<T> |
getLogFormatter()
|
void |
setLogFilter(Filter<LogEntry> filter)
|
protected void |
setLogFormatter(LogEntryFormatter<T> formatter)
formatter must not be null |
void |
write(LogEntry entry)
normally not to be overridden; checks the filter and calls writeLogPattern |
protected abstract void |
writeLogPattern(T pattern)
writes the pattern to the log entity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Filter<LogEntry> filter
| Constructor Detail |
|---|
protected AbstractLogWriter(LogEntryFormatter<T> formatter)
protected AbstractLogWriter(LogEntryFormatter<T> formatter,
Filter<LogEntry> filter)
| Method Detail |
|---|
public Filter<LogEntry> getLogFilter()
public void setLogFilter(Filter<LogEntry> filter)
public boolean accept(LogEntry entry)
accept in interface Filter<LogEntry>
public void write(LogEntry entry)
throws LogException
writeLogPattern
write in interface LogWriterLogException - if an error occurred while writing the log
protected abstract void writeLogPattern(T pattern)
throws LogException
LogExceptionpublic LogEntryFormatter<T> getLogFormatter()
protected void setLogFormatter(LogEntryFormatter<T> formatter)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||