net.ontopia.topicmaps.utils.ltm
Class LTMTopicMapWriter

java.lang.Object
  extended by net.ontopia.topicmaps.utils.ltm.LTMTopicMapWriter
All Implemented Interfaces:
TopicMapWriterIF

public class LTMTopicMapWriter
extends java.lang.Object
implements TopicMapWriterIF

PUBLIC: Exports topic maps to the LTM 1.3 interchange format.

Since:
2.2

Field Summary
protected  java.util.Comparator associationComparator
           
protected  java.lang.String base
           
protected  java.util.Comparator baseNameComparator
           
protected  java.util.Calendar calendar
           
protected  java.util.Comparator elementIdComparator
           
protected  java.lang.String encoding
           
protected  DeciderIF filter
           
protected  java.lang.String groupString1
           
protected  net.ontopia.topicmaps.utils.ltm.LTMTopicMapWriter.IdManager idManager
           
protected  java.util.Comparator occurrenceComparator
           
protected  java.io.Writer out
           
protected  boolean preserveIds
           
protected  java.util.Comparator reifierComparator
           
protected  java.util.Comparator roleComparator
           
protected  java.util.Map roleCounter
           
protected  java.util.Map rolesCounted
           
protected  java.util.Comparator scopeComparator
           
protected  java.util.Comparator supersubComparator
           
protected  java.util.Comparator supersubRoleComparator
           
protected  java.util.Comparator topicComparator
           
protected  java.util.Comparator variantComparator
           
 
Constructor Summary
LTMTopicMapWriter(java.io.OutputStream stream)
          PUBLIC: Create an LTMTopicMapWriter that writes to a given OutputStream in UTF-8.
LTMTopicMapWriter(java.io.OutputStream stream, java.lang.String encoding)
          PUBLIC: Create an LTMTopicMapWriter that writes to a given OutputStream in the given encoding.
LTMTopicMapWriter(java.io.Writer out)
          Deprecated.  
LTMTopicMapWriter(java.io.Writer out, java.lang.String encoding)
          PUBLIC: Create an LTMTopicMapWriter that writes to a given Writer.
 
Method Summary
 void setFilter(DeciderIF filter)
          PUBLIC: Sets the filter that decides which topic map constructs are accepted in the exprted ltm.
 void setPreserveIds(boolean preserveIds)
          PUBLIC: Set whether IDs should be preserved or generated.
 void write(TopicMapIF tm)
          PUBLIC: Writes out the given topic map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoding

protected java.lang.String encoding

preserveIds

protected boolean preserveIds

roleCounter

protected java.util.Map roleCounter

rolesCounted

protected java.util.Map rolesCounted

out

protected java.io.Writer out

calendar

protected java.util.Calendar calendar

base

protected java.lang.String base

filter

protected DeciderIF filter

associationComparator

protected java.util.Comparator associationComparator

baseNameComparator

protected java.util.Comparator baseNameComparator

elementIdComparator

protected java.util.Comparator elementIdComparator

supersubComparator

protected java.util.Comparator supersubComparator

supersubRoleComparator

protected java.util.Comparator supersubRoleComparator

occurrenceComparator

protected java.util.Comparator occurrenceComparator

reifierComparator

protected java.util.Comparator reifierComparator

roleComparator

protected java.util.Comparator roleComparator

scopeComparator

protected java.util.Comparator scopeComparator

topicComparator

protected java.util.Comparator topicComparator

variantComparator

protected java.util.Comparator variantComparator

idManager

protected net.ontopia.topicmaps.utils.ltm.LTMTopicMapWriter.IdManager idManager

groupString1

protected java.lang.String groupString1
Constructor Detail

LTMTopicMapWriter

public LTMTopicMapWriter(java.io.OutputStream stream)
                  throws java.io.IOException
PUBLIC: Create an LTMTopicMapWriter that writes to a given OutputStream in UTF-8. Warning: Use of this method is discouraged, as it is very easy to get character encoding errors with this method.

Parameters:
stream - Where the output should be written.
Throws:
java.io.IOException

LTMTopicMapWriter

public LTMTopicMapWriter(java.io.OutputStream stream,
                         java.lang.String encoding)
                  throws java.io.IOException
PUBLIC: Create an LTMTopicMapWriter that writes to a given OutputStream in the given encoding.

Parameters:
stream - Where the output should be written.
encoding - The desired character encoding.
Throws:
java.io.IOException

LTMTopicMapWriter

public LTMTopicMapWriter(java.io.Writer out)
Deprecated. 

PUBLIC: Create an LTMTopicMapWriter that writes to a given Writer.

Parameters:
out - Where the output should be written.

LTMTopicMapWriter

public LTMTopicMapWriter(java.io.Writer out,
                         java.lang.String encoding)
PUBLIC: Create an LTMTopicMapWriter that writes to a given Writer.

Parameters:
out - Where the output should be written.
encoding - The encoding used by the writer. This is the encoding that will be declared on the first line of the LTM file. It must be reported, because there is no way for the LTMTopicMapWriter to know what encoding the writer uses.
Since:
4.0
Method Detail

setPreserveIds

public void setPreserveIds(boolean preserveIds)
PUBLIC: Set whether IDs should be preserved or generated.

Parameters:
preserveIds - Should be set to true if IDs should be preserved.

setFilter

public void setFilter(DeciderIF filter)
PUBLIC: Sets the filter that decides which topic map constructs are accepted in the exprted ltm. Uses 'filter' to identify individual topic constructs as allowed or disallowed. TM constructs that depend on the disallowed topics are also disallowed.

Parameters:
filter - Places constraints on individual topicmap constructs.

write

public void write(TopicMapIF tm)
           throws java.io.IOException
PUBLIC: Writes out the given topic map.

Specified by:
write in interface TopicMapWriterIF
Parameters:
tm - The topic map to be exported/written; an object implementing TopicMapIF
Throws:
java.io.IOException - Thrown if writing the topic map fails.


Copyright © 2000-2012 Ontopia.