1 25 26 package org.snipsnap.render.macro; 27 28 import org.radeox.macro.parameter.MacroParameter; 29 import org.radeox.macro.Macro; 30 import org.radeox.macro.BaseMacro; 31 import org.snipsnap.render.macro.parameter.SnipMacroParameter; 32 33 import java.io.IOException ; 34 import java.io.Writer ; 35 36 44 45 public abstract class SnipMacro extends BaseMacro { 46 public abstract void execute(Writer writer, SnipMacroParameter params) throws IllegalArgumentException , IOException ; 47 48 public void execute(Writer writer, MacroParameter params) throws IllegalArgumentException , IOException { 49 if (params instanceof SnipMacroParameter) { 50 execute(writer, (SnipMacroParameter) params); 51 return; 52 } else { 53 throw new IllegalArgumentException ("Macro must be called in a SnipSnap enviroment."); 54 } 55 } 56 } 57 58 | Popular Tags |