public class

LocalizedMessage

extends Object
java.lang.Object
   ↳ org.bouncycastle.i18n.LocalizedMessage
Known Direct Subclasses
Known Indirect Subclasses

Summary

Nested Classes
class LocalizedMessage.FilteredArguments  
Constants
String DEFAULT_ENCODING
Fields
protected LocalizedMessage.FilteredArguments arguments
protected String encoding
protected LocalizedMessage.FilteredArguments extraArgs
protected Filter filter
protected final String id
protected ClassLoader loader
protected final String resource
Public Constructors
LocalizedMessage(String resource, String id)
Constructs a new LocalizedMessage using resource as the base name for the RessourceBundle and id as the message bundle id the resource file.
LocalizedMessage(String resource, String id, String encoding)
Constructs a new LocalizedMessage using resource as the base name for the RessourceBundle and id as the message bundle id the resource file.
LocalizedMessage(String resource, String id, Object[] arguments)
Constructs a new LocalizedMessage using resource as the base name for the RessourceBundle and id as the message bundle id the resource file.
LocalizedMessage(String resource, String id, String encoding, Object[] arguments)
Constructs a new LocalizedMessage using resource as the base name for the RessourceBundle and id as the message bundle id the resource file.
Public Methods
Object[] getArguments()
Returns an Object[] containing the message arguments.
ClassLoader getClassLoader()
Returns the ClassLoader which loads the resource files or null if the default ClassLoader is used.
String getEntry(String key, Locale loc, TimeZone timezone)
Reads the entry id + "." + key from the resource file and returns a formated message for the given Locale and TimeZone.
Object[] getExtraArgs()
Filter getFilter()
Returns the current filter.
String getId()
Returns the id of the message in the resource bundle.
String getResource()
Returns the name of the resource bundle for this message
void setClassLoader(ClassLoader loader)
Set the ClassLoader which loads the resource files.
void setExtraArgument(Object extraArg)
void setExtraArguments(Object[] extraArgs)
void setFilter(Filter filter)
Sets the Filter that is used to filter the arguments of this message
String toString()
Protected Methods
String addExtraArgs(String msg, Locale locale)
String formatWithTimeZone(String template, Object[] arguments, Locale locale, TimeZone timezone)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String DEFAULT_ENCODING

Constant Value: "ISO-8859-1"

Fields

protected String encoding

protected Filter filter

protected final String id

protected ClassLoader loader

protected final String resource

Public Constructors

public LocalizedMessage (String resource, String id)

Constructs a new LocalizedMessage using resource as the base name for the RessourceBundle and id as the message bundle id the resource file.

Parameters
resource base name of the resource file
id the id of the corresponding bundle in the resource file
Throws
NullPointerException if resource or id is null

public LocalizedMessage (String resource, String id, String encoding)

Constructs a new LocalizedMessage using resource as the base name for the RessourceBundle and id as the message bundle id the resource file.

Parameters
resource base name of the resource file
id the id of the corresponding bundle in the resource file
encoding the encoding of the resource file
Throws
NullPointerException if resource or id is null
UnsupportedEncodingException if the encoding is not supported

public LocalizedMessage (String resource, String id, Object[] arguments)

Constructs a new LocalizedMessage using resource as the base name for the RessourceBundle and id as the message bundle id the resource file.

Parameters
resource base name of the resource file
id the id of the corresponding bundle in the resource file
arguments an array containing the arguments for the message
Throws
NullPointerException if resource or id is null

public LocalizedMessage (String resource, String id, String encoding, Object[] arguments)

Constructs a new LocalizedMessage using resource as the base name for the RessourceBundle and id as the message bundle id the resource file.

Parameters
resource base name of the resource file
id the id of the corresponding bundle in the resource file
encoding the encoding of the resource file
arguments an array containing the arguments for the message
Throws
NullPointerException if resource or id is null
UnsupportedEncodingException if the encoding is not supported

Public Methods

public Object[] getArguments ()

Returns an Object[] containing the message arguments.

Returns
  • the message arguments

public ClassLoader getClassLoader ()

Returns the ClassLoader which loads the resource files or null if the default ClassLoader is used.

Returns

public String getEntry (String key, Locale loc, TimeZone timezone)

Reads the entry id + "." + key from the resource file and returns a formated message for the given Locale and TimeZone.

Parameters
key second part of the entry id
loc the used Locale
timezone the used TimeZone
Returns
  • a Strng containing the localized message
Throws
MissingEntryException if the resource file is not available or the entry does not exist.

public Object[] getExtraArgs ()

public Filter getFilter ()

Returns the current filter.

Returns
  • the current filter

public String getId ()

Returns the id of the message in the resource bundle.

Returns
  • the id of the message

public String getResource ()

Returns the name of the resource bundle for this message

Returns
  • name of the resource file

public void setClassLoader (ClassLoader loader)

Set the ClassLoader which loads the resource files. If it is set to null then the default ClassLoader is used.

Parameters
loader the ClassLoader which loads the resource files

public void setExtraArgument (Object extraArg)

public void setExtraArguments (Object[] extraArgs)

public void setFilter (Filter filter)

Sets the Filter that is used to filter the arguments of this message

Parameters
filter the Filter to use. null to disable filtering.

public String toString ()

Protected Methods

protected String addExtraArgs (String msg, Locale locale)

protected String formatWithTimeZone (String template, Object[] arguments, Locale locale, TimeZone timezone)