ch.interlis.iom_j.itf
Class ItfReader

java.lang.Object
  extended by ch.interlis.iom_j.itf.ItfReader
All Implemented Interfaces:
IoxReader

public class ItfReader
extends java.lang.Object
implements IoxReader

This class implements an INTERLIS 1 reader.

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

Constructor Summary
ItfReader(java.io.File inFile)
          Creates a new reader.
ItfReader(java.io.InputStream 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.
 boolean isReadEnumValAsItfCode()
           
 boolean isRenumberTids()
           
 IoxEvent read()
          reads the next event from this reader.
 void setFactory(IoxFactoryCollection factory)
          sets the factory collection to be used.
 void setModel(ch.interlis.ili2c.metamodel.TransferDescription td)
          Sets the model of the the data to be read.
 void setReadEnumValAsItfCode(boolean val)
           
 void setRenumberTids(boolean renumberTids)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItfReader

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

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

ItfReader

public ItfReader(java.io.File inFile)
          throws IoxException
Creates a new reader.

Parameters:
inFile - 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

setModel

public void setModel(ch.interlis.ili2c.metamodel.TransferDescription td)
Sets the model of the the data to be read.

Parameters:
td - model as read by the compiler

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

setReadEnumValAsItfCode

public void setReadEnumValAsItfCode(boolean val)

isReadEnumValAsItfCode

public boolean isReadEnumValAsItfCode()

isRenumberTids

public boolean isRenumberTids()

setRenumberTids

public void setRenumberTids(boolean renumberTids)