dochelper
Class MatchOrderProcessor

java.lang.Object
  extended by dochelper.MatchOrderProcessor
All Implemented Interfaces:
Configurable, Processor

public class MatchOrderProcessor
extends java.lang.Object
implements Processor


Nested Class Summary
 class MatchOrderProcessor.ResultNodeComparator
           
 
Field Summary
protected static java.lang.String DIRECTION
           
protected  java.util.HashMap<java.lang.String,java.lang.Object> params
           
 
Constructor Summary
MatchOrderProcessor()
           
 
Method Summary
 void checkParams()
          Checks that the parameters are correct for this type of Renderer.
 void init()
          Initialize the Renderer.
 ResultNode operate(ResultNode doc)
          Sorts the tree of ResultNode doc alphabetically.
private  void orderTree(ResultNode doc)
           
 void setParam(java.lang.String paramName, java.lang.Object value)
          Add a parameter to the Configurable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTION

protected static final java.lang.String DIRECTION
See Also:
Constant Field Values

params

protected java.util.HashMap<java.lang.String,java.lang.Object> params
Constructor Detail

MatchOrderProcessor

public MatchOrderProcessor()
Method Detail

operate

public ResultNode operate(ResultNode doc)
Sorts the tree of ResultNode doc alphabetically. The param direction of params indicates the direction the tree is sorted.

Specified by:
operate in interface Processor
Parameters:
doc - The node that represent the root of the tree to process.
Throws:
java.lang.Exception

orderTree

private void orderTree(ResultNode doc)

checkParams

public void checkParams()
                 throws InvalidValueException,
                        MissingArgumentException,
                        ResourceUnavailableException
Description copied from interface: Configurable
Checks that the parameters are correct for this type of Renderer. Implementor should make sure that required parameters are validated and that any semantic and format rules are enforced. DocHelper guarantees that this method will be called before init() and execute(); This method will not return a boolean indicating success, rather, it will fire an Exception indicating error type

Specified by:
checkParams in interface Configurable
Throws:
InvalidValueException
MissingArgumentException
ResourceUnavailableException
See Also:
Configurable.checkParams()

init

public void init()
          throws InitializationException,
                 ResourceUnavailableException
Description copied from interface: Configurable
Initialize the Renderer. The implementor should have this method initialize any connections, file checking, class loading etc, that are neccessary setting up properly for use by the execute method.

Specified by:
init in interface Configurable
Throws:
InitializationException
ResourceUnavailableException
See Also:
Configurable.init()

setParam

public void setParam(java.lang.String paramName,
                     java.lang.Object value)
              throws IllegalParamterTypeException
Description copied from interface: Configurable
Add a parameter to the Configurable. This mechanism allows options to be set for the Configurable. Things like output path, input path, table names, file types, gob patterns, etc should be passed by setting the appropriate params for a Configurable object. DocHelper will guarantee the following execution flow for all Configurables setParam(), checkParams() and init(). It is the responsibility of this method to check correct types for params used.

Specified by:
setParam in interface Configurable
Parameters:
paramName - String Name of the paramter to be stored
value - String value of the named param
Throws:
IllegalParamterTypeException
See Also:
Configurable.setParam(java.lang.String, java.lang.Object)