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.message;
17  
18  
19  /**
20   * Defines the valid identifiers for message templates.
21   * <p>
22   * Templates are selected to control the rendering of the exception information.
23   * Currently this mechanism is rather crude since the template selects an
24   * implementation during the rendering. In future version a real template should
25   * be supported. That template will contain text that is adorned with
26   * placeholders that will be replaced by concrete messages.
27   * </p>
28   *
29   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
30   * @version $Revision$
31   */
32  public enum MessageTemplate
33  {
34    // ****************************** Enumeration *******************************
35  
36    /**
37     * The message's title, summary, and details are rendered in one line.
38     */
39    SINGLE_LINE_STANDARD("singleLine.standard"),
40  
41    /**
42     * The message summary is rendered in one line.
43     */
44    SINGLE_LINE_SUMMARY_ONLY("singleLine.summaryOnly"),
45  
46    /**
47     * Everything is rendered in a multi-line text.
48     */
49    MULTI_LINE_ALL("multiLine.all");
50  
51    // ********************************* Fields *********************************
52  
53    // --- constants ------------------------------------------------------------
54  
55    // --- members --------------------------------------------------------------
56  
57    /**
58     * The identifier of the template.
59     *
60     * @serial
61     */
62    private final String templateId;
63  
64    // ****************************** Constructors ******************************
65  
66    /**
67     * Constructor.
68     *
69     * @param templateId the identifier of the template.
70     * @see
71     */
72    private MessageTemplate(final String templateId)
73    {
74      this.templateId = templateId;
75    }
76  
77    // ********************************* Methods ********************************
78  
79    // --- init -----------------------------------------------------------------
80  
81    // --- get&set --------------------------------------------------------------
82  
83    /**
84     * Returns the identifier of the template.
85     *
86     * @return the identifier of the template.
87     */
88    public String getTemplateId()
89    {
90      return this.templateId;
91    }
92  
93    // --- business -------------------------------------------------------------
94  
95    // --- object basics --------------------------------------------------------
96  
97  }