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.spi.config.domain.key;
17  
18  import java.io.Serializable;
19  
20  import de.smartics.properties.api.config.domain.key.ConfigurationKey;
21  
22  /**
23   * Allows to match resource identifiers, usually pathes to properties files
24   * within an archive, to map them to a configuration key.
25   */
26  public interface PropertiesResourceMatcher extends Serializable
27  {
28    // ********************************* Fields *********************************
29  
30    // --- constants ------------------------------------------------------------
31  
32    // ****************************** Initializer *******************************
33  
34    // ****************************** Inner Classes *****************************
35  
36    // ********************************* Methods ********************************
37  
38    // --- get&set --------------------------------------------------------------
39  
40    /**
41     * Returns the configuration key the matcher is responsible for.
42     *
43     * @return the configuration key the matcher is responsible for.
44     */
45    ConfigurationKey<?> getConfigurationKey();
46  
47    // --- business -------------------------------------------------------------
48  
49    /**
50     * Matches the identifier with the matchers algorithm.
51     *
52     * @param id the identifier of the resource.
53     * @return <code>true</code> if the matcher matches the {@code id},
54     *         <code>false</code> otherwise.
55     */
56    boolean match(String id);
57  
58    // --- object basics --------------------------------------------------------
59  
60  }