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.core.domain; 17 18 import java.io.Serializable; 19 import java.util.List; 20 import java.util.Locale; 21 22 /** 23 * Provides context information for a given property. 24 * <p> 25 * Where {@link PropertiesContext} provides context information for all 26 * properties that are of that context (i.e. loaded from the same archive), 27 * instances of this class provide convenient access to that context information 28 * by storing the key (i.e. the descriptor) for further requests. Clients are 29 * therefore only required to reference the property context instance and not 30 * the properties context instance together with the property descriptor. 31 * </p> 32 */ 33 public interface PropertyContext extends Serializable 34 { 35 // ********************************* Fields ********************************* 36 37 // --- constants ------------------------------------------------------------ 38 39 // ****************************** Initializer ******************************* 40 41 // ****************************** Inner Classes ***************************** 42 43 // ********************************* Methods ******************************** 44 45 // --- get&set -------------------------------------------------------------- 46 47 /** 48 * Returns the context of the properties. 49 * 50 * @return the context of the properties. 51 */ 52 PropertiesContext getPropertiesContext(); 53 54 /** 55 * Returns the URL to the home page of the project. 56 * 57 * @return the URL to the home page of the project. 58 */ 59 String getHomePageUrl(); 60 61 /** 62 * Returns the URL to the home page of the project in the given locale. 63 * Returns a default URL, if the given locale is not supported. 64 * 65 * @param locale the identifier of the requested localized resource. 66 * @return the URL to the home page of the project. 67 */ 68 String getHomePageUrl(Locale locale); 69 70 /** 71 * Returns the URL to the index document of properties reports. 72 * 73 * @return the URL to the index document of properties reports. 74 */ 75 String getPropertiesReportIndexUrl(); 76 77 /** 78 * Returns the URL to the index document of properties reports. 79 * 80 * @param locale the identifier of the requested localized resource. 81 * @return the URL to the index document of properties reports. 82 */ 83 String getPropertiesReportIndexUrl(Locale locale); 84 85 /** 86 * Returns the URL to the root directory of properties reports. 87 * 88 * @return the URL to the root directory of properties reports. 89 */ 90 String getPropertiesReportUrl(); 91 92 /** 93 * Returns the URL to the root directory of properties reports. 94 * 95 * @param locale the identifier of the requested localized resource. 96 * @return the URL to the root directory of properties reports. 97 */ 98 String getPropertiesReportUrl(Locale locale); 99 100 /** 101 * Returns the URL to the report documentation for the given descriptor. 102 * 103 * @return the absolute URL to the report. 104 */ 105 String getPropertyReportUrl(); 106 107 /** 108 * Returns the URL to the report documentation for the given descriptor. 109 * 110 * @param locale the identifier of the requested localized resource. 111 * @return the absolute URL to the report. 112 */ 113 String getPropertyReportUrl(Locale locale); 114 115 /** 116 * Returns the list of supported locales. The list contains locales the 117 * context provides localized information for. 118 * 119 * @return the list of supported locales. 120 */ 121 List<Locale> getSupportedLocales(); 122 123 // --- business ------------------------------------------------------------- 124 125 // --- object basics -------------------------------------------------------- 126 127 }