Package net.ontopia.topicmaps.impl.utils
Class AbstractTopicMapReader
java.lang.Object
net.ontopia.topicmaps.impl.utils.AbstractTopicMapReader
- All Implemented Interfaces:
TopicMapReaderIF
- Direct Known Subclasses:
CTMTopicMapReader,JTMTopicMapReader,LTMTopicMapReader
INTERNAL: Common abstract superclass for topic map readers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LocatorIFprotected Readerprotected TopicMapStoreFactoryIFprotected InputStreamprotected URL -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTopicMapReader(File file) AbstractTopicMapReader(InputStream stream, LocatorIF base_address) AbstractTopicMapReader(Reader reader, LocatorIF base_address) AbstractTopicMapReader(URL url, LocatorIF base_address) -
Method Summary
Modifier and TypeMethodDescriptionPUBLIC: Gets the top level base address of the input source.PUBLIC: Gets the store factory which will be used to create stores.voidimportInto(TopicMapIF topicmap) PUBLIC: Imports an implicitly designated topic map into the given topic map.static ReadermakeReader(InputStream stream, String encoding, EncodingSnifferIF sniffer) protected ReadermakeReader(String encoding, EncodingSnifferIF sniffer) static ReadermakeReader(LocatorIF locator, EncodingSnifferIF sniffer) read()PUBLIC: Reads the next topic map available from some implicit, implementation dependent source.protected abstract TopicMapIFread(TopicMapStoreFactoryIF store_factory) readAll()PUBLIC: Reads all the topic map available from some implicit, implementation dependent source.protected Collection<TopicMapIF>readAll(TopicMapStoreFactoryIF store_factory) voidsetAdditionalProperties(Map<String, Object> properties) Default implemenentation does not accept any additional propertiesvoidsetBaseAddress(LocatorIF base_address) PUBLIC: Sets the top level base address of the input source.voidvoidsetStoreFactory(TopicMapStoreFactoryIF store_factory) PUBLIC: Sets the store factory which will be used to create stores.
-
Field Details
-
url
-
reader
-
stream
-
base_address
-
store_factory
-
-
Constructor Details
-
AbstractTopicMapReader
- Throws:
MalformedURLException
-
AbstractTopicMapReader
-
AbstractTopicMapReader
-
AbstractTopicMapReader
-
AbstractTopicMapReader
- Throws:
MalformedURLException
-
-
Method Details
-
getReader
-
setReader
-
getBaseAddress
PUBLIC: Gets the top level base address of the input source. -
setBaseAddress
PUBLIC: Sets the top level base address of the input source. The top level base address is used to resolve relative addresses during input source processing. This property need not be set if the input source specifies the base address. -
getStoreFactory
PUBLIC: Gets the store factory which will be used to create stores. -
setStoreFactory
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
Description copied from interface:TopicMapReaderIFPUBLIC: 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.nullis returned when there are no more topic maps available. In a sense this is iterator-like behaviour.- Specified by:
readin 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
Description copied from interface:TopicMapReaderIFPUBLIC: 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:
readAllin interfaceTopicMapReaderIF- Returns:
- A collection containing all the topic maps read from the source; objects implementing TopicMapIF.
- Throws:
IOException- Thrown if reading the source fails.
-
readAll
- Throws:
IOException
-
read
- Throws:
IOException
-
setAdditionalProperties
Default implemenentation does not accept any additional properties- Specified by:
setAdditionalPropertiesin interfaceTopicMapReaderIF- Parameters:
properties-
-
importInto
Description copied from interface:TopicMapReaderIFPUBLIC: Imports an implicitly designated topic map into the given topic map.- Specified by:
importIntoin interfaceTopicMapReaderIF- Parameters:
topicmap- The topic map into which the import will be done; an object implementing TopicMapIF.- Throws:
IOException
-
makeReader
public static Reader makeReader(InputStream stream, String encoding, EncodingSnifferIF sniffer) throws IOException - Throws:
IOException
-
makeReader
- Throws:
IOException
-
makeReader
- Throws:
IOException
-