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.at.classpath;
17  
18  import java.net.URL;
19  import java.util.List;
20  
21  import org.hibernate.validator.constraints.NotBlank;
22  
23  import de.smartics.properties.api.core.annotations.AccessType;
24  import de.smartics.properties.api.core.annotations.PropertyElementType;
25  import de.smartics.properties.api.core.annotations.PropertyLifecycle;
26  import de.smartics.properties.api.core.annotations.PropertySet;
27  import de.smartics.properties.api.core.domain.PropertyDescriptor;
28  import de.smartics.properties.api.core.domain.PropertyKey;
29  
30  /**
31   * Provides sample application properties.
32   */
33  @PropertySet("app")
34  public interface ApplicationProperties
35  {
36    /**
37     * The URL to the application to be used from within the application.
38     *
39     * @return the URL to the application to be used from within the application.
40     */
41    @NotBlank
42    @PropertySet("app.server")
43    @PropertyLifecycle(access = AccessType.READ_WRITE)
44    String url();
45  
46    /**
47     * The property key for the {@link #url()} property.
48     *
49     * @return the property key for the {@link #url()} property.
50     */
51    PropertyKey getUrlPropertyKey();
52  
53    /**
54     * The domain the application is assigned to.
55     *
56     * @return the domain the application is assigned to.
57     */
58    @NotBlank
59    String domain();
60  
61    /**
62     * The URL to the application to be used from within the application.
63     *
64     * @return the URL to the application to be used from within the application.
65     */
66    URL homePage();
67  
68    /**
69     * The property key for the {@link #homePage()} property.
70     *
71     * @return the property key for the {@link #homePage()} property.
72     */
73    PropertyKey getHomePagePropertyKey();
74  
75    /**
76     * The property descriptor for the {@link #homePage()} property.
77     *
78     * @return the property descriptor for the {@link #homePage()} property.
79     */
80    PropertyDescriptor getHomePagePropertyDescriptor();
81  
82    /**
83     * A list of optional additional URLs.
84     *
85     * @return list of optional additional URLs.
86     */
87    @PropertyElementType(URL.class)
88    List<URL> additionalUrls();
89  }