org.radeox.macro
Class BaseMacro

java.lang.Object
  |
  +--org.radeox.macro.BaseMacro
All Implemented Interfaces:
java.lang.Comparable, Macro
Direct Known Subclasses:
BaseLocaleMacro, HelloWorldMacro, Preserved

public abstract class BaseMacro
extends java.lang.Object
implements Macro


Field Summary
protected  java.lang.String description
           
protected  java.lang.String[] paramDescription
           
 
Constructor Summary
BaseMacro()
           
 
Method Summary
 int compareTo(java.lang.Object object)
           
abstract  void execute(java.io.Writer writer, MacroParameter params)
          Execute the macro.
 java.lang.String getDescription()
          Get a description of the macro.
abstract  java.lang.String getName()
          Get the name of the macro.
 java.lang.String[] getParamDescription()
          Get a description of the paramters of the macro.
 void setInitialContext(InitialRenderContext context)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

description

protected java.lang.String description

paramDescription

protected java.lang.String[] paramDescription
Constructor Detail

BaseMacro

public BaseMacro()
Method Detail

getName

public abstract java.lang.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:
getName in interface Macro
Returns:
name Name of the Macro

getDescription

public java.lang.String getDescription()
Get a description of the macro. This description explains in a short way what the macro does

Specified by:
getDescription in interface Macro
Returns:
description A string describing the macro

getParamDescription

public java.lang.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:
getParamDescription in interface Macro
Returns:
description Array describing the parameters of the macro

setInitialContext

public void setInitialContext(InitialRenderContext context)
Specified by:
setInitialContext in interface Macro

execute

public abstract void execute(java.io.Writer writer,
                             MacroParameter params)
                      throws java.lang.IllegalArgumentException,
                             java.io.IOException
Execute the macro. This method is called by MacroFilter to handle macros.

Specified by:
execute in interface Macro
Parameters:
writer - A write where the macro should write its output to
params - Macro parameters with the parameters the macro is called with
java.lang.IllegalArgumentException
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object object)
Specified by:
compareTo in interface java.lang.Comparable


Copyright © 2003 Matthias L. Jugel, Stephan J. Schmidt. All Rights Reserved.