Class CanonicalTopicMapWriter

  • All Implemented Interfaces:
    TopicMapWriterIF

    public class CanonicalTopicMapWriter
    extends Object
    implements TopicMapWriterIF
    PUBLIC: A topic map writer that writes topic maps out to Ontopia's Canonical XTM topic map format. This format is generally used for testing and not for other purposes.

    Note: this is the format defined in an Ontopia technical report, not the upcoming standard format. For new code, please use the standard format.

    • Constructor Detail

      • CanonicalTopicMapWriter

        public CanonicalTopicMapWriter​(File file)
                                throws IOException
        Creates a topic map writer bound to the file given in the arguments.
        Parameters:
        file - The file object to which the topic map is to be written.
        Throws:
        IOException
      • CanonicalTopicMapWriter

        public CanonicalTopicMapWriter​(OutputStream stream)
        Creates a topic map writer bound to the output stream given in the arguments.
        Parameters:
        stream - The output stream to which the topic map is to be written.
    • Method Detail

      • write

        public void write​(TopicMapIF topicmap)
                   throws IOException
        Description copied from interface: TopicMapWriterIF
        PUBLIC: Writes the given topic map to an implicit implementation dependent destination. The write method will close any resources opened internally. This means that the write method can only be called once if the stream/writer was opened internally.
        Specified by:
        write in interface TopicMapWriterIF
        Parameters:
        topicmap - The topic map to be exported/written; an object implementing TopicMapIF
        Throws:
        IOException - Thrown if writing the topic map fails.
      • getBaseLocator

        public LocatorIF getBaseLocator()
        INTERNAL: Gets the base locator used to resolve relative locators.
      • setBaseLocator

        public void setBaseLocator​(LocatorIF baseloc)
        INTERNAL: Sets the base locator used to resolve relative locators.