org.znerd.dir2xml
Class Processor

java.lang.Object
  |
  +--org.znerd.dir2xml.Processor

public class Processor
extends Object

Processes a file that contains dir2xml instructions.

Example of an input file:

<?xml version="1.0" ?>

<doc>
   <dir2xml dir="/home/ernst" xmlns="http://dir2xml.sourceforge.net/XMLNS">
</doc>

The above example could result in the following result document:

<?xml version="1.0" ?>

<doc>
   <dir name="ernst" xmlns="http://dir2xml.sourceforge.net/XMLNS">
      <file name=".bashrc" />
      <file name=".profile" />
      <dir name="public_html">
         <file name="index.html" />
      </dir>
</doc>

Version:
$Revision: 1.5 $ $Date: 2002/06/21 11:07:49 $
Author:
Ernst de Haan (znerd@FreeBSD.org)

Constructor Summary
Processor(PrintWriter out)
          Constructs a new Processor.
 
Method Summary
static void main(String[] arguments)
          Main function.
 void process(Document input)
          Processes the specified input document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Processor

public Processor(PrintWriter out)
Constructs a new Processor.
Parameters:
out - the writer to send the output to, not null.
Method Detail

main

public static final void main(String[] arguments)
                       throws org.znerd.dir2xml.JDOMException,
                              ProcessingException,
                              IOException
Main function. This function is called when this class is executed as a program.

Expected is exactly one argument, being the name of the XML file with dir2xml instructions.

Parameters:
arguments - the arguments, possibly null.
Throws:
ProcessingException - in case the processing failed.
IOException - in case outputting the XML failed.

process

public void process(Document input)
             throws IllegalArgumentException,
                    ProcessingException
Processes the specified input document. In the output, all dir2xml elements are replaced with <dir /> and <file /> elements.
Parameters:
input - the input document, not null.
Throws:
IllegalArgumentException - if input == null.
ProcessingException - if the processing failed.


See http://dir2xml.sourceforge.net/.