1 25 32 33 package org.snipsnap.render.macro; 34 35 import org.radeox.macro.BaseMacro; 36 import org.radeox.macro.parameter.MacroParameter; 37 import org.radeox.util.i18n.ResourceManager; 38 39 import java.io.IOException ; 40 import java.io.Writer ; 41 42 public class AnnotationMacro extends BaseMacro { 43 public String getName() { 44 return "note"; 45 } 46 47 public String getDescription() { 48 return ResourceManager.getString("i18n.messages", "macro.annotation.description"); 49 } 50 51 public String [] getParamDescription() { 52 return ResourceManager.getString("i18n.messages", "macro.annotation.params").split(";"); 53 } 54 55 public void execute(Writer writer, MacroParameter params) 56 throws IllegalArgumentException , IOException { 57 if (params.getLength() == 1) { 58 writer.write("<footnote>"); 59 writer.write(params.get("0")); 60 writer.write("</footnote>"); 61 } else { 62 throw new IllegalArgumentException ("footnote needs exactly one argument"); 63 } 64 return; 65 } 66 } 67 | Popular Tags |