com.topologi.diffx.load
Class DOMRecorder

java.lang.Object
  extended bycom.topologi.diffx.load.DOMRecorder
All Implemented Interfaces:
Recorder, XMLRecorder

public final class DOMRecorder
extends Object
implements XMLRecorder

Loads a DOM documents as a sequence of events.

This class implements the methods Recorder.process(File) and Recorder.process(String) for convenience, but is it much more efficient to feed this recorder directly with a DOM.

This class is not synchronised.

Version:
26 April 2005
Author:
Christophe Lauret

Constructor Summary
DOMRecorder()
           
 
Method Summary
 DiffXConfig getConfig()
          Returns the configuration used by this recorder.
 EventSequence process(File file)
          Runs the recorder on the specified file.
 EventSequence process(InputSource is)
          Runs the recorder on the specified input source.
 EventSequence process(Node node)
          Processed the given node and return the corresponding event sequence.
 EventSequence process(String xml)
          Runs the recorder on the specified string.
 void setConfig(DiffXConfig config)
          Sets the configuration used by this recorder.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMRecorder

public DOMRecorder()
Method Detail

getConfig

public DiffXConfig getConfig()
Returns the configuration used by this recorder.

Returns:
the configuration used by this recorder.

setConfig

public void setConfig(DiffXConfig config)
Sets the configuration used by this recorder.

Parameters:
config - The configuration used by this recorder.

process

public EventSequence process(File file)
                      throws LoadingException,
                             IOException
Description copied from interface: Recorder
Runs the recorder on the specified file.

Specified by:
process in interface Recorder
Parameters:
file - The file to process.
Returns:
The recorded sequence of events.
Throws:
LoadingException - If thrown whilst parsing.
IOException - Should I/O error occur.
See Also:
Recorder.process(java.io.File)

process

public EventSequence process(String xml)
                      throws LoadingException
Description copied from interface: Recorder
Runs the recorder on the specified string.

Specified by:
process in interface Recorder
Parameters:
xml - The string to process.
Returns:
The recorded sequence of events.
Throws:
LoadingException - If thrown whilst parsing.
See Also:
Recorder.process(java.lang.String)

process

public EventSequence process(InputSource is)
                      throws LoadingException
Runs the recorder on the specified input source.

Specified by:
process in interface XMLRecorder
Parameters:
is - The input source.
Returns:
The recorded sequence of events.
Throws:
LoadingException - If thrown whilst parsing.

process

public EventSequence process(Node node)
                      throws LoadingException
Processed the given node and return the corresponding event sequence.

Parameters:
node - The W3C DOM node to be processed.
Returns:
The recorded sequence of events.
Throws:
LoadingException - If thrown whilst parsing.