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 test.de.smartics.properties.spi.config.support;
17  
18  import java.io.Serializable;
19  
20  import de.smartics.properties.api.config.domain.ConfigurationValidationException;
21  import de.smartics.properties.api.config.domain.Property;
22  import de.smartics.properties.api.config.domain.ResolvedProperty;
23  import de.smartics.properties.api.config.domain.SerializableConfigurationProperties;
24  import de.smartics.properties.api.config.domain.UnknownPropertyException;
25  import de.smartics.properties.api.config.domain.key.ConfigurationKey;
26  import de.smartics.properties.api.core.domain.PropertyDescriptor;
27  import de.smartics.properties.api.core.domain.PropertyDescriptorRegistry;
28  import de.smartics.properties.api.core.domain.PropertyValidationException;
29  import de.smartics.properties.spi.config.support.AbstractConfigurationProperties;
30  import de.smartics.util.lang.NullArgumentException;
31  
32  /**
33   * Used to test serializability of {@link AbstractConfigurationProperties}.
34   */
35  public class DummyConfigurationProperties extends
36      AbstractConfigurationProperties implements Serializable,
37      SerializableConfigurationProperties
38  {
39    // ********************************* Fields *********************************
40  
41    // --- constants ------------------------------------------------------------
42  
43    /**
44     * The class version identifier.
45     */
46    private static final long serialVersionUID = 1L;
47  
48    // --- members --------------------------------------------------------------
49  
50    // ****************************** Initializer *******************************
51  
52    // ****************************** Constructors ******************************
53  
54    /**
55     * Default constructor.
56     *
57     * @param key the key that identifies the configuration.
58     * @param registry the registry to resolve property descriptors.
59     * @throws NullArgumentException if {@code key} or {@code registry} is
60     *           <code>null</code>.
61     */
62    public DummyConfigurationProperties(final ConfigurationKey key,
63        final PropertyDescriptorRegistry registry) throws NullArgumentException
64    {
65      super(key, registry);
66    }
67  
68    // ****************************** Inner Classes *****************************
69  
70    // ********************************* Methods ********************************
71  
72    // --- init -----------------------------------------------------------------
73  
74    // --- get&set --------------------------------------------------------------
75  
76    // --- business -------------------------------------------------------------
77  
78    @Override
79    public ResolvedProperty getResolvedProperty(
80        final PropertyDescriptor descriptor, final Object defaultValue)
81      throws IllegalArgumentException, UnknownPropertyException,
82      PropertyValidationException
83    {
84      return null;
85    }
86  
87    @Override
88    public void validate(final boolean lenient)
89      throws ConfigurationValidationException
90    {
91    }
92  
93    @Override
94    public SerializableConfigurationProperties toSerializable()
95    {
96      return this;
97    }
98  
99    @Override
100   public Property getProperty(final PropertyDescriptor descriptor,
101       final Object defaultValue) throws NullPointerException,
102     UnknownPropertyException
103   {
104     return null;
105   }
106 
107   // --- object basics --------------------------------------------------------
108 
109 }