View Javadoc

1   /*
2    * Copyright 2007-2011 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.exceptions.i18n;
17  
18  import java.util.Locale;
19  
20  import de.smartics.exceptions.CoreException;
21  import de.smartics.exceptions.i18n.message.MessageType;
22  
23  /**
24   * Provides access to the localized exception implementations through a common
25   * interface.
26   *
27   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
28   * @version $Revision:591 $
29   */
30  public interface LocalizedException extends CoreException
31  {
32    // ********************************* Fields *********************************
33  
34    // --- constants ------------------------------------------------------------
35  
36    // ****************************** Initializer *******************************
37  
38    // ****************************** Inner Classes *****************************
39  
40    // ********************************* Methods ********************************
41  
42    // --- get&set --------------------------------------------------------------
43  
44    // --- business -------------------------------------------------------------
45  
46    /**
47     * Returns the message for the given message type and the system's default
48     * locale.
49     *
50     * @param messageType the type if message to return.
51     * @return the message for the given message type.
52     */
53    String getMessage(MessageType messageType);
54  
55    /**
56     * Returns the message for the given message type.
57     *
58     * @param locale the locale to select the localized message.
59     * @param messageType the type if message to return.
60     * @return the message for the given message type.
61     */
62    String getMessage(Locale locale, MessageType messageType);
63  
64    /**
65     * Returns the messages in one string. Useful to make a dump of all text
66     * information for all {@link MessageType message types} for debugging.
67     *
68     * @param locale the locale to use for the dump.
69     * @return a dump of all {@link MessageType types} of messages.
70     */
71    String getMessages(Locale locale);
72  
73    /**
74     * Returns the messages in one string. Useful to make a dump of all text
75     * information for all {@link MessageType message types} for debugging.
76     * <p>
77     * Uses the default locale to access the messages.
78     * </p>
79     *
80     * @return a dump of all {@link MessageType types} of messages.
81     */
82    String getMessages();
83  
84    // --- object basics --------------------------------------------------------
85  }