net.sf.oval.localization.message
Class ResourceBundleMessageResolver

java.lang.Object
  extended by net.sf.oval.localization.message.ResourceBundleMessageResolver
All Implemented Interfaces:
MessageResolver

public class ResourceBundleMessageResolver
extends Object
implements MessageResolver

Default implementation that resolves messages based on the registered resource bundles.

Author:
Sebastian Thomschke

Field Summary
static ResourceBundleMessageResolver INSTANCE
           
static Locale ROOT_LOCALE
           
 
Constructor Summary
ResourceBundleMessageResolver()
           
 
Method Summary
 boolean addMessageBundle(ResourceBundle mb)
          Adds a message bundle
protected  boolean addMessageBundle(ResourceBundle bundle, Locale locale)
           
 String getMessage(String key)
           
protected  String getMessage(String key, Locale locale)
           
 boolean removeMessageBundle(ResourceBundle bundle)
          Removes the message bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ResourceBundleMessageResolver INSTANCE

ROOT_LOCALE

public static final Locale ROOT_LOCALE
Constructor Detail

ResourceBundleMessageResolver

public ResourceBundleMessageResolver()
Method Detail

addMessageBundle

public boolean addMessageBundle(ResourceBundle mb)
Adds a message bundle

Returns:
true if the bundle was registered and false if it was already registered

addMessageBundle

protected boolean addMessageBundle(ResourceBundle bundle,
                                   Locale locale)

getMessage

public String getMessage(String key)
Specified by:
getMessage in interface MessageResolver

getMessage

protected String getMessage(String key,
                            Locale locale)

removeMessageBundle

public boolean removeMessageBundle(ResourceBundle bundle)
Removes the message bundle

Returns:
true if the bundle was registered and false if it wasn't registered


Copyright © 2005–2015 The OVal Development Team. All rights reserved.