1 /* 2 * This file is part of Pease Plate Template Engine. 3 * 4 * Pease Plate Template Engine is free software: you can redistribute 5 * it and/or modify it under the terms of the GNU Lesser General 6 * Public License as published by the Free Software Foundation, 7 * either version 3 of the License, or any later version. 8 * 9 * Pease Plate Template Engine is distributed in the hope that it 10 * will be useful, but WITHOUT ANY WARRANTY; without even the implied 11 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 * See the GNU Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with Pease Plate Template Engine. If not, see 16 * <http://www.gnu.org/licenses/>. 17 * 18 * Copyright (c) 2008 Manfred HANTSCHEL 19 */ 20 package org.peaseplate.chunk; 21 22 import java.io.IOException; 23 import java.io.Writer; 24 25 import org.peaseplate.TemplateException; 26 import org.peaseplate.internal.BuildContext; 27 28 29 /** 30 * A block head is a chunk that contains a separated chain of chunks as so-called block. 31 * 32 * @author Manfred HANTSCHEL 33 */ 34 public interface BlockHead extends Chunk { 35 36 /** 37 * Returns the head of the sub block chain. 38 * @return the head of the block 39 */ 40 public Chunk[] getBlock(); 41 42 public void setBlock(Chunk[] block) throws TemplateException; 43 44 /** 45 * Renders the sub block to the specified writer using the specified 46 * template context 47 * @param context the context 48 * @param writer the writer 49 * @throws TemplateException on occasion 50 * @throws IOException on occasion 51 */ 52 public void renderBlock(BuildContext context, Writer writer) throws TemplateException, IOException; 53 54 }