RSE
Release 3.0

org.eclipse.rse.services.clientserver.messages
Class SystemMessageFile

java.lang.Object
  extended by org.eclipse.rse.services.clientserver.messages.SystemMessageFile
All Implemented Interfaces:
ErrorHandler
Direct Known Subclasses:
SystemUIMessageFile

public class SystemMessageFile
extends Object
implements ErrorHandler

Use this class to open, and parse, a RSE-style message file.


Constructor Summary
SystemMessageFile(String messageFileName, InputStream messageFile, InputStream dtdStream)
          Constructor
 
Method Summary
 void error(SAXParseException ex)
          XML Parser-required method: XML-parser Error.
 void fatalError(SAXParseException ex)
          XML Parser-required method: XML-parser Fatal error.
protected  org.eclipse.rse.services.clientserver.messages.SystemMessageFile.MessageFileInfo getFromCache(String messageFileName)
          If the named message file has already been loaded return its MessageFileInfo
 SystemMessage getMessage(String msgId)
          Use this method to retrieve a message from the message file.
protected  SystemMessage loadSystemMessage(String componentAbbr, String subComponentAbbr, String msgNumber, char msgIndicator, String msgL1, String msgL2)
          Override this to provide different extended SystemMessage implementation
 boolean printHTML(String fullFileName)
          Use this method to generate html documentation for the messages in the message file.
 boolean scanForDuplicates()
          Use this method to scan message file for duplicate messages.
 void warning(SAXParseException ex)
          XML Parser-required method: XML-parser warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemMessageFile

public SystemMessageFile(String messageFileName,
                         InputStream messageFile,
                         InputStream dtdStream)
Constructor

Parameters:
messageFileName - - a key used to determine if a message file has already been loaded. Usually the name of the xml file containing the message file.
messageFile - the stream containing the message file.
dtdStream - the stream containing the dtd for this message file.
Method Detail

getFromCache

protected org.eclipse.rse.services.clientserver.messages.SystemMessageFile.MessageFileInfo getFromCache(String messageFileName)
If the named message file has already been loaded return its MessageFileInfo

Parameters:
messageFileName -
Returns:
the MessageFileInfo for this message file

getMessage

public SystemMessage getMessage(String msgId)
Use this method to retrieve a message from the message file.

Parameters:
msgId - - the ID of the message to retrieve. This is the concatenation of the message's component abbreviation, subcomponent abbreviation, and message ID as declared in the message xml file.
Returns:
SystemMessage object

loadSystemMessage

protected SystemMessage loadSystemMessage(String componentAbbr,
                                          String subComponentAbbr,
                                          String msgNumber,
                                          char msgIndicator,
                                          String msgL1,
                                          String msgL2)
                                   throws IndicatorException
Override this to provide different extended SystemMessage implementation

Parameters:
componentAbbr - a three letter component name
subComponentAbbr - a one letter subcomponent name
msgNumber - a four digit message number
msgIndicator - a single character message type indicator
msgL1 - the first level text that describes the error
msgL2 - the second level text that provides details about the error and possible recovery
Returns:
the SystemMessage
Throws:
IndicatorException - if the message type indicator is invalid.
See Also:
for message type indicator constants

scanForDuplicates

public boolean scanForDuplicates()
Use this method to scan message file for duplicate messages. You typically do this only during development!! If a duplicate is found, its message id is written to standard out, and to the systems.core log file.

Returns:
true if duplicates found.

printHTML

public boolean printHTML(String fullFileName)
Use this method to generate html documentation for the messages in the message file. This is useful for reference information, or to give to Level 2 for service support.

Parameters:
fullFileName - - the fully qualified name of the file to write to. Overwrites current contents.
Returns:
true if it went well, false if it failed for some reason, such as given a bad file name. Errors written to standard out.

warning

public void warning(SAXParseException ex)
XML Parser-required method: XML-parser warning.

Specified by:
warning in interface ErrorHandler

error

public void error(SAXParseException ex)
XML Parser-required method: XML-parser Error.

Specified by:
error in interface ErrorHandler

fatalError

public void fatalError(SAXParseException ex)
                throws SAXException
XML Parser-required method: XML-parser Fatal error.

Specified by:
fatalError in interface ErrorHandler
Throws:
SAXException

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.