|
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<? super LogEntry> |
filter
may be null (in which case all LogEntry objects are written) |
| Fields inherited from interface com.antelmann.util.Filter |
|---|
EXCLUDE_ALL_FILTER, INCLUDE_ALL_FILTER |
| Constructor Summary | |
|---|---|
protected |
AbstractLogWriter(LogEntryFormatter<T> formatter)
|
protected |
AbstractLogWriter(LogEntryFormatter<T> formatter,
Filter<? super LogEntry> filter)
|
| Method Summary | |
|---|---|
boolean |
accept(LogEntry entry)
returns true if either the filter is null or the filter accepts the given entry |
Filter<? super LogEntry> |
getLogFilter()
|
LogEntryFormatter<T> |
getLogFormatter()
|
void |
setLogFilter(Filter<? super LogEntry> filter)
|
void |
setLogFormatter(LogEntryFormatter<T> formatter)
formatter must not be null |
void |
write(LogEntry entry)
normally not to be overridden; directly calls writeLogPattern w/o double-checking the filter |
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<? super LogEntry> filter
| Constructor Detail |
|---|
protected AbstractLogWriter(LogEntryFormatter<T> formatter)
protected AbstractLogWriter(LogEntryFormatter<T> formatter,
Filter<? super LogEntry> filter)
| Method Detail |
|---|
public Filter<? super LogEntry> getLogFilter()
public void setLogFilter(Filter<? super LogEntry> filter)
public boolean accept(LogEntry entry)
accept in interface Filter<LogEntry>
public void write(LogEntry entry)
throws LogException
writeLogPattern w/o double-checking the filter
write in interface LogWriterLogException - if an error occurred while writing the log
protected abstract void writeLogPattern(T pattern)
throws LogException
LogExceptionpublic LogEntryFormatter<T> getLogFormatter()
public void setLogFormatter(LogEntryFormatter<T> formatter)
throws NullPointerException
NullPointerException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||