org.sonatype.sisu.goodies.i18n
Class PrefixingMessageSource

java.lang.Object
  extended by org.sonatype.sisu.goodies.i18n.PrefixingMessageSource
All Implemented Interfaces:
MessageSource

public class PrefixingMessageSource
extends Object
implements MessageSource

A message source which prefixes message codes.

Since:
1.0

Constructor Summary
PrefixingMessageSource(MessageSource messages, String prefix)
           
 
Method Summary
protected  String createCode(String code)
           
 String format(String code, Object... args)
           
 String getMessage(String code)
           
 String getMessage(String code, String defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixingMessageSource

public PrefixingMessageSource(MessageSource messages,
                              String prefix)
Method Detail

createCode

protected String createCode(String code)

getMessage

public String getMessage(String code)
Specified by:
getMessage in interface MessageSource

getMessage

public String getMessage(String code,
                         String defaultValue)
Specified by:
getMessage in interface MessageSource

format

public String format(String code,
                     Object... args)
Specified by:
format in interface MessageSource


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.