All Packages    This Package  Previous  Next  

Class sqlj.runtime.profile.util.ProfilePrinter

java.lang.Object
   |
   +----sqlj.runtime.profile.util.ProfilePrinter

public class ProfilePrinter
extends Object
implements ProfileCustomizer
A ProfilePrinter is a utility class used to pretty-print a profile. Since profiles typically exist as serialized objects, it is nice to have a way to view their contents in plain text. A profile printer may be called as a command-line tool, passing a profile name as an argument, or as a runtime API, passing a profile or parts of a profile as arguments.

Invoke the class with no arguments for a usage listing.


Constructor Index

 o ProfilePrinter()
Creates a new profile printer with output stream System.out
 o ProfilePrinter(PrintWriter)
Creates a new profile printer whose output stream is the passed print writer.

Method Index

 o acceptsConnection(Connection)
 o customize(Profile, Connection, ErrorLog)
 o main(String[])
The main entry point takes the name of a profile as an argument and attempts to load the profile using the default class loader.
 o print(Profile)
Prints a profile to the current output stream.
 o print(ProfileData)
Prints a profile data object to the current output stream.
 o print(ProfileData, EntryInfo)
Prints a profile entry to the current output stream.
 o print(ProfileData, int)
Prints a profile entry to the current output stream.
 o print(ProfileData, TypeInfo, int)
Prints a profile type info object to the current output stream.
 o setOutput(PrintWriter)
Sets the output stream onto which subsequent calls to a print method will write.

Constructors

 o ProfilePrinter
 public ProfilePrinter()
Creates a new profile printer with output stream System.out

 o ProfilePrinter
 public ProfilePrinter(PrintWriter out)
Creates a new profile printer whose output stream is the passed print writer.

Parameters:
out - the print writer onto which to writer output.

Methods

 o main
 public static void main(String args[])
The main entry point takes the name of a profile as an argument and attempts to load the profile using the default class loader. If a profile is able to be instantiated, the print method is invoked on the resulting profile. All output is passed to System.out.

See Also:
print
 o acceptsConnection
 public boolean acceptsConnection(Connection conn)
 o customize
 public boolean customize(Profile profile,
                          Connection conn,
                          ErrorLog log)
 o setOutput
 public void setOutput(PrintWriter out)
Sets the output stream onto which subsequent calls to a print method will write. System.out is the default output stream.

 o print
 public void print(Profile p)
Prints a profile to the current output stream. The profile data object is printed using the appropriate print routine.

Parameters:
p - the profile to print.
See Also:
print
 o print
 public void print(ProfileData data)
Prints a profile data object to the current output stream. Each profile entry contained in the profile data is printed using the appropriate print routine.

Parameters:
data - the profile data object to print.
See Also:
print
 o print
 public void print(ProfileData p,
                   int entryNum)
Prints a profile entry to the current output stream. Each type info object contained in the entry is printed using the appropriate print routine.

Parameters:
p - the profile data object in which to find entries to print.
entryNum - the number of the profile within the profile data to print, 0 based.
See Also:
print
 o print
 public void print(ProfileData p,
                   EntryInfo entry)
Prints a profile entry to the current output stream. Each type info object contained in the entry is printed using the appropriate print routine.

Parameters:
p - the profile data object in which to find entries to print.
entry - the profile entry info to print.
See Also:
print
 o print
 public void print(ProfileData data,
                   TypeInfo type,
                   int typeNum)
Prints a profile type info object to the current output stream. The profile data handle is passed to obtain a profile by which the java class of a particular type info object may be printed (both the java type name in the type info object, and the name of its class as resolved by the current profile are printed).

Parameters:
data - the profile data object which contains the entry that contains the type.
type - the type info object to print
typeNum - the index at which the type appeared in the containing entry info object

All Packages    This Package  Previous  Next