Package net.ontopia.topicmaps.xml
Class TMXMLReader
java.lang.Object
net.ontopia.xml.AbstractXMLFormatReader
net.ontopia.topicmaps.xml.TMXMLReader
- All Implemented Interfaces:
TopicMapReaderIF
PUBLIC: A reader importing topic maps (or fragments) from the
TM/XML syntax.
- Since:
- 3.1
-
Field Summary
FieldsFields inherited from class net.ontopia.xml.AbstractXMLFormatReader
base_address, source -
Constructor Summary
ConstructorsConstructorDescriptionTMXMLReader(File file) PUBLIC: Creates a reader reading from the given file name.TMXMLReader(InputStream stream, LocatorIF base_address) PUBLIC: Creates a reader reading from the given InputStream using the specified base address.TMXMLReader(Reader reader, LocatorIF base_address) PUBLIC: Creates a reader reading from the given Reader using the specified base address.TMXMLReader(URL url) PUBLIC: Creates a reader reading from the given url.TMXMLReader(URL url, LocatorIF base_address) TMXMLReader(InputSource source, LocatorIF base) PUBLIC: Creates a reader reading from the given location, using a different base address. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidimportInto(TopicMapIF topicmap) PUBLIC: Imports an implicitly designated topic map into the given topic map.read()PUBLIC: Reads the next topic map available from some implicit, implementation dependent source.readAll()PUBLIC: Reads all the topic map available from some implicit, implementation dependent source.voidsetAdditionalProperties(Map<String, Object> properties) Sets additional properties for the TMXMLReader.voidsetValidate(boolean validate) Methods inherited from class net.ontopia.xml.AbstractXMLFormatReader
getBaseAddress, getInputSource, setBaseAddress, setInputSource
-
Field Details
-
PROPERTY_VALIDATE
- See Also:
-
-
Constructor Details
-
TMXMLReader
PUBLIC: Creates a reader reading from the given url.- Throws:
MalformedURLException
-
TMXMLReader
-
TMXMLReader
PUBLIC: Creates a reader reading from the given file name.- Throws:
MalformedURLException
-
TMXMLReader
PUBLIC: Creates a reader reading from the given Reader using the specified base address. -
TMXMLReader
PUBLIC: Creates a reader reading from the given InputStream using the specified base address. -
TMXMLReader
PUBLIC: Creates a reader reading from the given location, using a different base address.
-
-
Method Details
-
getValidate
public boolean getValidate() -
setValidate
public void setValidate(boolean validate) -
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.
-
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
-
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.
-
setAdditionalProperties
Sets additional properties for the TMXMLReader. Only accepts the property "validate", which corresponds to thesetValidate(boolean)method. Only accepts a boolean value.- Specified by:
setAdditionalPropertiesin interfaceTopicMapReaderIF- Parameters:
properties-
-