ch.interlis.iox
Interface IoxReader


public interface IoxReader

Interface to read a transfer file in object streaming mode. Usage:


 IoxReader reader=...;
 IoxEvent event;
 do{
        event=reader.read();
        if(event instanceof StartTransferEvent){
                ...
        }else if(event instanceof StartBasketEvent){
                ...
        }else if(event instanceof ObjectEvent){
                ...
        }else if(event instanceof EndBasketEvent){
                ...
        }else if(event instanceof EndTransferEvent){
                ...
        }
 }while(!(event instanceof EndTransferEvent));
 

Version:
$Revision: 1.0 $ $Date: 28.06.2006 $
Author:
ce
See Also:
IoxReaderAlt

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.
 

Method Detail

read

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

Throws:
IoxException

close

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

Throws:
IoxException

setFactory

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

Throws:
IoxException

getFactory

IoxFactoryCollection getFactory()
                                throws IoxException
gets the current factory collection.

Throws:
IoxException

createIomObject

IomObject createIomObject(java.lang.String type,
                          java.lang.String oid)
                          throws IoxException
creates a IomObject with the given type and oid.

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