public class XTMTopicMapReader extends AbstractXMLFormatReader implements TopicMapReaderIF
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_EXTERNAL_REFERENCE_HANDLER |
static String |
PROPERTY_VALIDATION |
protected ExternalReferenceHandlerIF |
ref_handler |
protected TopicMapStoreFactoryIF |
store_factory |
protected Iterator |
topicmaps |
protected boolean |
validate |
base_address, source
Constructor and Description |
---|
XTMTopicMapReader(File file)
PUBLIC: Creates a topic map reader bound to the file given in the
arguments.
|
XTMTopicMapReader(InputSource source,
LocatorIF base_address)
PUBLIC: Creates a topic map reader bound to the input source
given in the arguments.
|
XTMTopicMapReader(InputStream stream,
LocatorIF base_address)
PUBLIC: Creates a topic map reader bound to the input stream
given in the arguments.
|
XTMTopicMapReader(Reader reader,
LocatorIF base_address)
PUBLIC: Creates a topic map reader bound to the reader given in
the arguments.
|
XTMTopicMapReader(URL url)
PUBLIC: Creates a topic map reader bound to the URL given in the
arguments.
|
XTMTopicMapReader(URL url,
LocatorIF base_address) |
Modifier and Type | Method and Description |
---|---|
ExternalReferenceHandlerIF |
getExternalReferenceHandler()
PUBLIC: Gets the external reference handler.
|
TopicMapStoreFactoryIF |
getStoreFactory()
PUBLIC: Gets the store factory which will be used to create stores.
|
boolean |
getValidation()
PUBLIC: Returns true if validation is on, false otherwise.
|
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.
|
protected TopicMapIF |
read(TopicMapStoreFactoryIF store_factory) |
Collection |
readAll()
PUBLIC: Reads all the topic map available from some implicit,
implementation dependent source.
|
protected Collection |
readAll(TopicMapStoreFactoryIF store_factory) |
void |
setAdditionalProperties(Map<String,Object> properties)
Sets additional properties for the XTMTopicMapReader.
|
void |
setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler)
PUBLIC: Sets the external reference handler.
|
void |
setFollowTopicRefs(boolean followTopicRefs)
PUBLIC: If set to false topicRef elements pointing to external
documents will not be traversed.
|
void |
setStoreFactory(TopicMapStoreFactoryIF store_factory)
PUBLIC: Sets the store factory which will be used to create stores.
|
void |
setValidation(boolean validate)
PUBLIC: Turn validation of XTM documents according to DTD on or
off.
|
getBaseAddress, getInputSource, setBaseAddress, setInputSource
public static final String PROPERTY_VALIDATION
public static final String PROPERTY_EXTERNAL_REFERENCE_HANDLER
protected Iterator topicmaps
protected TopicMapStoreFactoryIF store_factory
protected ExternalReferenceHandlerIF ref_handler
protected boolean validate
public XTMTopicMapReader(URL url) throws MalformedURLException
url
- The URL of the topic map document.MalformedURLException
public XTMTopicMapReader(Reader reader, LocatorIF base_address)
reader
- The reader from which the topic map is to be read.base_address
- The base address to be used for resolving
relative references.public XTMTopicMapReader(InputStream stream, LocatorIF base_address)
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.public XTMTopicMapReader(File file) throws IOException
file
- The file object from which to read the topic map.IOException
public XTMTopicMapReader(InputSource source, LocatorIF base_address)
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.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 ExternalReferenceHandlerIF getExternalReferenceHandler()
public void setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler)
public void setFollowTopicRefs(boolean followTopicRefs)
public void setValidation(boolean validate)
validate
- Will validate if true, will not if false.public boolean getValidation()
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.protected TopicMapIF read(TopicMapStoreFactoryIF store_factory) throws IOException
IOException
public Collection readAll() throws IOException
TopicMapReaderIF
readAll
in interface TopicMapReaderIF
IOException
- Thrown if reading the source fails.protected Collection readAll(TopicMapStoreFactoryIF store_factory) throws IOException
IOException
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 void setAdditionalProperties(Map<String,Object> properties)
setValidation(boolean)
method. The value of 'externalReferenceHandler' has
to be an ExternalReferenceHandlerIF
and corresponds to the
setExternalReferenceHandler(net.ontopia.topicmaps.xml.ExternalReferenceHandlerIF)
method.setAdditionalProperties
in interface TopicMapReaderIF
properties
-