View Javadoc

1   /*
2    * Copyright 2007-2013 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 de.smartics.exceptions.core.ExceptionContext;
19  import de.smartics.exceptions.i18n.message.MessageTemplate;
20  import de.smartics.messages.core.BundleProvider;
21  
22  /**
23   * Defines access to the resources required by the exception infrastructure.
24   */
25  public interface I18nExceptionContext extends ExceptionContext
26  {
27    // ********************************* Fields *********************************
28  
29    // --- constants ------------------------------------------------------------
30  
31    // ****************************** Inner Classes *****************************
32  
33    // ********************************* Methods ********************************
34  
35    // --- get&set --------------------------------------------------------------
36  
37    // --- business -------------------------------------------------------------
38  
39    /**
40     * Returns the bundle provider that helps to access resource bundles.
41     *
42     * @return the bundle provider that helps to access resource bundles.
43     */
44    BundleProvider getBundleProvider();
45  
46    /**
47     * Returns the implementation to use for the message composer.
48     *
49     * @return the implementation to use for the message composer.
50     */
51    MessageComposer getMessageComposer();
52  
53    /**
54     * Returns the identifier of a template to be used for rendering the exception
55     * information.
56     *
57     * @return the template identifier.
58     */
59    MessageTemplate getMessageTemplateId();
60  
61    /**
62     * Returns the formatter for code messages. Override to control the
63     * representation of exception and message bean instances.
64     *
65     * @return the formatter for code messages.
66     */
67    I18nCodeMessageFormatter getCodeMessageFormatter();
68  
69    // --- object basics --------------------------------------------------------
70  }