|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object logahawk.formatters.DateArgFormatter
@Immutable public class DateArgFormatter
This formatter can handle Date
objects.
Field Summary | |
---|---|
protected DateFormat |
dateFormat
|
static DateFormat |
STD_DATE_FORMAT
The default date format. |
Constructor Summary | |
---|---|
DateArgFormatter()
|
|
DateArgFormatter(DateFormat dateFormat)
|
Method Summary | |
---|---|
boolean |
canFormat(Object obj)
This class can handle any normal type of collection. |
String |
format(Object obj,
Collection<ArgumentFormatter> formatters,
int indentLevel)
This converts the object into a String that represent the object. |
DateFormat |
getDateFormat()
The "DateArgFormatter" is what we use to format the epoch of a log message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DateFormat STD_DATE_FORMAT
protected final DateFormat dateFormat
Constructor Detail |
---|
public DateArgFormatter()
public DateArgFormatter(DateFormat dateFormat)
dateFormat
- A clone of this DateFormat
will be created (because DateFormat
s are not inherently
thread safe.Method Detail |
---|
public boolean canFormat(Object obj)
canFormat
in interface ArgumentFormatter
public String format(Object obj, Collection<ArgumentFormatter> formatters, int indentLevel)
ArgumentFormatter
String
that represent the object. The String
may contain line
breaks, but should not include a trailing line break. The first line of the result should NOT include any
indentation, that should be handled by the calling class.
If the object is complex and contains other objects, this ArgumentFormatter
may use the provided list of
ArgumentFormatter
objects to find a more appropriate formatter.
To make things look nice, the "indentLevel" is provided. The indent level should always be incremented by one when
calling downward into other ArgumentFormatter
s.
format
in interface ArgumentFormatter
public DateFormat getDateFormat()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |