IDebug
© 1997-2001 Joseph Kiniry
© 2000-2001 KindSoftware
© 1997-1999 Caltech
All Rights Reserved

idebug
Class DebugOutputBase

java.lang.Object
  |
  +--idebug.DebugOutputBase
All Implemented Interfaces:
DebugOutput
Direct Known Subclasses:
ConsoleOutput, ServletLogOutput, WindowOutput, WriterOutput

public abstract class DebugOutputBase
extends java.lang.Object
implements DebugOutput

The abstract class from which all classes providing output methods used to send debugging messages to various types of devices must inherit. All final output methods use the printMsg as their final "output destinations", thus only they need to be overridden.

Version:
$Revision: 2146 $ $Date: 2005-02-13 16:54:27 +0000 (Sun, 13 Feb 2005) $
Author:
Joseph R. Kiniry
See Also:
ConsoleOutput, ServletLogOutput, WindowOutput, WriterOutput

Field Summary
protected  Debug debug
           The Debug object associated with this output object.
 
Constructor Summary
DebugOutputBase()
           
 
Method Summary
abstract  java.io.Writer getWriter()
           Returns a Writer for this output interface if one is available.
 boolean isValidCategory(java.lang.String category)
           Tests to see if the current debug context is interested in a given category.
 boolean isValidLevel(int level)
           Tests to see if the current debug context is interested in a given level.
 boolean print(int level, java.lang.Object object)
           Print out an object if the debugging context warrents.
 boolean print(int level, java.lang.String message)
           Print out a debugging message if the debugging context warrents.
 boolean print(java.lang.String category, java.lang.Object object)
           Print out an object if the debugging context warrents.
 boolean print(java.lang.String category, java.lang.String message)
           Print out a debugging message if the debugging context warrents.
 boolean println(int level, java.lang.Object object)
           Print out an object if the debugging context warrents.
 boolean println(int level, java.lang.String message)
           Print out a debugging message if the debugging context warrents.
 boolean println(java.lang.String category, java.lang.Object object)
           Print out an object if the debugging context warrents.
 boolean println(java.lang.String category, java.lang.String message)
           Print out a debugging message if the debugging context warrents.
abstract  void printMsg(int level, java.lang.String message)
           Print out the debugging message, no questions asked.
abstract  void printMsg(java.lang.String message)
           Print out the debugging message, no questions asked.
abstract  void printMsg(java.lang.String category, java.lang.String message)
           Print out the debugging message, no questions asked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected Debug debug

The Debug object associated with this output object.

Constructor Detail

DebugOutputBase

public DebugOutputBase()
Method Detail

printMsg

public abstract void printMsg(java.lang.String category,
                              java.lang.String message)

Print out the debugging message, no questions asked.

Specified by:
printMsg in interface DebugOutput
Parameters:
category - is the category of this message.
message - is the debugging message to print.

printMsg

public abstract void printMsg(int level,
                              java.lang.String message)

Print out the debugging message, no questions asked.

Specified by:
printMsg in interface DebugOutput
Parameters:
level - The debugging level of this message.
message - The debugging message to print.

printMsg

public abstract void printMsg(java.lang.String message)

Print out the debugging message, no questions asked.

Specified by:
printMsg in interface DebugOutput
Parameters:
message - The debugging message to print.

print

public final boolean print(int level,
                           java.lang.String message)

Print out a debugging message if the debugging context warrents.

Specified by:
print in interface DebugOutput
Parameters:
level - The debugging level of this message.
message - The debugging message to print.

print

public final boolean print(int level,
                           java.lang.Object object)

Print out an object if the debugging context warrents.

Specified by:
print in interface DebugOutput
Parameters:
level - The debugging level of this message.
object - The object to print.

print

public final boolean print(java.lang.String category,
                           java.lang.String message)

Print out a debugging message if the debugging context warrents.

Specified by:
print in interface DebugOutput
Parameters:
category - The category of this message.
message - The debugging message to print.

print

public final boolean print(java.lang.String category,
                           java.lang.Object object)

Print out an object if the debugging context warrents.

Specified by:
print in interface DebugOutput
Parameters:
category - The category of this message.
object - The object to print.

println

public final boolean println(java.lang.String category,
                             java.lang.Object object)

Print out an object if the debugging context warrents.

Specified by:
println in interface DebugOutput
Parameters:
category - The category of this message.
object - The object to print.

println

public final boolean println(java.lang.String category,
                             java.lang.String message)

Print out a debugging message if the debugging context warrents.

Specified by:
println in interface DebugOutput
Parameters:
category - The category of this message.
message - The debugging message to print.

println

public final boolean println(int level,
                             java.lang.Object object)

Print out an object if the debugging context warrents.

Specified by:
println in interface DebugOutput
Parameters:
level - The debugging level of this message.
object - The object to print.

println

public final boolean println(int level,
                             java.lang.String message)

Print out a debugging message if the debugging context warrents.

Specified by:
println in interface DebugOutput
Parameters:
level - The debugging level of this message.
message - The debugging message to print.

getWriter

public abstract java.io.Writer getWriter()

Returns a Writer for this output interface if one is available.

Specified by:
getWriter in interface DebugOutput
Returns:
a Writer for this output interface if one is available.
See Also:
Writer

isValidCategory

public final boolean isValidCategory(java.lang.String category)

Tests to see if the current debug context is interested in a given category.

Specified by:
isValidCategory in interface DebugOutput
Parameters:
category - the category to inspect.
Returns:
a boolean indicating if the category in question is valid at this time for this context (i.e. debugging framework state, thread, class invoking the method, etc.)
See Also:
Context

isValidLevel

public final boolean isValidLevel(int level)

Tests to see if the current debug context is interested in a given level.

Specified by:
isValidLevel in interface DebugOutput
Parameters:
level - the level to inspect.
Returns:
a boolean indicating if the level in question is valid at this time for this context (i.e. debugging framework state, thread, class invoking the method, etc.)
See Also:
Context

IDebug
© 1997-2001 Joseph Kiniry
© 2000-2001 KindSoftware
© 1997-1999 Caltech
All Rights Reserved