View Javadoc

1   /*
2    * WARNING: Generated code. All changes will be lost upon re-generation.
3    *
4    * Generator org.jdtaus.mojo.resource.util.BundleGenerator 3.3
5    * Template META-INF/templates/Bundle.java.vm
6    * Generated 2012-12-03T20:50:43.156+0100
7    */
8   package org.jdtaus.core.container;
9   
10  import java.util.Locale;
11  import java.util.ResourceBundle;
12  import java.text.MessageFormat;
13  
14  /**
15   * Accessor methods for the <code>"org/jdtaus/core/container/ImplementationExceptionBundle"</code>
16   * <code>ResourceBundle</code>.
17   */
18  class ImplementationExceptionBundle
19  {
20  
21    /** Singleton instance. */
22    private static final ImplementationExceptionBundle instance =
23      new ImplementationExceptionBundle();
24  
25    /** Creates a new <code>ImplementationExceptionBundle</code> instance. */
26    ImplementationExceptionBundle()
27    {
28      this.getMessage ( "implementationException", Locale.getDefault() );
29    }
30  
31    /**
32     * Gets the <code>ImplementationExceptionBundle</code> singleton.
33     *
34     * @return The <code>ImplementationExceptionBundle</code> singleton.
35     */
36    static ImplementationExceptionBundle getInstance()
37    {
38      return instance;
39    }
40  
41    /**
42     * Gets the text of the message with key {@code "implementationException"}.
43     *
44     * @return <blockquote><pre>Implementation: {0}, Version: {1}, Module: {2}: {3}</pre></blockquote>
45     * <blockquote><pre>Implementierung: {0}, Version: {1}, Modul: {2}: {3}</pre></blockquote>
46     * 
47     */
48    String getImplementationExceptionMessage
49    (
50        Locale locale
51      , final java.lang.String implementationIdentifier
52      , final java.lang.String implementationVersion
53      , final java.lang.String moduleName
54      , final java.lang.String message
55    )
56    {
57      if ( locale == null )
58      {
59        locale = Locale.getDefault();
60      }
61  
62      return new MessageFormat( this.getMessage(
63          "implementationException", locale ), locale ).format(
64          new Object[]
65          {
66              implementationIdentifier,
67              implementationVersion,
68              moduleName,
69              message,
70              null
71          } );
72  
73    }
74  
75    /**
76     * Gets a message for a given key and locale.
77     *
78     * @param key The key of the message to return.
79     * @param locale The locale of the message.
80     *
81     * @return Message for {@code key} using {@code locale}.
82     */
83    private String getMessage( final String key, Locale locale )
84    {
85      if ( locale == null )
86      {
87        locale = Locale.getDefault();
88      }
89  
90      return ResourceBundle.getBundle(
91          "org/jdtaus/core/container/ImplementationExceptionBundle", locale ).
92          getString( key );
93  
94    }
95  }