Top Description Fields Constructors Methods
com.sun.tools.example.debug.tty

public Class MessageOutput

extends Object
Class Inheritance
Imports
java.util.*, java.text.MessageFormat

Internationalization (i18n) convenience methods for jdb. All program output should flow through these methods, and this is the only class that should be printing directly or otherwise accessing System.[out,err].
Author
Tim Bell

Field Summary

Modifier and TypeField and Description
private static MessageFormat
messageFormat

Our message formatter.

pack-priv static ResourceBundle
textResources

The resource bundle containing localizable message content.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
fatalError(String messageKey)

Fatal shutdown notification.

pack-priv static String
format(String key)

"Format" a string by doing a simple key lookup.

pack-priv static String
format(String key, String argument)

Fetch and format a message with one string argument.

pack-priv static synchronized String
format(String key, Object[] arguments)

Fetch a string by key lookup and format in the arguments.

pack-priv static void
lnprint(String key)

Print a newline, followed by the string.

pack-priv static void
lnprint(String key, String argument)

pack-priv static void
lnprint(String key, Object[] arguments)

pack-priv static void
pack-priv static void
printDirect(char c)

pack-priv static void
printDirectln(String line)

Print directly to System.out.

pack-priv static void
printException(String key, Exception e)

Print an exception message with a stack trace.

pack-priv static void
println()

Print a newline.

pack-priv static void
println(String key)

Format and print a simple string.

pack-priv static void
println(String key, String argument)

pack-priv static void
println(String key, Object[] arguments)

Fetch, format and print a message with an arbitrary number of message arguments.

pack-priv static void
pack-priv static void
printPrompt(boolean simple)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

messageFormatback to summary
private static MessageFormat messageFormat

Our message formatter. Allocated once, used many times

textResourcesback to summary
pack-priv static ResourceBundle textResources

The resource bundle containing localizable message content. This is loaded by TTY.main() at start-up

Constructor Detail

MessageOutputback to summary
public MessageOutput()

Method Detail

fatalErrorback to summary
pack-priv static void fatalError(String messageKey)

Fatal shutdown notification. This is sent to System.err instead of System.out

formatback to summary
pack-priv static String format(String key)

"Format" a string by doing a simple key lookup.

formatback to summary
pack-priv static String format(String key, String argument)

Fetch and format a message with one string argument. This is the most common usage.

formatback to summary
pack-priv static synchronized String format(String key, Object[] arguments)

Fetch a string by key lookup and format in the arguments.

lnprintback to summary
pack-priv static void lnprint(String key)

Print a newline, followed by the string.

lnprintback to summary
pack-priv static void lnprint(String key, String argument)
lnprintback to summary
pack-priv static void lnprint(String key, Object[] arguments)
printDirectback to summary
pack-priv static void printDirect(String line)
printDirectback to summary
pack-priv static void printDirect(char c)
printDirectlnback to summary
pack-priv static void printDirectln(String line)

Print directly to System.out. Every rule has a few exceptions. The exceptions to "must use the MessageOutput formatters" are: VMConnection.dumpStream() TTY.monitorCommand() TTY.TTY() (for the '!!' command only) Commands.java (multiple locations) These are the only sites that should be calling this method.

printExceptionback to summary
pack-priv static void printException(String key, Exception e)

Print an exception message with a stack trace.

printlnback to summary
pack-priv static void println()

Print a newline. Use this instead of '\n'

printlnback to summary
pack-priv static void println(String key)

Format and print a simple string.

printlnback to summary
pack-priv static void println(String key, String argument)
printlnback to summary
pack-priv static void println(String key, Object[] arguments)

Fetch, format and print a message with an arbitrary number of message arguments.

printPromptback to summary
pack-priv static void printPrompt()
printPromptback to summary
pack-priv static void printPrompt(boolean simple)