samples.stax
Class StAXEventReadingSample

java.lang.Object
  extended by samples.stax.StAXEventReadingSample

public class StAXEventReadingSample
extends Object

This is a sample that demonstrates the use of FI StAX Event Iterator API.

The sample starts by creating an input stream from the input FI document. The input stream is used to instantiate a stream reader as does in the StreamReader sample. An event reader (StAXEventReader) is created using the stream reader isntance. With the event reader, the program iterates through all of the events in the input FI document and displays event types and content.


Constructor Summary
StAXEventReadingSample()
          Creates a new instance of EventReader
 
Method Summary
static void main(String[] args)
          Starts the sample.
 void readFIDoc(String filename)
          Reads a FI document using fastinfoset.StAXEventReader and displays all of the events in the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StAXEventReadingSample

public StAXEventReadingSample()
Creates a new instance of EventReader

Method Detail

main

public static void main(String[] args)
Starts the sample. The sample takes a FI document filename that will be read using StAXEventReader.

Parameters:
args - a FI document.

readFIDoc

public void readFIDoc(String filename)
               throws Exception
Reads a FI document using fastinfoset.StAXEventReader and displays all of the events in the document.

Parameters:
filename - FI document name.
Throws:
Exception


Copyright © 2012 Oracle Corpration. All Rights Reserved.