|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ras.RASObject | +--com.ibm.ras.RASFormatter
RASFormatter
is the parent of all classes which format
RAS events for display. RAS formatters are used by those RAS handlers
which generate human-readable RAS events.
This class provides functions to format the date and time at which
a RAS event was created. If not specified, the default
SimpleDateFormat
pattern used to format the date is
"yyyy.MM.dd" and the pattern used for the time is "HH:mm:ss.SSS".
These defaults can be changed by the setDateFormat
and
setTimeFormat
methods.
Programming Note: classes which extend RASFormatter
should, in their constructors, call the addEventClass
method to register the RASIEvent
classes which the
formatter supports.
RASMessageFormatter
,
RASTraceFormatter
,
RASHandler
Constructor Summary | |
RASFormatter()
Creates a RASFormatter . |
Method Summary | |
void |
addEventClass(java.lang.String name)
Adds the name of a RASIEvent class which this formatter
can process. |
abstract java.lang.String |
format(RASIEvent event)
Formats the RAS event. |
java.lang.String |
getDate(long timeStamp)
Gets the date on which this event was created. |
java.text.SimpleDateFormat |
getDateFormat()
Gets the SimpleDateFormat object used to format the date
at which the event was created. |
java.util.Enumeration |
getEventClasses()
Gets the set of RASIEvent classes which this formatter
can process. |
java.lang.String |
getSeparator()
Gets the String used to separate fields in the formatted
output. |
java.lang.String |
getTime(long timeStamp)
Gets the time at which this event was created. |
java.text.SimpleDateFormat |
getTimeFormat()
Gets the SimpleDateFormat object used to format the time
at which the event was created. |
void |
removeEventClass(java.lang.String name)
Removes the name of a RASIEvent class from the list of
classes which this formatter can process. |
void |
setDateFormat(java.text.SimpleDateFormat format)
Sets the SimpleDateFormat object used to format the date
at which the event was created. |
void |
setSeparator(java.lang.String sep)
Sets the String used to separate fields in the formatted
output. |
void |
setTimeFormat(java.text.SimpleDateFormat format)
Sets the SimpleDateFormat object used to format the time
at which the event was created. |
Methods inherited from class com.ibm.ras.RASObject |
getConfig,
getDescription,
getName,
setConfig,
setDescription,
setName |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public RASFormatter()
RASFormatter
.Method Detail |
public java.lang.String getSeparator()
String
used to separate fields in the formatted
output.String
, whose default value is " ".public void setSeparator(java.lang.String sep)
String
used to separate fields in the formatted
output.sep
- The separator String
. If the separator is
null
, the current separator is not changed.public java.text.SimpleDateFormat getDateFormat()
SimpleDateFormat
object used to format the date
at which the event was created.public void setDateFormat(java.text.SimpleDateFormat format)
SimpleDateFormat
object used to format the date
at which the event was created.format
- The date format. If the format is null
,
the current format is not changed.public java.text.SimpleDateFormat getTimeFormat()
SimpleDateFormat
object used to format the time
at which the event was created.public void setTimeFormat(java.text.SimpleDateFormat format)
SimpleDateFormat
object used to format the time
at which the event was created.format
- The time format. If the format is null
,
the current format is not changed.public java.lang.String getDate(long timeStamp)
timeStamp
- The timestamp at which the event was created, as
formed by System.currentTimeMillis
.public java.lang.String getTime(long timeStamp)
timeStamp
- The timestamp at which the event was created, as
formed by System.currentTimeMillis
.public void addEventClass(java.lang.String name)
RASIEvent
class which this formatter
can process. If the event class is null
or is already
registered, this method does nothing.name
- The event class name.public void removeEventClass(java.lang.String name)
RASIEvent
class from the list of
classes which this formatter can process. If the event class is
null
or is not registered, this method does nothing.name
- The event class name.public java.util.Enumeration getEventClasses()
RASIEvent
classes which this formatter
can process.Enumeration
of RAS event class names. If
no event classes are registered, the Enumeration
is empty.public abstract java.lang.String format(RASIEvent event)
event
- The event to format.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |