View Javadoc
1   package org.apache.turbine.modules;
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  import org.apache.turbine.pipeline.PipelineData;
23  
24  /**
25   * This is the interface that defines what a Navigation module is.
26   *
27   * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
28   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
29   * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a>
30   * @version $Id$
31   */
32  @FunctionalInterface
33  public interface Navigation extends Assembler
34  {
35      /** Prefix for navigation related classes and templates */
36      String PREFIX = "navigations";
37  
38      /** Property for the size of the navigation cache if caching is on */
39      String CACHE_SIZE_KEY = "navigation.cache.size";
40  
41      /** The default size for the navigation cache */
42      int CACHE_SIZE_DEFAULT = 10;
43  
44      /** Represents Navigation Objects */
45      String NAME = "navigation";
46  
47      /**
48       * A subclass must implement this method to build itself.
49       * Subclasses override this method to store the navigation in
50       * RunData or to write the navigation to the output stream
51       * referenced in RunData.
52       *
53       * @param pipelineData Turbine information.
54       * @return the content of the navigation module
55       * @throws Exception a generic exception.
56       */
57      String doBuild(PipelineData pipelineData) throws Exception;
58  
59      /**
60       * Subclasses can override this method to add additional
61       * functionality.
62       *
63       * @param pipelineData Turbine information.
64       * @return the content of the navigation module
65       * @throws Exception a generic exception.
66       */
67      default String build(PipelineData pipelineData)
68          throws Exception
69      {
70          return doBuild(pipelineData);
71      }
72  }