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