View Javadoc

1   /*
2    * Copyright 2012-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.properties.spi.config.transfer;
17  
18  import de.smartics.exceptions.i18n.message.MessageParam;
19  import de.smartics.properties.api.core.app.AbstractBaseMessageBean;
20  import de.smartics.properties.api.core.domain.PropertiesContext;
21  
22  /**
23   * Provides information to signal that there is no configuration key for a given
24   * properties file.
25   */
26  public final class NoConfigurationKeyForPropertiesMessageBean extends
27      AbstractBaseMessageBean implements TransferMessageBean
28  {
29    // ********************************* Fields *********************************
30  
31    // --- constants ------------------------------------------------------------
32  
33    /**
34     * The class version identifier.
35     * <p>
36     * The value of this constant is {@value}.
37     * </p>
38     */
39    private static final long serialVersionUID = 1L;
40  
41    // --- members --------------------------------------------------------------
42  
43    /**
44     * The name of the properties file for which no configuration key could be
45     * determined.
46     *
47     * @serial
48     */
49    @MessageParam
50    private final String propertiesFile; // NOPMD
51  
52    /**
53     * The {@code definition.xml} within an archive that contains the key
54     * information that maps properties files to a configuration key.
55     *
56     * @serial
57     */
58    @MessageParam
59    private final String definitionXml = PropertiesContext.DEFINITION_FILE;
60  
61    // ****************************** Initializer *******************************
62  
63    // ****************************** Constructors ******************************
64  
65    /**
66     * Constructor without cause.
67     *
68     * @param propertiesFile the name of the properties file for which no
69     *          configuration key could be determined.
70     */
71    public NoConfigurationKeyForPropertiesMessageBean(final String propertiesFile)
72    {
73      this(null, propertiesFile);
74    }
75  
76    /**
77     * Default constructor.
78     *
79     * @param cause the cause to the problem.
80     * @param propertiesFile the name of the properties file for which no
81     *          configuration key could be determined.
82     */
83    public NoConfigurationKeyForPropertiesMessageBean(final Throwable cause,
84        final String propertiesFile)
85    {
86      super(TransferCode.NO_CONFIG_KEY_FOR_PROPERTIES, cause);
87      this.propertiesFile = propertiesFile;
88    }
89  
90    // ****************************** Inner Classes *****************************
91  
92    // ********************************* Methods ********************************
93  
94    // --- init -----------------------------------------------------------------
95  
96    // --- factory --------------------------------------------------------------
97  
98    // --- get&set --------------------------------------------------------------
99  
100   // --- business -------------------------------------------------------------
101 
102   // --- object basics --------------------------------------------------------
103 
104 }