Package net.ontopia.topicmaps.utils.xfml
Class XFMLTopicMapReader
- java.lang.Object
-
- net.ontopia.xml.AbstractXMLFormatReader
-
- net.ontopia.topicmaps.utils.xfml.XFMLTopicMapReader
-
- All Implemented Interfaces:
TopicMapReaderIF
public class XFMLTopicMapReader extends AbstractXMLFormatReader implements TopicMapReaderIF
PUBLIC: A topic map reader that is capable of reading the XFML format for faceted hierarchical metadata.
-
-
Field Summary
Fields Modifier and Type Field Description protected TopicMapStoreFactoryIF
store_factory
-
Fields inherited from class net.ontopia.xml.AbstractXMLFormatReader
base_address, source
-
-
Constructor Summary
Constructors Constructor Description XFMLTopicMapReader(File file)
PUBLIC: Creates an XFML reader bound to the file given in the argument.XFMLTopicMapReader(InputStream stream, LocatorIF base_address)
Creates an XFML reader bound to the input stream given in the arguments.XFMLTopicMapReader(Reader reader, LocatorIF base_address)
Creates an XFML reader bound to the reader given in the arguments.XFMLTopicMapReader(URL url)
Creates an XFML reader.XFMLTopicMapReader(InputSource source, LocatorIF base_address)
PUBLIC: Creates a topic map reader bound to the input source given in the arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopicMapStoreFactoryIF
getStoreFactory()
PUBLIC: Gets the store factory which will be used to create stores.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.Collection
readAll()
PUBLIC: Reads all the topic map available from some implicit, implementation dependent source.void
setAdditionalProperties(Map<String,Object> properties)
XFMLTopicMapReader has no additional options to set.void
setStoreFactory(TopicMapStoreFactoryIF store_factory)
PUBLIC: Sets the store factory which will be used to create stores.-
Methods inherited from class net.ontopia.xml.AbstractXMLFormatReader
getBaseAddress, getInputSource, setBaseAddress, setInputSource
-
-
-
-
Field Detail
-
store_factory
protected TopicMapStoreFactoryIF store_factory
-
-
Constructor Detail
-
XFMLTopicMapReader
public XFMLTopicMapReader(URL url) throws MalformedURLException
Creates an XFML reader.- Parameters:
url
- The URL of the XFML document.- Throws:
MalformedURLException
-
XFMLTopicMapReader
public XFMLTopicMapReader(Reader reader, LocatorIF base_address)
Creates an XFML reader bound to the reader given in the arguments.- Parameters:
reader
- The reader from which the XFML document is to be read.base_address
- The base address to be used for resolving relative references.
-
XFMLTopicMapReader
public XFMLTopicMapReader(InputStream stream, LocatorIF base_address)
Creates an XFML reader bound to the input stream given in the arguments.- Parameters:
stream
- The input stream from which the topic map is to be read.base_address
- The base address to be used for resolving relative references.
-
XFMLTopicMapReader
public XFMLTopicMapReader(File file) throws MalformedURLException
PUBLIC: Creates an XFML reader bound to the file given in the argument.- Parameters:
file
- The file object from which to read the topic map.- Throws:
MalformedURLException
-
XFMLTopicMapReader
public XFMLTopicMapReader(InputSource source, LocatorIF base_address)
PUBLIC: Creates a topic map reader bound to the input source given in the arguments.- Parameters:
source
- The SAX input source from which the topic map is to be read.base_address
- The base address to be used for resolving relative references.
-
-
Method Detail
-
getStoreFactory
public TopicMapStoreFactoryIF getStoreFactory()
PUBLIC: Gets the store factory which will be used to create stores.
-
setStoreFactory
public void setStoreFactory(TopicMapStoreFactoryIF store_factory)
PUBLIC: Sets the store factory which will be used to create stores.Default:
InMemoryStoreFactory
- Parameters:
store_factory
- The store factory to use. If the parameter is null the default store factory will be used.
-
read
public TopicMapIF read() throws 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 interfaceTopicMapReaderIF
- 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:
IOException
- Thrown if reading the source fails.
-
readAll
public Collection readAll() throws 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 interfaceTopicMapReaderIF
- Returns:
- A collection containing all the topic maps read from the source; objects implementing TopicMapIF.
- Throws:
IOException
- Thrown if reading the source fails.
-
importInto
public void importInto(TopicMapIF topicmap) throws IOException
Description copied from interface:TopicMapReaderIF
PUBLIC: Imports an implicitly designated topic map into the given topic map.- Specified by:
importInto
in interfaceTopicMapReaderIF
- Parameters:
topicmap
- The topic map into which the import will be done; an object implementing TopicMapIF.- Throws:
IOException
-
setAdditionalProperties
public void setAdditionalProperties(Map<String,Object> properties)
XFMLTopicMapReader has no additional options to set.- Specified by:
setAdditionalProperties
in interfaceTopicMapReaderIF
- Parameters:
properties
-
-
-