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