001package com.monochromeroad.grails.plugins.xwiki.macro; 002 003import org.xwiki.rendering.block.Block; 004import org.xwiki.rendering.macro.MacroExecutionException; 005import org.xwiki.rendering.transformation.MacroTransformationContext; 006 007import java.util.List; 008 009/** 010 * XWiki no-parameter macro (e.g. {{date /}}) base to use in Grails. 011 * 012 * <p>You need to create a constructor that takes no arguments.</p> 013 * 014 * @author Masatoshi Hayashi 015 */ 016public abstract class DefaultXWikiNoParameterMacro extends DefaultXWikiMacro<Object> { 017 public DefaultXWikiNoParameterMacro(String name) { 018 super(name, Object.class); 019 } 020 021 public final List<Block> execute( 022 Object parameters, String content, MacroTransformationContext context) throws MacroExecutionException { 023 return execute(content, context); 024 } 025 026 protected abstract List<Block> execute( 027 String content, MacroTransformationContext context) throws MacroExecutionException; 028}