public abstract class AbstractTopicMapReader extends Object implements TopicMapReaderIF
Modifier and Type | Field and Description |
---|---|
protected LocatorIF |
base_address |
protected Reader |
reader |
protected TopicMapStoreFactoryIF |
store_factory |
protected InputStream |
stream |
protected URL |
url |
Constructor and Description |
---|
AbstractTopicMapReader(File file) |
AbstractTopicMapReader(InputStream stream,
LocatorIF base_address) |
AbstractTopicMapReader(Reader reader,
LocatorIF base_address) |
AbstractTopicMapReader(URL url) |
AbstractTopicMapReader(URL url,
LocatorIF base_address) |
Modifier and Type | Method and Description |
---|---|
LocatorIF |
getBaseAddress()
PUBLIC: Gets the top level base address of the input source.
|
Reader |
getReader() |
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.
|
static Reader |
makeReader(InputStream stream,
String encoding,
EncodingSnifferIF sniffer) |
static Reader |
makeReader(LocatorIF locator,
EncodingSnifferIF sniffer) |
protected Reader |
makeReader(String encoding,
EncodingSnifferIF sniffer) |
TopicMapIF |
read()
PUBLIC: Reads the next topic map available from some implicit,
implementation dependent source.
|
protected abstract TopicMapIF |
read(TopicMapStoreFactoryIF store_factory) |
Collection<TopicMapIF> |
readAll()
PUBLIC: Reads all the topic map available from some implicit,
implementation dependent source.
|
protected Collection<TopicMapIF> |
readAll(TopicMapStoreFactoryIF store_factory) |
void |
setAdditionalProperties(Map<String,Object> properties)
Default implemenentation does not accept any additional properties
|
void |
setBaseAddress(LocatorIF base_address)
PUBLIC: Sets the top level base address of the input source.
|
void |
setReader(Reader reader) |
void |
setStoreFactory(TopicMapStoreFactoryIF store_factory)
PUBLIC: Sets the store factory which will be used to create stores.
|
protected URL url
protected Reader reader
protected InputStream stream
protected LocatorIF base_address
protected TopicMapStoreFactoryIF store_factory
public AbstractTopicMapReader(URL url) throws MalformedURLException
MalformedURLException
public AbstractTopicMapReader(InputStream stream, LocatorIF base_address)
public AbstractTopicMapReader(File file) throws MalformedURLException
MalformedURLException
public Reader getReader()
public void setReader(Reader reader)
public LocatorIF getBaseAddress()
public void setBaseAddress(LocatorIF base_address)
public TopicMapStoreFactoryIF getStoreFactory()
public void setStoreFactory(TopicMapStoreFactoryIF store_factory)
Default: InMemoryStoreFactory
store_factory
- The store factory to use. If the parameter
is null the default store factory will be used.public TopicMapIF read() throws IOException
TopicMapReaderIF
null
is returned when there are no more
topic maps available. In a sense this is iterator-like
behaviour.read
in interface TopicMapReaderIF
IOException
- Thrown if reading the source fails.public Collection<TopicMapIF> readAll() throws IOException
TopicMapReaderIF
readAll
in interface TopicMapReaderIF
IOException
- Thrown if reading the source fails.protected Collection<TopicMapIF> readAll(TopicMapStoreFactoryIF store_factory) throws IOException
IOException
protected abstract TopicMapIF read(TopicMapStoreFactoryIF store_factory) throws IOException
IOException
public void setAdditionalProperties(Map<String,Object> properties)
setAdditionalProperties
in interface TopicMapReaderIF
properties
- public void importInto(TopicMapIF topicmap) throws IOException
TopicMapReaderIF
importInto
in interface TopicMapReaderIF
topicmap
- The topic map into which the import will be done;
an object implementing TopicMapIF.IOException
public static Reader makeReader(InputStream stream, String encoding, EncodingSnifferIF sniffer) throws IOException
IOException
public static Reader makeReader(LocatorIF locator, EncodingSnifferIF sniffer) throws IOException
IOException
protected Reader makeReader(String encoding, EncodingSnifferIF sniffer) throws IOException
IOException