001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     bstefanescu
011 *
012 * $Id$
013 */
014
015package org.nuxeo.ecm.platform.rendering.fm.extensions;
016
017import java.io.IOException;
018import java.util.Map;
019
020import freemarker.core.Environment;
021import freemarker.template.TemplateDirectiveBody;
022import freemarker.template.TemplateDirectiveModel;
023import freemarker.template.TemplateException;
024import freemarker.template.TemplateModel;
025import freemarker.template.TemplateModelException;
026
027/**
028 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
029 */
030public class SuperBlockDirective implements TemplateDirectiveModel {
031
032    @Override
033    @SuppressWarnings("rawtypes")
034    public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body)
035            throws TemplateException, IOException {
036
037        if (body != null) {
038            throw new TemplateModelException("Didn't expect a body");
039        }
040
041        BlockWriter writer = (BlockWriter) env.getOut();
042        writer.writeSuperBlock();
043    }
044
045}