org.apache.tomcat.maven.common.messages
Class DefaultMessagesProvider

java.lang.Object
  extended by org.apache.tomcat.maven.common.messages.DefaultMessagesProvider
All Implemented Interfaces:
MessagesProvider

@Component(role=MessagesProvider.class)
public class DefaultMessagesProvider
extends Object
implements MessagesProvider

Since:
2.0
Author:
Olivier Lamy

Constructor Summary
DefaultMessagesProvider()
           
 
Method Summary
 String getMessage(String key)
          Gets the message for the given key from this packages resource bundle.
 String getMessage(String key, Object param)
          Gets the message for the given key from this packages resource bundle and formats it with the given parameter.
 String getMessage(String key, Object[] params)
          Gets the message for the given key from this packages resource bundle and formats it with the given parameters.
 String getMessage(String key, Object param1, Object param2)
          Gets the message for the given key from this packages resource bundle and formats it with the given parameters.
 ResourceBundle getResourceBundle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMessagesProvider

public DefaultMessagesProvider()
Method Detail

getResourceBundle

public ResourceBundle getResourceBundle()

getMessage

public String getMessage(String key)
Gets the message for the given key from this packages resource bundle.

Specified by:
getMessage in interface MessagesProvider
Parameters:
key - the key for the required message
Returns:
the message

getMessage

public String getMessage(String key,
                         Object param)
Gets the message for the given key from this packages resource bundle and formats it with the given parameter.

Specified by:
getMessage in interface MessagesProvider
Parameters:
key - the key for the required message
param - the parameter to be used to format the message with
Returns:
the formatted message

getMessage

public String getMessage(String key,
                         Object param1,
                         Object param2)
Gets the message for the given key from this packages resource bundle and formats it with the given parameters.

Specified by:
getMessage in interface MessagesProvider
Parameters:
key - the key for the required message
param1 - the first parameter to be used to format the message with
param2 - the second parameter to be used to format the message with
Returns:
the formatted message

getMessage

public String getMessage(String key,
                         Object[] params)
Gets the message for the given key from this packages resource bundle and formats it with the given parameters.

Specified by:
getMessage in interface MessagesProvider
Parameters:
key - the key for the required message
params - the parameters to be used to format the message with
Returns:
the formatted message


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.