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.000+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/DuplicateImplementationExceptionBundle"</code>
16 * <code>ResourceBundle</code>.
17 */
18 class DuplicateImplementationExceptionBundle
19 {
20
21 /** Singleton instance. */
22 private static final DuplicateImplementationExceptionBundle instance =
23 new DuplicateImplementationExceptionBundle();
24
25 /** Creates a new <code>DuplicateImplementationExceptionBundle</code> instance. */
26 DuplicateImplementationExceptionBundle()
27 {
28 this.getMessage ( "duplicateImplementation", Locale.getDefault() );
29 }
30
31 /**
32 * Gets the <code>DuplicateImplementationExceptionBundle</code> singleton.
33 *
34 * @return The <code>DuplicateImplementationExceptionBundle</code> singleton.
35 */
36 static DuplicateImplementationExceptionBundle getInstance()
37 {
38 return instance;
39 }
40
41 /**
42 * Gets the text of the message with key {@code "duplicateImplementation"}.
43 *
44 * @return <blockquote><pre>Multiple implementations with identifier "{0}".</pre></blockquote>
45 * <blockquote><pre>Mehrere Implementierungen mit Identifikation "{0}".</pre></blockquote>
46 *
47 */
48 String getDuplicateImplementationMessage
49 (
50 Locale locale
51 , final java.lang.String implementationIdentifier
52 )
53 {
54 if ( locale == null )
55 {
56 locale = Locale.getDefault();
57 }
58
59 return new MessageFormat( this.getMessage(
60 "duplicateImplementation", locale ), locale ).format(
61 new Object[]
62 {
63 implementationIdentifier,
64 null
65 } );
66
67 }
68
69 /**
70 * Gets a message for a given key and locale.
71 *
72 * @param key The key of the message to return.
73 * @param locale The locale of the message.
74 *
75 * @return Message for {@code key} using {@code locale}.
76 */
77 private String getMessage( final String key, Locale locale )
78 {
79 if ( locale == null )
80 {
81 locale = Locale.getDefault();
82 }
83
84 return ResourceBundle.getBundle(
85 "org/jdtaus/core/container/DuplicateImplementationExceptionBundle", locale ).
86 getString( key );
87
88 }
89 }