package javakurs.musterloesung.uebung02.aufgabe1;

import java.io.IOException;
import java.util.List;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

/**
 * {@link TfsParserTest} is a test class for {@link TfsParser}.
 *
 * @author Joerg Steffen, DFKI
 * @version $Id: TfsParserTest.java,v 1.1 2010/11/11 16:51:25 steffen Exp $
 */
public final class TfsParserTest {

  /**
   * This creates a new instance of {@link TfsParserTest}. Not to be used.
   */
  private TfsParserTest() {
    // empty, private constructor
  }


  /**
   * This is the main method. It requires no arguments.
   *
   * @param args
   *          the arguments; not used here
   */
  public static void main(String[] args) {

    try {
      // init parser
      TfsParser testParser = new TfsParser();
      // parse file
      List<TypedFeatStruct> tfsList =
        testParser.parseTfsFromFile("data/uebung02/katzen.xml");
      for (TypedFeatStruct oneTFS : tfsList) {
        System.out.println(oneTFS);
      }
    } catch (ParserConfigurationException e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
    } catch (SAXException e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
    } catch (IOException e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
    }
  }
}
