ch.interlis.iom_j.xtf
Class XtfReader

java.lang.Object
  extended by ch.interlis.iom_j.xtf.XtfReader
All Implemented Interfaces:
IoxReader

public class XtfReader
extends java.lang.Object
implements IoxReader

This class implements a INTERLIS 2 reader.

Version:
$Revision: 1.0 $ $Date: 08.02.2007 $
Author:
ce

Constructor Summary
XtfReader(java.io.File xtffile)
          Creates a new reader.
XtfReader(java.io.InputStream in)
          Creates a new reader.
XtfReader(java.io.InputStreamReader in)
          Creates a new reader.
 
Method Summary
 void close()
          Frees any resources associated with this Reader.
 IomObject createIomObject(java.lang.String type, java.lang.String oid)
          creates a IomObject with the given type and oid.
 IoxFactoryCollection getFactory()
          gets the current factory collection.
 IoxEvent read()
          reads the next event from this reader.
 void setFactory(IoxFactoryCollection factory)
          sets the factory collection to be used.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtfReader

public XtfReader(java.io.InputStream in)
          throws IoxException
Creates a new reader.

Parameters:
in - Input stream to read from
Throws:
IoxException

XtfReader

public XtfReader(java.io.InputStreamReader in)
          throws IoxException
Creates a new reader.

Parameters:
in - Input reader to read from
Throws:
IoxException

XtfReader

public XtfReader(java.io.File xtffile)
          throws IoxException
Creates a new reader.

Parameters:
xtffile - File to read from
Throws:
IoxException
Method Detail

close

public void close()
           throws IoxException
Description copied from interface: IoxReader
Frees any resources associated with this Reader. This method closes the underlying input source only, if it was opened by this reader.

Specified by:
close in interface IoxReader
Throws:
IoxException

read

public IoxEvent read()
              throws IoxException
Description copied from interface: IoxReader
reads the next event from this reader. The flow of events is
StartTransferEvent {StartBasketEvent {ObjectEvent} EndBasketEvent} EndTransferEvent

Specified by:
read in interface IoxReader
Throws:
IoxException

createIomObject

public IomObject createIomObject(java.lang.String type,
                                 java.lang.String oid)
                          throws IoxException
Description copied from interface: IoxReader
creates a IomObject with the given type and oid.

Specified by:
createIomObject in interface IoxReader
Parameters:
type - of object to create
oid - may be null
Returns:
null if factory don know how to create object for given type.
Throws:
IoxException

getFactory

public IoxFactoryCollection getFactory()
                                throws IoxException
Description copied from interface: IoxReader
gets the current factory collection.

Specified by:
getFactory in interface IoxReader
Throws:
IoxException

setFactory

public void setFactory(IoxFactoryCollection factory)
                throws IoxException
Description copied from interface: IoxReader
sets the factory collection to be used. An implementation should initialize with a default factory collection and not require a call to this function.

Specified by:
setFactory in interface IoxReader
Throws:
IoxException