View Javadoc

1   /*
2    * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedError.java,v 1.1 2004/10/04 13:41:09 dflorey Exp $
3    * $Revision: 1.1 $
4    * $Date: 2004-10-04 15:41:11 +0200 (Mo, 04 Okt 2004) $
5    *
6    * ====================================================================
7    *
8    * Copyright 2004 The Apache Software Foundation 
9    *
10   * Licensed under the Apache License, Version 2.0 (the "License");
11   * you may not use this file except in compliance with the License.
12   * You may obtain a copy of the License at
13   *
14   *     http://www.apache.org/licenses/LICENSE-2.0
15   *
16   * Unless required by applicable law or agreed to in writing, software
17   * distributed under the License is distributed on an "AS IS" BASIS,
18   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19   * See the License for the specific language governing permissions and
20   * limitations under the License.
21   *
22   */
23  package org.apache.commons.i18n;
24  
25  import java.util.Locale;
26  
27  public class LocalizedError extends LocalizedMessage {
28      private final static String SUMMARY = "summary";
29      private final static String DETAILS = "details";
30  
31      public LocalizedError(String messageId) {
32          super(messageId);
33      }
34  
35      public LocalizedError(String messageId, Object[] arguments) {
36          super(messageId, arguments);
37      }
38  
39      public String getSummary() throws MessageNotFoundException {
40          return getText(SUMMARY, Locale.getDefault());
41      }
42  
43      public String getSummary(Locale locale) throws MessageNotFoundException {
44          return getText(SUMMARY, locale);
45      }
46  
47      public String getSummary(String defaultSummary) {
48          return getText(SUMMARY, defaultSummary, Locale.getDefault());
49      }
50  
51      public String getSummary(Locale locale, String defaultSummary) {
52          return getText(SUMMARY, defaultSummary, locale);
53      }
54  
55      public String getDetails() throws MessageNotFoundException {
56          return getText(DETAILS, Locale.getDefault());
57      }
58  
59      public String getDetails(Locale locale) throws MessageNotFoundException {
60          return getText(DETAILS, locale);
61      }
62  
63      public String getDetails(String defaultDetails) {
64          return getText(DETAILS, defaultDetails, Locale.getDefault());
65      }
66  
67      public String getDetails(Locale locale, String defaultDetails) {
68          return getText(DETAILS, defaultDetails, locale);
69      }
70  }