Class TMXMLWriter

All Implemented Interfaces:
TopicMapWriterIF

public class TMXMLWriter extends AbstractTopicMapExporter implements TopicMapWriterIF
PUBLIC: A writer exporting topic maps (or fragments) to the TM/XML syntax.
Since:
3.1
  • Field Details

  • Constructor Details

  • Method Details

    • close

      public void close() throws IOException
      PUBLIC: Closes the Writer created for internal use. Call this method when you have finished using the fragment exporter interface on the topic map writer. Don't call this method if using the TopicMapWriterIF interface.
      Throws:
      IOException
    • getDocumentElement

      public String getDocumentElement()
      PUBLIC: Returns the element type name of the document element.
    • setDocumentElement

      public void setDocumentElement(String docelem)
      PUBLIC: Sets the document element type name to use.
    • write

      public void write(TopicMapIF topicmap) throws IOException
      PUBLIC: Writes the given topic map to the underlying writer.
      Specified by:
      write in interface TopicMapWriterIF
      Parameters:
      topicmap - The topic map to be exported.
      Throws:
      IOException - Thrown if writing the topic map fails.
    • startTopicMap

      public void startTopicMap(TopicMapIF topicmap) throws SAXException
      PUBLIC: Writes the start tag of the document element (to be used in fragment exporting only).
      Throws:
      SAXException
    • gatherPrefixes

      public void gatherPrefixes(Collection topics)
      PUBLIC: Gets the namespace prefixes to be used (to be used in fragment exporting mode only). Must be called before startTopicMap.
    • writeTopics

      public void writeTopics(Collection topics) throws SAXException
      PUBLIC: Writes a set of topics (fragment exporting mode only).
      Throws:
      SAXException
    • writeTopic

      public void writeTopic(TopicIF topic) throws SAXException
      PUBLIC: Writes a single topic (fragment exporting mode only).
      Throws:
      SAXException
    • endTopicMap

      public void endTopicMap() throws SAXException
      PUBLIC: Write the end tag of the document element (fragment mode only).
      Throws:
      SAXException
    • gatherPrefixes

      public void gatherPrefixes(TopicIF topic)
      PUBLIC: Gets the namespace prefixes to be used (to be used in fragment exporting mode only). Must be called before startTopicMap.
    • getNamespaceURIMapping

      public Map getNamespaceURIMapping()
      PRIVATE: Returns the namespace URI to prefix mapping maintained internally by the writer. Never, ever call this method. It exists only for testing purposes.
    • addPrefix

      public void addPrefix(String prefix, String nsuri)
    • getSubjectIndicatorRef

      protected String getSubjectIndicatorRef(TopicIF topic, LocatorIF indicator)
    • setAdditionalProperties

      public void setAdditionalProperties(Map<String,Object> properties)
      Sets additional properties for the TMXMLWriter. Accepted properties:
      Specified by:
      setAdditionalProperties in interface TopicMapWriterIF
      Parameters:
      properties -