com.sun.tools.doclets.internal.toolkit.util
Class MessageRetriever

java.lang.Object
  extended by com.sun.tools.doclets.internal.toolkit.util.MessageRetriever

public class MessageRetriever
extends java.lang.Object

Retrieve and format messages stored in a resource. This code is not part of an API. It is implementation that is subject to change. Do not use it as an API

Since:
1.2

Field Summary
private  Configuration configuration
          The global configuration information for this run.
private  java.util.ResourceBundle messageRB
          The lazily fetched resource..
private  java.lang.String resourcelocation
          The location from which to lazily fetch the resource..
 
Constructor Summary
MessageRetriever(Configuration configuration, java.lang.String resourcelocation)
          Initilize the ResourceBundle with the given resource.
MessageRetriever(java.util.ResourceBundle rb)
          Initilize the ResourceBundle with the given resource.
 
Method Summary
 void error(SourcePosition pos, java.lang.String key, java.lang.Object... args)
          Print error message, increment error count.
 void error(java.lang.String key, java.lang.Object... args)
          Print error message, increment error count.
 java.lang.String getText(java.lang.String key, java.lang.Object... args)
          Get and format message string from resource
 void notice(SourcePosition pos, java.lang.String key, java.lang.Object... args)
          Print a message.
 void notice(java.lang.String key, java.lang.Object... args)
          Print a message.
private  void printError(SourcePosition pos, java.lang.String msg)
          Print error message, increment error count.
private  void printError(java.lang.String msg)
          Print error message, increment error count.
private  void printNotice(SourcePosition pos, java.lang.String msg)
          Print a message.
private  void printNotice(java.lang.String msg)
          Print a message.
private  void printWarning(SourcePosition pos, java.lang.String msg)
          Print warning message, increment warning count.
private  void printWarning(java.lang.String msg)
          Print warning message, increment warning count.
 void warning(SourcePosition pos, java.lang.String key, java.lang.Object... args)
          Print warning message, increment warning count.
 void warning(java.lang.String key, java.lang.Object... args)
          Print warning message, increment warning count.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

private final Configuration configuration
The global configuration information for this run.


resourcelocation

private final java.lang.String resourcelocation
The location from which to lazily fetch the resource..


messageRB

private java.util.ResourceBundle messageRB
The lazily fetched resource..

Constructor Detail

MessageRetriever

public MessageRetriever(java.util.ResourceBundle rb)
Initilize the ResourceBundle with the given resource.

Parameters:
rb - the esource bundle to read.

MessageRetriever

public MessageRetriever(Configuration configuration,
                        java.lang.String resourcelocation)
Initilize the ResourceBundle with the given resource.

Parameters:
configuration - the configuration
resourcelocation - Resource.
Method Detail

getText

public java.lang.String getText(java.lang.String key,
                                java.lang.Object... args)
                         throws java.util.MissingResourceException
Get and format message string from resource

Parameters:
key - selects message from resource
args - arguments to be replaced in the message.
Throws:
java.util.MissingResourceException - when the key does not exist in the properties file.

printError

private void printError(SourcePosition pos,
                        java.lang.String msg)
Print error message, increment error count.

Parameters:
pos - the position of the source
msg - message to print

printError

private void printError(java.lang.String msg)
Print error message, increment error count.

Parameters:
msg - message to print

printWarning

private void printWarning(SourcePosition pos,
                          java.lang.String msg)
Print warning message, increment warning count.

Parameters:
pos - the position of the source
msg - message to print

printWarning

private void printWarning(java.lang.String msg)
Print warning message, increment warning count.

Parameters:
msg - message to print

printNotice

private void printNotice(SourcePosition pos,
                         java.lang.String msg)
Print a message.

Parameters:
pos - the position of the source
msg - message to print

printNotice

private void printNotice(java.lang.String msg)
Print a message.

Parameters:
msg - message to print

error

public void error(SourcePosition pos,
                  java.lang.String key,
                  java.lang.Object... args)
Print error message, increment error count.

Parameters:
pos - the position of the source
key - selects message from resource
args - arguments to be replaced in the message.

error

public void error(java.lang.String key,
                  java.lang.Object... args)
Print error message, increment error count.

Parameters:
key - selects message from resource
args - arguments to be replaced in the message.

warning

public void warning(SourcePosition pos,
                    java.lang.String key,
                    java.lang.Object... args)
Print warning message, increment warning count.

Parameters:
pos - the position of the source
key - selects message from resource
args - arguments to be replaced in the message.

warning

public void warning(java.lang.String key,
                    java.lang.Object... args)
Print warning message, increment warning count.

Parameters:
key - selects message from resource
args - arguments to be replaced in the message.

notice

public void notice(SourcePosition pos,
                   java.lang.String key,
                   java.lang.Object... args)
Print a message.

Parameters:
pos - the position of the source
key - selects message from resource
args - arguments to be replaced in the message.

notice

public void notice(java.lang.String key,
                   java.lang.Object... args)
Print a message.

Parameters:
key - selects message from resource
args - arguments to be replaced in the message.