© 2006-2007 ETH Zurich

org.ximtec.igesture.util
Class XMLParser

java.lang.Object
  extended by org.ximtec.igesture.util.XMLParser

public abstract class XMLParser
extends Object

This class helps with parsing of configuration files.

Author:
Bjorn Puype, bpuype@gmail.com

Constructor Summary
XMLParser()
           
 
Method Summary
abstract  void execute(ArrayList<NodeList> nodeLists)
          This method is called for every node of type nodeName.
 void parse(String fileName, String nodeName, ArrayList<String> textNodes)
          Parse an XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser()
Method Detail

parse

public void parse(String fileName,
                  String nodeName,
                  ArrayList<String> textNodes)
           throws ParserConfigurationException,
                  SAXException,
                  IOException
Parse an XML file.

Parameters:
fileName - The path of the file to parse.
nodeName - The name of the nodes under the root node (should all be same type).
textNodes - The names of the sub nodes of a node of type nodeName. These nodes should all be text nodes.
Throws:
ParserConfigurationException
SAXException
IOException

execute

public abstract void execute(ArrayList<NodeList> nodeLists)
This method is called for every node of type nodeName. This method has to be implemented to specify what to do with the parsed text nodes.

Parameters:
nodeLists - A list with the parsed text nodes.

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.