View Javadoc

1   package org.apache.turbine.services.template.mapper;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  /***
23   * To separate out the various map and search policies for class
24   * names and template names, we use classes that implement this
25   * interface.
26   *
27   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
28   * @version $Id: Mapper.java 534527 2007-05-02 16:10:59Z tv $
29   */
30  
31  public interface Mapper
32  {
33      /***
34       * Mapper initialization.
35       */
36      void init();
37  
38      /***
39       * Get the CacheSize value.
40       * @return the CacheSize value.
41       */
42      int getCacheSize();
43  
44      /***
45       * Set the CacheSize value.
46       * @param cacheSize The new CacheSize value.
47       */
48      void setCacheSize(int cacheSize);
49  
50      /***
51       * Get the UseCache value.
52       * @return the UseCache value.
53       */
54      boolean isUseCache();
55  
56      /***
57       * Set the UseCache value.
58       * @param newUseCache The new UseCache value.
59       */
60      void setUseCache(boolean useCache);
61  
62      /***
63       * Get the DefaultProperty value.
64       * @return the DefaultProperty value.
65       */
66      String getDefaultProperty();
67  
68      /***
69       * Set the DefaultProperty value.
70       * @param defaultProperty The new DefaultProperty value.
71       */
72      void setDefaultProperty(String defaultProperty);
73  
74      /***
75       * Get the Separator value.
76       * @return the Separator value.
77       */
78      char getSeparator();
79  
80      /***
81       * Set the Separator value.
82       * @param separator The new Separator value.
83       */
84      void setSeparator(char separator);
85  
86  
87      /***
88       * Returns the default name for the supplied template
89       * name. Must never return null.
90       *
91       * @param template The template name.
92       *
93       * @return The default name for this template.
94       */
95      String getDefaultName(String template);
96  
97      /***
98       * Return the first match name for the given template name.
99       * This method might return null if no possible match can
100      * be found.
101      *
102      * @param template The template name.
103      *
104      * @return The first matching class or template name.
105      */
106     String getMappedName(String template);
107 }