Package org.radeox.macro
Class BaseMacro
- java.lang.Object
-
- org.radeox.macro.BaseMacro
-
- All Implemented Interfaces:
Comparable,org.radeox.api.macro.Macro
- Direct Known Subclasses:
BaseLocaleMacro,HelloWorldMacro,Preserved
public abstract class BaseMacro extends Object implements org.radeox.api.macro.Macro
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringdescriptionprotected org.radeox.api.engine.context.InitialRenderContextinitialContextprotected String[]paramDescription
-
Constructor Summary
Constructors Constructor Description BaseMacro()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object object)abstract voidexecute(Writer writer, org.radeox.api.macro.MacroParameter params)Execute the macro.StringgetDescription()Get a description of the macro.abstract StringgetName()Get the name of the macro.String[]getParamDescription()Get a description of the paramters of the macro.voidsetInitialContext(org.radeox.api.engine.context.InitialRenderContext context)StringtoString()
-
-
-
Method Detail
-
getName
public abstract String getName()
Get the name of the macro. This is used to map a macro in the input to the macro which should be called. The method has to be implemented by subclassing classes.- Specified by:
getNamein interfaceorg.radeox.api.macro.Macro- Returns:
- name Name of the Macro
-
getDescription
public String getDescription()
Get a description of the macro. This description explains in a short way what the macro does- Specified by:
getDescriptionin interfaceorg.radeox.api.macro.Macro- Returns:
- description A string describing the macro
-
getParamDescription
public String[] getParamDescription()
Get a description of the paramters of the macro. The method returns an array with an String entry for every parameter. The format is {"1: description", ...} where 1 is the position of the parameter.- Specified by:
getParamDescriptionin interfaceorg.radeox.api.macro.Macro- Returns:
- description Array describing the parameters of the macro
-
setInitialContext
public void setInitialContext(org.radeox.api.engine.context.InitialRenderContext context)
- Specified by:
setInitialContextin interfaceorg.radeox.api.macro.Macro
-
execute
public abstract void execute(Writer writer, org.radeox.api.macro.MacroParameter params) throws IllegalArgumentException, IOException
Execute the macro. This method is called by MacroFilter to handle macros.- Specified by:
executein interfaceorg.radeox.api.macro.Macro- Parameters:
writer- A write where the macro should write its output toparams- Macro parameters with the parameters the macro is called with- Throws:
IllegalArgumentExceptionIOException
-
compareTo
public int compareTo(Object object)
- Specified by:
compareToin interfaceComparable
-
-