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.109+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/IllegalDependencyTypeExceptionBundle"</code>
16   * <code>ResourceBundle</code>.
17   */
18  class IllegalDependencyTypeExceptionBundle
19  {
20  
21    /** Singleton instance. */
22    private static final IllegalDependencyTypeExceptionBundle instance =
23      new IllegalDependencyTypeExceptionBundle();
24  
25    /** Creates a new <code>IllegalDependencyTypeExceptionBundle</code> instance. */
26    IllegalDependencyTypeExceptionBundle()
27    {
28      this.getMessage ( "illegalDependencyType", Locale.getDefault() );
29    }
30  
31    /**
32     * Gets the <code>IllegalDependencyTypeExceptionBundle</code> singleton.
33     *
34     * @return The <code>IllegalDependencyTypeExceptionBundle</code> singleton.
35     */
36    static IllegalDependencyTypeExceptionBundle getInstance()
37    {
38      return instance;
39    }
40  
41    /**
42     * Gets the text of the message with key {@code "illegalDependencyType"}.
43     *
44     * @return <blockquote><pre>The dependency "{1}" of implementation "{0}" has illegal type "{2}". Expected type "{3}".</pre></blockquote>
45     * <blockquote><pre>Ungültiger Typ "{2}" der Abhängigkeit "{1}" von Implementierung "{0}". Typ "{3}" erwartet.</pre></blockquote>
46     * 
47     */
48    String getIllegalDependencyTypeMessage
49    (
50        Locale locale
51      , final java.lang.String implementationIdentifier
52      , final java.lang.String dependencyName
53      , final java.lang.String illegalType
54      , final java.lang.String expectedType
55    )
56    {
57      if ( locale == null )
58      {
59        locale = Locale.getDefault();
60      }
61  
62      return new MessageFormat( this.getMessage(
63          "illegalDependencyType", locale ), locale ).format(
64          new Object[]
65          {
66              implementationIdentifier,
67              dependencyName,
68              illegalType,
69              expectedType,
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/IllegalDependencyTypeExceptionBundle", locale ).
92          getString( key );
93  
94    }
95  }