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()
Constructs a new Processor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Processor
public Processor()
- Constructs a new
Processor.
main
public static final void main(String[] arguments)
throws 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:
JDOMException - in case the building of the JDOM Document failed.ProcessingException - in case the processing failed.IOException - in case outputting the XML failed.
process
public Document 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.- Returns:
- the output document, never
null. - Throws:
IllegalArgumentException - if input == null.ProcessingException - if the processing failed.
See http://dir2xml.sourceforge.net/.