org.sonatype.gshell.util.i18n
Class ResourceBundleMessageSource
java.lang.Object
org.sonatype.gshell.util.i18n.ResourceBundleMessageSource
- All Implemented Interfaces:
- MessageSource
public class ResourceBundleMessageSource
- extends Object
- implements MessageSource
Message source backed up by ResourceBundle instances.
- Since:
- 2.0
- Author:
- Jason Dillon
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceBundleMessageSource
public ResourceBundleMessageSource(Locale locale)
ResourceBundleMessageSource
public ResourceBundleMessageSource(Class... types)
add
public ResourceBundleMessageSource add(boolean required,
Class... types)
getLocale
public Locale getLocale()
add
public ResourceBundleMessageSource add(Class... types)
getMessage
public String getMessage(String code)
- Get a raw message from the resource bundles using the given code.
- Specified by:
getMessage in interface MessageSource
format
public String format(String code,
Object... args)
- Format a message (based on
MessageFormat using the message
from the resource bundles using the given code as a pattern and the
given objects as arguments.
- Specified by:
format in interface MessageSource
Copyright © 2008-2011 Sonatype. All Rights Reserved.