ikrs.util
Class XMLEnvironmentReader

java.lang.Object
  extended by ikrs.util.XMLEnvironmentReader

public class XMLEnvironmentReader
extends java.lang.Object


Field Summary
static java.lang.String TEXT_NODE_KEY
           
 
Constructor Summary
protected XMLEnvironmentReader()
          A dummy constructor.
 
Method Summary
static void main(java.lang.String[] argv)
           
protected static void read(org.w3c.dom.Document doc, Environment<java.lang.String,BasicType> env, boolean dropTextNodes)
           
static Environment<java.lang.String,BasicType> read(java.io.File file)
          Reads the whole XML file into an environment object.
static Environment<java.lang.String,BasicType> read(java.io.File file, boolean dropTextNodes)
          Reads the whole XML file into an environment object.
protected static void read(org.w3c.dom.Node currentNode, Environment<java.lang.String,BasicType> env, boolean dropTextNodes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_NODE_KEY

public static final java.lang.String TEXT_NODE_KEY
See Also:
Constant Field Values
Constructor Detail

XMLEnvironmentReader

protected XMLEnvironmentReader()
A dummy constructor. This class is not meant to be instantiated.

Method Detail

read

public static Environment<java.lang.String,BasicType> read(java.io.File file)
                                                    throws java.io.IOException
Reads the whole XML file into an environment object. Note: Text nodes will be dropped.

Throws:
java.io.IOException

read

public static Environment<java.lang.String,BasicType> read(java.io.File file,
                                                           boolean dropTextNodes)
                                                    throws java.io.IOException
Reads the whole XML file into an environment object. Note: if dropTextNodes is set to false, the text data will be added to the local environments map using the mapping key XMLEnvironmentReader.TEXT_NODE_KEY.

Parameters:
file - The input file.
dropTextNodes - if set to true all text nodes will be dropped.
Returns:
The XML file contents inside a nested environment. Note that the environment has allowMultipleChildNames() set to true!
Throws:
java.io.IOException

read

protected static void read(org.w3c.dom.Document doc,
                           Environment<java.lang.String,BasicType> env,
                           boolean dropTextNodes)

read

protected static void read(org.w3c.dom.Node currentNode,
                           Environment<java.lang.String,BasicType> env,
                           boolean dropTextNodes)

main

public static void main(java.lang.String[] argv)