pmp
Class MacroChain

java.lang.Object
  extended by pmp.AbstractMacro
      extended by pmp.MacroChain

public final class MacroChain
extends AbstractMacro

Defines macro with assigned output encoder.

This class encapsulates two macros. macro is invoked using given arguments and outputEncoder is called with output from macro as first parameter. Result of outputEncoder is returned.

This class is used by builtin when called with three parameters

Title: PMP: Macroprocessor

Description: Java macroprocessor

Copyright: Copyright (c) 2005

Version:
1.0
Author:
Luděk Hlaváček

Field Summary
 
Fields inherited from class pmp.AbstractMacro
PARAMS_REQUIRED
 
Constructor Summary
MacroChain(AbstractMacro macro, AbstractMacro outputEncoder)
           
 
Method Summary
 AbstractMacro getMacro()
           
 AbstractMacro getOutputEncoder()
           
 java.lang.String run(Macroprocessor mp, java.lang.String[] args)
          Main method of macro.
 
Methods inherited from class pmp.AbstractMacro
getRequiredParams, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MacroChain

public MacroChain(AbstractMacro macro,
                  AbstractMacro outputEncoder)
Method Detail

getMacro

public AbstractMacro getMacro()

getOutputEncoder

public AbstractMacro getOutputEncoder()

run

public java.lang.String run(Macroprocessor mp,
                            java.lang.String[] args)
Description copied from class: AbstractMacro
Main method of macro. This method is called when this macro is invoked. All subclasses must imlement this method

Specified by:
run in class AbstractMacro
Parameters:
mp - reference to Macroprocessor
args - parameters of macro. In args[0] is stored name of macro. Subclasses are free to modify this array.
Returns:
result of the macro as String