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.tutorial.onestringproperty;
17  
18  import de.smartics.properties.api.core.annotations.PropertySet;
19  
20  /**
21   * Defines simple application properties as an example.
22   * <p/>
23   * {@insertCode}
24   * <p>
25   * The property set is named <code>app</code>. It contains a simple
26   * {@link String} property with name {@link #host() host}. To define the host
27   * property, the name of the property set has to be set as a prefix.
28   * </p>
29   * <source> app.host=value </source> <div class="note">
30   * <p>
31   * If no value for the <code>@PropertySet</code> annotation is provided, the
32   * fully qualified name of the annotated interface is used as a default. If no
33   * prefix is requested, provide the empty string (<code>""</code>) as the value.
34   * </p>
35   *
36   * <pre class="source">
37   * @PropertySet(value = "")
38   * public interface ApplicationProperties {
39   *   ...
40   * }
41   * </pre>
42   *
43   * </div>
44   */
45  @PropertySet(value = "app")
46  public interface ApplicationProperties
47  {
48    String host();
49  }
50  
51  // Tutorial: The first sentence of a type should be used as a label to the code.
52  //           Therefore the <p/> is necessary to start the chapter.