net.ontopia.topicmaps.xml
Class TMXMLReader

java.lang.Object
  extended by net.ontopia.xml.AbstractXMLFormatReader
      extended by net.ontopia.topicmaps.xml.TMXMLReader
All Implemented Interfaces:
TopicMapImporterIF, TopicMapReaderIF

public class TMXMLReader
extends AbstractXMLFormatReader
implements TopicMapReaderIF, TopicMapImporterIF

PUBLIC: A reader importing topic maps (or fragments) from the TM/XML syntax.

Since:
3.1

Field Summary
 
Fields inherited from class net.ontopia.xml.AbstractXMLFormatReader
base_address, source, xrfactory
 
Constructor Summary
TMXMLReader(org.xml.sax.InputSource source, LocatorIF base)
          PUBLIC: Creates a reader reading from the given location, using a different base address.
TMXMLReader(LocatorIF base)
          PUBLIC: Creates a reader reading from the given location.
TMXMLReader(java.lang.String filename)
          PUBLIC: Creates a reader reading from the given file name.
 
Method Summary
protected  void configureXMLReaderFactory(ConfiguredXMLReaderFactory cxrfactory)
           
 boolean getValidate()
           
 void importInto(TopicMapIF topicmap)
          PUBLIC: Imports an implicitly designated topic map into the given topic map.
 TopicMapIF read()
          PUBLIC: Reads the next topic map available from some implicit, implementation dependent source.
 java.util.Collection readAll()
          PUBLIC: Reads all the topic map available from some implicit, implementation dependent source.
 void setValidate(boolean validate)
           
 
Methods inherited from class net.ontopia.xml.AbstractXMLFormatReader
getBaseAddress, getInputSource, getXMLReaderFactory, setBaseAddress, setInputSource, setXMLReaderFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TMXMLReader

public TMXMLReader(java.lang.String filename)
PUBLIC: Creates a reader reading from the given file name.


TMXMLReader

public TMXMLReader(LocatorIF base)
PUBLIC: Creates a reader reading from the given location.


TMXMLReader

public TMXMLReader(org.xml.sax.InputSource source,
                   LocatorIF base)
PUBLIC: Creates a reader reading from the given location, using a different base address.

Method Detail

getValidate

public boolean getValidate()

setValidate

public void setValidate(boolean validate)

read

public TopicMapIF read()
                throws java.io.IOException
Description copied from interface: TopicMapReaderIF
PUBLIC: Reads the next topic map available from some implicit, implementation dependent source.

A topic map source may contain multiple topic maps. The read method returns the next topic map that is available from that source. null is returned when there are no more topic maps available. In a sense this is iterator-like behaviour.

Specified by:
read in interface TopicMapReaderIF
Returns:
The next topic map read from the source; an object implementing TopicMapIF. null is returned when there are no more topic maps available from the source.
Throws:
java.io.IOException - Thrown if reading the source fails.

importInto

public void importInto(TopicMapIF topicmap)
                throws java.io.IOException
Description copied from interface: TopicMapImporterIF
PUBLIC: Imports an implicitly designated topic map into the given topic map.

Specified by:
importInto in interface TopicMapImporterIF
Parameters:
topicmap - The topic map into which the import will be done; an object implementing TopicMapIF.
Throws:
java.io.IOException

readAll

public java.util.Collection readAll()
                             throws java.io.IOException
Description copied from interface: TopicMapReaderIF
PUBLIC: Reads all the topic map available from some implicit, implementation dependent source.

A topic map source may contain multiple topic maps. The readAll method returns a collection contain all the topic maps available from the source.

Specified by:
readAll in interface TopicMapReaderIF
Returns:
A collection containing all the topic maps read from the source; objects implementing TopicMapIF.
Throws:
java.io.IOException - Thrown if reading the source fails.

configureXMLReaderFactory

protected void configureXMLReaderFactory(ConfiguredXMLReaderFactory cxrfactory)
Specified by:
configureXMLReaderFactory in class AbstractXMLFormatReader


Copyright © 2000-2012 Ontopia.