001package org.apache.turbine.modules; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import org.apache.turbine.pipeline.PipelineData; 023 024/** 025 * This is the interface that defines what a Navigation module is. 026 * 027 * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a> 028 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a> 029 * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a> 030 * @version $Id$ 031 */ 032@FunctionalInterface 033public interface Navigation extends Assembler 034{ 035 /** Prefix for navigation related classes and templates */ 036 String PREFIX = "navigations"; 037 038 /** Property for the size of the navigation cache if caching is on */ 039 String CACHE_SIZE_KEY = "navigation.cache.size"; 040 041 /** The default size for the navigation cache */ 042 int CACHE_SIZE_DEFAULT = 10; 043 044 /** Represents Navigation Objects */ 045 String NAME = "navigation"; 046 047 /** 048 * A subclass must implement this method to build itself. 049 * Subclasses override this method to store the navigation in 050 * RunData or to write the navigation to the output stream 051 * referenced in RunData. 052 * 053 * @param pipelineData Turbine information. 054 * @return the content of the navigation module 055 * @throws Exception a generic exception. 056 */ 057 String doBuild(PipelineData pipelineData) throws Exception; 058 059 /** 060 * Subclasses can override this method to add additional 061 * functionality. 062 * 063 * @param pipelineData Turbine information. 064 * @return the content of the navigation module 065 * @throws Exception a generic exception. 066 */ 067 default String build(PipelineData pipelineData) 068 throws Exception 069 { 070 return doBuild(pipelineData); 071 } 072}