Package org.opennms.netmgt.syslogd
Class SyslogTimeStamp
- java.lang.Object
-
- java.text.Format
-
- org.opennms.netmgt.syslogd.SyslogTimeStamp
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class SyslogTimeStamp extends java.text.Format
The TimestampFormat class implements the code necessary to format and parse syslog timestamps, which come in the flavor of 'Sep 14 15:43:06'.- Author:
- Timothy Gerard Endres, time@ice.com.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_GMT_TZID
ConstantDEFAULT_GMT_TZID="GMT+00"
-
Constructor Summary
Constructors Constructor Description SyslogTimeStamp()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuffer
format(java.lang.Object date, java.lang.StringBuffer appendTo, java.text.FieldPosition fieldPos)
java.lang.String
format(java.util.Date date)
formatjava.lang.String
formatTimeZone(java.util.Date date, java.util.TimeZone tz)
formatTimeZonestatic SyslogTimeStamp
getInstance()
getInstancejava.util.Date
parse(java.lang.String source)
parsejava.lang.Object
parseObject(java.lang.String source, java.text.ParsePosition pos)
java.util.Date
parseTimestamp(java.lang.String source)
parseTimestamp
-
-
-
Field Detail
-
DEFAULT_GMT_TZID
public static final java.lang.String DEFAULT_GMT_TZID
ConstantDEFAULT_GMT_TZID="GMT+00"
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static final SyslogTimeStamp getInstance()
getInstance
- Returns:
- a
SyslogTimeStamp
object.
-
format
public java.lang.String format(java.util.Date date) throws java.lang.IllegalArgumentException
format
- Parameters:
date
- aDate
object.- Returns:
- a
String
object. - Throws:
java.lang.IllegalArgumentException
- if any.
-
formatTimeZone
public java.lang.String formatTimeZone(java.util.Date date, java.util.TimeZone tz) throws java.lang.IllegalArgumentException
formatTimeZone
- Parameters:
date
- aDate
object.tz
- aTimeZone
object.- Returns:
- a
String
object. - Throws:
java.lang.IllegalArgumentException
- if any.
-
format
public java.lang.StringBuffer format(java.lang.Object date, java.lang.StringBuffer appendTo, java.text.FieldPosition fieldPos) throws java.lang.IllegalArgumentException
- Specified by:
format
in classjava.text.Format
- Throws:
java.lang.IllegalArgumentException
-
parse
public java.util.Date parse(java.lang.String source) throws java.text.ParseException
parse
- Parameters:
source
- aString
object.- Returns:
- a
Date
object. - Throws:
java.text.ParseException
- if any.
-
parseObject
public java.lang.Object parseObject(java.lang.String source, java.text.ParsePosition pos)
- Specified by:
parseObject
in classjava.text.Format
-
parseTimestamp
public java.util.Date parseTimestamp(java.lang.String source) throws java.text.ParseException
parseTimestamp
- Parameters:
source
- aString
object.- Returns:
- a
Date
object. - Throws:
java.text.ParseException
- if any.
-
-