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.api.config.domain;
17  
18  import de.smartics.exceptions.i18n.message.MessageParam;
19  import de.smartics.properties.api.core.domain.PropertyExpressionMessageBean;
20  import de.smartics.properties.api.core.domain.PropertyValueResolveException;
21  
22  /**
23   * Provides information about property resolving problems including the source
24   * location.
25   */
26  public class PropertyExpressionWithSourceMessageBean extends
27      PropertyExpressionMessageBean
28  {
29    // ********************************* Fields *********************************
30  
31    // --- constants ------------------------------------------------------------
32  
33    /**
34     * The class version identifier.
35     */
36    private static final long serialVersionUID = 1L;
37  
38    // --- members --------------------------------------------------------------
39  
40    /**
41     * The source where the property value has been defined.
42     *
43     * @serial
44     */
45    @MessageParam
46    private final PropertyLocation source; // NOPMD
47  
48    // ****************************** Initializer *******************************
49  
50    // ****************************** Constructors ******************************
51  
52    /**
53     * Default constructor.
54     *
55     * @param original the original property validation exception without the
56     *          origin information.
57     * @param source the source where the property value has been defined.
58     */
59    public PropertyExpressionWithSourceMessageBean(
60        final PropertyValueResolveException original,
61        final PropertyLocation source)
62    {
63      super(ConfigurationCode.INVALID_CONFIGURATION_DUE_TO_RESOLVE_WITH_SOURCE,
64          original.getCause(), original.getMessageBean().getPropertyDescriptor(),
65          original.getMessageBean().getExpression());
66      this.source = source;
67    }
68  
69    // ****************************** Inner Classes *****************************
70  
71    // ********************************* Methods ********************************
72  
73    // --- init -----------------------------------------------------------------
74  
75    // --- get&set --------------------------------------------------------------
76  
77    // --- business -------------------------------------------------------------
78  
79    // --- object basics --------------------------------------------------------
80  
81  }