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-03T21:29:31.921+0100
7    */
8   package org.jdtaus.core.container.ri.client;
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/ri/client/BootstrapEntityResolverBundle"</code>
16   * <code>ResourceBundle</code>.
17   */
18  class BootstrapEntityResolverBundle
19  {
20  
21    /** Singleton instance. */
22    private static final BootstrapEntityResolverBundle instance =
23      new BootstrapEntityResolverBundle();
24  
25    /** Creates a new <code>BootstrapEntityResolverBundle</code> instance. */
26    BootstrapEntityResolverBundle()
27    {
28      this.getMessage ( "unsupportedSystemIdUri", Locale.getDefault() );
29      this.getMessage ( "resolvedSystemIdUri", Locale.getDefault() );
30      this.getMessage ( "resourceNotAvailable", Locale.getDefault() );
31    }
32  
33    /**
34     * Gets the <code>BootstrapEntityResolverBundle</code> singleton.
35     *
36     * @return The <code>BootstrapEntityResolverBundle</code> singleton.
37     */
38    static BootstrapEntityResolverBundle getInstance()
39    {
40      return instance;
41    }
42  
43    /**
44     * Gets the text of the message with key {@code "unsupportedSystemIdUri"}.
45     *
46     * @return <blockquote><pre>Unsupported system id URI "{0}". {1}</pre></blockquote>
47     * <blockquote><pre>Nicht unterstützte System-ID URI "{0}". {1}</pre></blockquote>
48     * 
49     */
50    String getUnsupportedSystemIdUriMessage
51    (
52        Locale locale
53      , final java.lang.String systemIdUri
54      , final java.lang.String caus
55    )
56    {
57      if ( locale == null )
58      {
59        locale = Locale.getDefault();
60      }
61  
62      return new MessageFormat( this.getMessage(
63          "unsupportedSystemIdUri", locale ), locale ).format(
64          new Object[]
65          {
66              systemIdUri,
67              caus,
68              null
69          } );
70  
71    }
72    /**
73     * Gets the text of the message with key {@code "resolvedSystemIdUri"}.
74     *
75     * @return <blockquote><pre>{0}
76     *    -> {1}</pre></blockquote>
77     * <blockquote><pre>{0}
78     *    -> {1}</pre></blockquote>
79     * 
80     */
81    String getResolvedSystemIdUriMessage
82    (
83        Locale locale
84      , final java.lang.String systemIdUri
85      , final java.lang.String resolvedSystemIdUri
86    )
87    {
88      if ( locale == null )
89      {
90        locale = Locale.getDefault();
91      }
92  
93      return new MessageFormat( this.getMessage(
94          "resolvedSystemIdUri", locale ), locale ).format(
95          new Object[]
96          {
97              systemIdUri,
98              resolvedSystemIdUri,
99              null
100         } );
101 
102   }
103   /**
104    * Gets the text of the message with key {@code "resourceNotAvailable"}.
105    *
106    * @return <blockquote><pre>Resource {0} is not available.</pre></blockquote>
107    * <blockquote><pre>Resource {0} nicht verfügbar.</pre></blockquote>
108    * 
109    */
110   String getResourceNotAvailableMessage
111   (
112       Locale locale
113     , final java.lang.String resourceName
114   )
115   {
116     if ( locale == null )
117     {
118       locale = Locale.getDefault();
119     }
120 
121     return new MessageFormat( this.getMessage(
122         "resourceNotAvailable", locale ), locale ).format(
123         new Object[]
124         {
125             resourceName,
126             null
127         } );
128 
129   }
130 
131   /**
132    * Gets a message for a given key and locale.
133    *
134    * @param key The key of the message to return.
135    * @param locale The locale of the message.
136    *
137    * @return Message for {@code key} using {@code locale}.
138    */
139   private String getMessage( final String key, Locale locale )
140   {
141     if ( locale == null )
142     {
143       locale = Locale.getDefault();
144     }
145 
146     return ResourceBundle.getBundle(
147         "org/jdtaus/core/container/ri/client/BootstrapEntityResolverBundle", locale ).
148         getString( key );
149 
150   }
151 }