Top Constructors Methods
org.apache.derby.iapi.services.diag

public Class DiagnosticUtil

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Diagnosticable

Returns:

A new instance of the diagnostic object for input object, or null if one could not be found for some reason.
findDiagnostic
(Object
The object which to build the diagnostic object for.
ref
)

Given an object return instance of the diagnostic object for this class.

public static String

Returns:

The string describing the class input.
toDiagString
(Object
The object to print out.
obj
)

Return a diagnostic string associated with an object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DiagnosticUtilback to summary
private DiagnosticUtil()

Method Detail

findDiagnosticback to summary
public static Diagnosticable findDiagnostic(Object ref)

Given an object return instance of the diagnostic object for this class.

Given an object this routine will determine the classname of the object and then try to instantiate a new instance of the diagnostic object for this class by prepending on "D_" to the last element of theclassname. If no matching class is found then the same lookup is made on the super-class of the object, looking all the way up the hierachy until a diagnostic class is found.
This routine will call "init(ref)" on the new instance and then return the new instance.

Parameters
ref:Object

The object which to build the diagnostic object for.

Returns:Diagnosticable

A new instance of the diagnostic object for input object, or null if one could not be found for some reason.

toDiagStringback to summary
public static String toDiagString(Object obj)

Return a diagnostic string associated with an object.

A utility interface to use if you just want to print a single string that represents the object in question. In following order this routine will deliver the string to use: 1) find diagnostic help class, and use class.diag() 2) else just use class.toString()

Parameters
obj:Object

The object to print out.

Returns:String

The string describing the class input.