samples.stax
Class StAXParsingSample

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

public class StAXParsingSample
extends Object

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

The sample starts by creating an input stream from the input FI document. The input stream is then used to instantiating a new instance of FI StAX stream reader "StAXDocumentParser". The rest of the code simply uses the StreamReader to loop through the document and displays event types, names and etc.


Constructor Summary
StAXParsingSample()
          Creates a new instance of Cursor
 
Method Summary
static void main(String[] args)
          Starts the sample.
 void parse(String filename)
          Reads a FI document using StAXDocumentParser and displays event types and contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StAXParsingSample

public StAXParsingSample()
Creates a new instance of Cursor

Method Detail

main

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

Parameters:
args - a FI document.

parse

public void parse(String filename)
Reads a FI document using StAXDocumentParser and displays event types and contents.

Parameters:
filename - FI document name.


Copyright © 2012 Oracle Corpration. All Rights Reserved.