com.ibm.wbi
Class Editor

com.ibm.wbi.Meg
  |
  +--com.ibm.wbi.Editor
Direct Known Subclasses:
ErrorPageEditor, HttpEditor

public abstract class Editor
extends Meg

An Editor is used to manipulate the content provided by either a Generator or an another Editor preceding it in the Meg chain. The determination of the order of Editors is a function of the condition and priority characteristics set on the Editor. Methods exist to add Monitors to "monitor" the output of the Editor.


Fields inherited from class com.ibm.wbi.Meg
COPYRIGHT, EDITOR, GENERATOR, MONITOR, REQUEST_EDITOR, UNDEFINED
 
Constructor Summary
Editor()
          Constructs a new Editor with default characteristics and is enabled.
Editor(java.lang.String name, java.lang.String condition, int priority)
          Constructs a new Editor with the specified characteristics and is enabled.
Editor(java.lang.String name, java.lang.String condition, int priority, boolean enabled)
          Constructs a new Editor with the specified characteristics.
 
Method Summary
 int getType()
          Get the Meg type associated with an Editor.
abstract  void handleRequest(RequestEvent event)
          Handle the specified RequestEvent for a request which statisifies the Editors condition.
 
Methods inherited from class com.ibm.wbi.Meg
forwardRequest, getCondition, getEnabled, getMegProperty, getMegProperty, getMegPropertyKeys, getName, getPlugin, getPriority, getSystemContext, initialize, initialize, isEnabled, isMegApplicable, loadMegResources, run, setCondition, setEnabled, setMegProperty, setName, setPriority, setSystemContext, setup, setup, setup, setup
 

Constructor Detail

Editor

public Editor()
Constructs a new Editor with default characteristics and is enabled.

Editor

public Editor(java.lang.String name,
              java.lang.String condition,
              int priority)
Constructs a new Editor with the specified characteristics and is enabled.
Parameters:
name - The name of the Editor.
condition - The condition under which this Editor should be invoked.
priority - The priority of the Editor incase of a condition tie.

Editor

public Editor(java.lang.String name,
              java.lang.String condition,
              int priority,
              boolean enabled)
Constructs a new Editor with the specified characteristics.
Parameters:
name - The name of the Editor.
condition - The condition under which this Editor should be invoked.
priority - The priority of the Editor incase of a condition tie.
enabled - true if enabled.
Method Detail

getType

public int getType()
Get the Meg type associated with an Editor.
Overrides:
getType in class Meg
Returns:
Always returns Meg.EDITOR.

handleRequest

public abstract void handleRequest(RequestEvent event)
                            throws RequestRejectedException,
                                   java.io.IOException
Handle the specified RequestEvent for a request which statisifies the Editors condition.
Overrides:
handleRequest in class Meg
Parameters:
event - The RequestEvent with the content input stream and response output stream.
Throws:
RequestRejectedException - If rejecting request, this must be thrown before the first write() is made to the output stream.
java.io.IOException - If an error occurs parsing input or output streams.