com.gargoylesoftware.base.trace
Class TraceItem

java.lang.Object
  extended bycom.gargoylesoftware.base.trace.TraceItem
All Implemented Interfaces:
Cloneable

public class TraceItem
extends Object
implements Cloneable

An item of data to be written.

Version:
$Revision: 1.4 $
Author:
Mike Bowler

Constructor Summary
TraceItem()
          Create a new item.
 
Method Summary
protected  void assertNotNull(String fieldName, Object fieldValue)
          Verify that the specified value is not null.
(package private)  void clear()
          Reset all the values to null
 Object clone()
          Return a copy of this object.
 boolean containsText()
          Return true if this item contains any text.
 TraceChannel getChannel()
          Return the channel.
 Object getLock()
          Return the lock.
 String getMessage()
          Return the message.
 TraceItem getNextItem()
          Return the next item.
 TraceItem getPrevItem()
          Return the previous item.
(package private)  Thread getThread()
           
 String getThreadName()
          Return the name of the thread that called Trace.
 Throwable getThrowable()
          Return the throwable.
 Date getTime()
          Return the time that the item was written to Trace
(package private)  boolean isClear()
           
(package private)  void setChannel(TraceChannel channel)
           
(package private)  void setLock(Object lock)
           
(package private)  void setMessage(String string)
           
(package private)  void setNextItem(TraceItem item)
           
(package private)  void setPrevItem(TraceItem item)
           
(package private)  void setThread(Thread thread)
           
(package private)  void setThrowable(Throwable t)
           
(package private)  void setTime(Date time)
           
 String toString()
          Return a string representation of this object for testing purposes.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TraceItem

public TraceItem()
Create a new item.

Method Detail

clear

void clear()
Reset all the values to null


isClear

boolean isClear()
Returns:
true if the message has no content

toString

public String toString()
Return a string representation of this object for testing purposes.

Returns:
The string representation

containsText

public boolean containsText()
Return true if this item contains any text.

Returns:
true if this item contains any text.

getMessage

public String getMessage()
Return the message.

Returns:
the message.

setMessage

void setMessage(String string)
Parameters:
string - The message

getThrowable

public Throwable getThrowable()
Return the throwable.

Returns:
the throwable.

setThrowable

void setThrowable(Throwable t)
Parameters:
t - The throwable

getTime

public Date getTime()
Return the time that the item was written to Trace

Returns:
the time.

setTime

void setTime(Date time)
Parameters:
time - The time

getThread

Thread getThread()
Returns:
The thread

setThread

void setThread(Thread thread)
Parameters:
thread - The thread

getThreadName

public String getThreadName()
Return the name of the thread that called Trace.

Returns:
the name of the thread.

getLock

public Object getLock()
Return the lock.

Returns:
the lock.

setLock

void setLock(Object lock)
Parameters:
lock - The lock

getPrevItem

public TraceItem getPrevItem()
Return the previous item.

Returns:
the previous item.

setPrevItem

void setPrevItem(TraceItem item)
Parameters:
item - The previous item

getNextItem

public TraceItem getNextItem()
Return the next item.

Returns:
the next item.

setNextItem

void setNextItem(TraceItem item)
Parameters:
item - The next item

getChannel

public TraceChannel getChannel()
Return the channel.

Returns:
the channel.

setChannel

void setChannel(TraceChannel channel)
Parameters:
channel - The channel

clone

public Object clone()
             throws CloneNotSupportedException
Return a copy of this object.

Returns:
A copy.
Throws:
CloneNotSupportedException - If this object is not cloneable.

assertNotNull

protected final void assertNotNull(String fieldName,
                                   Object fieldValue)
                            throws DetailedNullPointerException
Verify that the specified value is not null. If it is then throw an exception

Parameters:
fieldName - The name of the field to check
fieldValue - The value of the field to check
Throws:
DetailedNullPointerException - If fieldValue is null


Copyright © 1998-2004 Gargoyle Software Inc.. All Rights Reserved.