All LDAP Classes
Internal LDAP Classes

com.novell.ldap.resources
Class ResourcesHandler

java.lang.Object
  extended by com.novell.ldap.resources.ResourcesHandler

public class ResourcesHandler
extends java.lang.Object

A utility class to get strings from the ExceptionMessages and ResultCodeMessages resources.


Field Summary
private static java.util.Locale defaultLocale
          The default Locale
private static java.util.ResourceBundle defaultMessages
          Initialized when the first Exception message string is requested
private static java.util.ResourceBundle defaultResultCodes
           
private static java.lang.String pkg
          Package where resources are found
 
Constructor Summary
private ResourcesHandler()
           
 
Method Summary
static java.lang.String getMessage(java.lang.String messageOrKey, java.lang.Object[] arguments)
          Returns a string using the MessageOrKey as a key into ExceptionMessages or, if the Key does not exist, returns the string messageOrKey.
static java.lang.String getMessage(java.lang.String messageOrKey, java.lang.Object[] arguments, java.util.Locale locale)
          Returns the message stored in the ExceptionMessages resource for the specified locale using messageOrKey and argments passed into the constructor.
static java.lang.String getResultString(int code)
          Returns a string representing the LDAP result code from the default ResultCodeMessages resource.
static java.lang.String getResultString(int code, java.util.Locale locale)
          Returns a string representing the LDAP result code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultResultCodes

private static java.util.ResourceBundle defaultResultCodes

defaultMessages

private static java.util.ResourceBundle defaultMessages
Initialized when the first Exception message string is requested


pkg

private static java.lang.String pkg
Package where resources are found


defaultLocale

private static java.util.Locale defaultLocale
The default Locale

Constructor Detail

ResourcesHandler

private ResourcesHandler()
Method Detail

getMessage

public static java.lang.String getMessage(java.lang.String messageOrKey,
                                          java.lang.Object[] arguments)
Returns a string using the MessageOrKey as a key into ExceptionMessages or, if the Key does not exist, returns the string messageOrKey. In addition it formats the arguments into the message according to MessageFormat.

Parameters:
messageOrKey - Key string for the resource.

arguments -
Returns:
the text for the message specified by the MessageKey or the Key if it there is no message for that key.

getMessage

public static java.lang.String getMessage(java.lang.String messageOrKey,
                                          java.lang.Object[] arguments,
                                          java.util.Locale locale)
Returns the message stored in the ExceptionMessages resource for the specified locale using messageOrKey and argments passed into the constructor. If no string exists in the resource then this returns the string stored in message. (This method is identical to getLDAPErrorMessage(Locale locale).)

Parameters:
messageOrKey - Key string for the resource.

arguments -

locale - The Locale that should be used to pull message strings out of ExceptionMessages.
Returns:
the text for the message specified by the MessageKey or the Key if it there is no message for that key.

getResultString

public static java.lang.String getResultString(int code)
Returns a string representing the LDAP result code from the default ResultCodeMessages resource.

Parameters:
code - the result code

Returns:
the String representing the result code.

getResultString

public static java.lang.String getResultString(int code,
                                               java.util.Locale locale)
Returns a string representing the LDAP result code. The message is obtained from the locale specific ResultCodeMessage resource.

Parameters:
code - the result code

locale - The Locale that should be used to pull message strings out of ResultMessages.
Returns:
the String representing the result code.

All LDAP Classes
Internal LDAP Classes

Copyright ? 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000