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 Layout module is. 026 * 027 * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a> 028 * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a> 029 * @version $Id$ 030 */ 031@FunctionalInterface 032public interface Layout extends Assembler 033{ 034 /** Prefix for layout related classes and templates */ 035 String PREFIX = "layouts"; 036 037 /** Property for the size of the layout cache if caching is on */ 038 String CACHE_SIZE_KEY = "layout.cache.size"; 039 040 /** The default size for the layout cache */ 041 int CACHE_SIZE_DEFAULT = 10; 042 043 /** Represents Layout Objects */ 044 String NAME = "layout"; 045 046 /** 047 * A subclass must implement this method to perform itself. The 048 * Action can also set the screen that is associated with PipelineData. 049 * @param pipelineData Turbine information. 050 * @throws Exception a generic exception. 051 */ 052 void doBuild(PipelineData pipelineData) throws Exception; 053 054 /** 055 * Subclasses can override this method to add additional 056 * functionality. 057 * 058 * @param pipelineData Turbine information. 059 * @throws Exception a generic exception. 060 */ 061 default void build(PipelineData pipelineData) throws Exception 062 { 063 doBuild(pipelineData); 064 } 065}