001 package org.apache.turbine.services.template.mapper;
002
003
004 /*
005 * Licensed to the Apache Software Foundation (ASF) under one
006 * or more contributor license agreements. See the NOTICE file
007 * distributed with this work for additional information
008 * regarding copyright ownership. The ASF licenses this file
009 * to you under the Apache License, Version 2.0 (the
010 * "License"); you may not use this file except in compliance
011 * with the License. You may obtain a copy of the License at
012 *
013 * http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing,
016 * software distributed under the License is distributed on an
017 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
018 * KIND, either express or implied. See the License for the
019 * specific language governing permissions and limitations
020 * under the License.
021 */
022
023
024 /**
025 * To separate out the various map and search policies for class
026 * names and template names, we use classes that implement this
027 * interface.
028 *
029 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
030 * @version $Id: Mapper.java 615328 2008-01-25 20:25:05Z tv $
031 */
032
033 public interface Mapper
034 {
035 /**
036 * Mapper initialization.
037 */
038 void init();
039
040 /**
041 * Get the CacheSize value.
042 * @return the CacheSize value.
043 */
044 int getCacheSize();
045
046 /**
047 * Set the CacheSize value.
048 * @param cacheSize The new CacheSize value.
049 */
050 void setCacheSize(int cacheSize);
051
052 /**
053 * Get the UseCache value.
054 * @return the UseCache value.
055 */
056 boolean isUseCache();
057
058 /**
059 * Set the UseCache value.
060 * @param newUseCache The new UseCache value.
061 */
062 void setUseCache(boolean useCache);
063
064 /**
065 * Get the DefaultProperty value.
066 * @return the DefaultProperty value.
067 */
068 String getDefaultProperty();
069
070 /**
071 * Set the DefaultProperty value.
072 * @param defaultProperty The new DefaultProperty value.
073 */
074 void setDefaultProperty(String defaultProperty);
075
076 /**
077 * Get the Separator value.
078 * @return the Separator value.
079 */
080 char getSeparator();
081
082 /**
083 * Set the Separator value.
084 * @param separator The new Separator value.
085 */
086 void setSeparator(char separator);
087
088
089 /**
090 * Returns the default name for the supplied template
091 * name. Must never return null.
092 *
093 * @param template The template name.
094 *
095 * @return The default name for this template.
096 */
097 String getDefaultName(String template);
098
099 /**
100 * Return the first match name for the given template name.
101 * This method might return null if no possible match can
102 * be found.
103 *
104 * @param template The template name.
105 *
106 * @return The first matching class or template name.
107 */
108 String getMappedName(String template);
109 }