org.jalore.impl
Class LogMessageImpl

java.lang.Object
  extended by org.jalore.impl.LogMessageImpl
All Implemented Interfaces:
LogMessage

public class LogMessageImpl
extends java.lang.Object
implements LogMessage

Basic implementation of LogMessage.

Author:
Nicolas Dutertry

Constructor Summary
LogMessageImpl(java.lang.String message)
          Constructs a LogMessageImpl from a message.
 
Method Summary
 void addLine(java.lang.String line)
          Add a line to this message.
 java.lang.String getCompleteMessage()
          Returns the complete message.
 java.lang.String getExtraLines()
          Returns the extra lines or null if this message doesn't contain any extra line.
 java.lang.String getFirstLine()
          Returns the first line of the message.
 java.util.Map<java.lang.String,java.lang.String> getProperties()
          Returns the properties associated with this message.
 java.lang.String getProperty(java.lang.String name)
          Returns a property value.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets a property.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogMessageImpl

public LogMessageImpl(java.lang.String message)
Constructs a LogMessageImpl from a message. The message must be a single line. The following lines must be added using the method addLine(String).

Parameters:
message -
Method Detail

addLine

public void addLine(java.lang.String line)
Add a line to this message.

Parameters:
line - the line to add

getFirstLine

public java.lang.String getFirstLine()
Description copied from interface: LogMessage
Returns the first line of the message.

Specified by:
getFirstLine in interface LogMessage

getExtraLines

public java.lang.String getExtraLines()
Description copied from interface: LogMessage
Returns the extra lines or null if this message doesn't contain any extra line.

Specified by:
getExtraLines in interface LogMessage

getCompleteMessage

public java.lang.String getCompleteMessage()
Description copied from interface: LogMessage
Returns the complete message.

Specified by:
getCompleteMessage in interface LogMessage

getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()
Description copied from interface: LogMessage
Returns the properties associated with this message. Properties contains elements identifying the message like timestamp, thread name, MDC, etc.

Specified by:
getProperties in interface LogMessage

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: LogMessage
Returns a property value.

Specified by:
getProperty in interface LogMessage
Parameters:
name - property name

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Description copied from interface: LogMessage
Sets a property.

Specified by:
setProperty in interface LogMessage
Parameters:
name - property name
value - property value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009 Nicolas Dutertry. All Rights Reserved.