1 25 26 27 package org.snipsnap.render.macro; 28 29 import org.radeox.macro.Macro; 30 import org.radeox.macro.BaseMacro; 31 import org.radeox.macro.parameter.MacroParameter; 32 import org.radeox.util.i18n.ResourceManager; 33 import org.snipsnap.app.Application; 34 35 import java.io.IOException ; 36 import java.io.Writer ; 37 38 44 45 public class VersionMacro extends BaseMacro { 46 private String version; 47 public VersionMacro() { 48 version = Application.get().getConfiguration().getVersion(); 49 } 50 51 public String getDescription() { 52 return ResourceManager.getString("i18n.messages", "macro.version.description"); 53 } 54 55 public String getName() { 56 return "version"; 57 } 58 59 public void execute(Writer writer, MacroParameter params) 60 throws IllegalArgumentException , IOException { 61 if (params.getLength() == 0) { 62 writer.write(version); 63 } else { 64 throw new IllegalArgumentException ("Number of arguments does not match"); 65 } 66 } 67 } 68 | Popular Tags |