net.ontopia.topicmaps.xml
Class XTMTopicMapExporter

java.lang.Object
  extended by net.ontopia.topicmaps.xml.AbstractTopicMapExporter
      extended by net.ontopia.topicmaps.xml.XTMTopicMapExporter
Direct Known Subclasses:
XTMFragmentExporter

public class XTMTopicMapExporter
extends AbstractTopicMapExporter

INTERNAL: Exports topic maps to the XTM 1.0 interchange format.


Field Summary
protected  org.xml.sax.helpers.AttributeListImpl atts
           
protected static org.xml.sax.helpers.AttributeListImpl EMPTY_ATTR_LIST
           
protected  boolean export_srclocs
           
 
Fields inherited from class net.ontopia.topicmaps.xml.AbstractTopicMapExporter
add_ids, filter
 
Constructor Summary
XTMTopicMapExporter()
          Used to initialize the XTM Exporter
 
Method Summary
 void export(TopicMapIF tm)
          INTERNAL: Default export method.
 void export(TopicMapIF tm, org.xml.sax.DocumentHandler dh)
          INTERNAL: Traverses a Topic Map and emits SAX document handler events according to the Topic Map interchange format to the given document handler.
 boolean getAddIds()
          INTERNAL: Returns true if configured to add IDs to all elements.
 boolean getExportSourceLocators()
          INTERNAL: Returns true if source locators should be exported.
protected  java.lang.String getSubjectIndicatorRef(TopicIF topic, LocatorIF indicator)
          INTERNAL: This method is used to get the string form of the subject indicator of a topic.
protected  void reportInvalidLocator(LocatorIF locator)
           
 void setAddIds(boolean add_ids)
          INTERNAL: Tells the exporter whether or not to add IDs to all elements.
 void setExportSourceLocators(boolean export_srclocs)
          INTERNAL: Set the flag that says whether source locators should be exported or not.
protected  void writeAssociation(AssociationIF assoc, org.xml.sax.DocumentHandler dh)
           
protected  void writeInstanceOf(TopicIF topic, org.xml.sax.DocumentHandler dh)
           
protected  void writeInstanceOf(TypedIF typed, org.xml.sax.DocumentHandler dh)
           
protected  void writeMembers(java.util.Collection roles, org.xml.sax.DocumentHandler dh)
           
protected  void writeOccurrences(java.util.Collection occurrences, org.xml.sax.DocumentHandler dh)
           
protected  void writeParameters(VariantNameIF variant, org.xml.sax.DocumentHandler dh)
           
protected  void writeRoleSpec(TopicIF topic, org.xml.sax.DocumentHandler dh)
           
protected  void writeScope(java.util.Collection scope, org.xml.sax.DocumentHandler dh)
           
protected  void writeSubjectIdentity(TopicIF topic, org.xml.sax.DocumentHandler dh)
           
protected  void writeTopic(TopicIF topic, org.xml.sax.DocumentHandler dh)
           
protected  void writeTopicNames(java.util.Collection names, org.xml.sax.DocumentHandler dh)
           
protected  void writeTopicRef(TopicIF topic, org.xml.sax.DocumentHandler dh)
           
protected  void writeVariantName(VariantNameIF variant, org.xml.sax.DocumentHandler dh)
           
protected  void writeVariants(java.util.Collection variants, org.xml.sax.DocumentHandler dh)
           
 
Methods inherited from class net.ontopia.topicmaps.xml.AbstractTopicMapExporter
addId, filterCollection, filterOk, getElementId, isValidXMLId, mayCollide, setFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

atts

protected org.xml.sax.helpers.AttributeListImpl atts

EMPTY_ATTR_LIST

protected static final org.xml.sax.helpers.AttributeListImpl EMPTY_ATTR_LIST

export_srclocs

protected boolean export_srclocs
Constructor Detail

XTMTopicMapExporter

public XTMTopicMapExporter()
Used to initialize the XTM Exporter

Method Detail

getExportSourceLocators

public boolean getExportSourceLocators()
INTERNAL: Returns true if source locators should be exported.


setExportSourceLocators

public void setExportSourceLocators(boolean export_srclocs)
INTERNAL: Set the flag that says whether source locators should be exported or not.


getAddIds

public boolean getAddIds()
INTERNAL: Returns true if configured to add IDs to all elements.

Since:
2.0

setAddIds

public void setAddIds(boolean add_ids)
INTERNAL: Tells the exporter whether or not to add IDs to all elements. (Default: true.)

Since:
2.0

export

public void export(TopicMapIF tm)
            throws org.xml.sax.SAXException,
                   java.io.IOException
INTERNAL: Default export method. An XML pretty printer is used and the output is written to stdout.

Throws:
org.xml.sax.SAXException
java.io.IOException

export

public void export(TopicMapIF tm,
                   org.xml.sax.DocumentHandler dh)
            throws org.xml.sax.SAXException
INTERNAL: Traverses a Topic Map and emits SAX document handler events according to the Topic Map interchange format to the given document handler.

Throws:
org.xml.sax.SAXException

writeTopic

protected void writeTopic(TopicIF topic,
                          org.xml.sax.DocumentHandler dh)
                   throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeInstanceOf

protected void writeInstanceOf(TopicIF topic,
                               org.xml.sax.DocumentHandler dh)
                        throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeInstanceOf

protected void writeInstanceOf(TypedIF typed,
                               org.xml.sax.DocumentHandler dh)
                        throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeTopicNames

protected void writeTopicNames(java.util.Collection names,
                               org.xml.sax.DocumentHandler dh)
                        throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeTopicRef

protected void writeTopicRef(TopicIF topic,
                             org.xml.sax.DocumentHandler dh)
                      throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getSubjectIndicatorRef

protected java.lang.String getSubjectIndicatorRef(TopicIF topic,
                                                  LocatorIF indicator)
INTERNAL: This method is used to get the string form of the subject indicator of a topic. If the subject indicator is the source locator of some object in the topic map, a special procedure is applied. If it is not, the address of the locator is just returned.

If the subject indicator is of the form "base#fragment", where base is the base address of the topic map store, the returned address is "#fragment". If not, but the indicator is used for reification, the returned address is "id" + the object ID of the reified object.

This procedure is employed to ensure that this method produces the same results as AbstractTopicMapExporter.getElementId, which is necessary to avoid breaking reification of local objects on export.


writeSubjectIdentity

protected void writeSubjectIdentity(TopicIF topic,
                                    org.xml.sax.DocumentHandler dh)
                             throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeVariants

protected void writeVariants(java.util.Collection variants,
                             org.xml.sax.DocumentHandler dh)
                      throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeVariantName

protected void writeVariantName(VariantNameIF variant,
                                org.xml.sax.DocumentHandler dh)
                         throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeParameters

protected void writeParameters(VariantNameIF variant,
                               org.xml.sax.DocumentHandler dh)
                        throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeScope

protected void writeScope(java.util.Collection scope,
                          org.xml.sax.DocumentHandler dh)
                   throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeOccurrences

protected void writeOccurrences(java.util.Collection occurrences,
                                org.xml.sax.DocumentHandler dh)
                         throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeAssociation

protected void writeAssociation(AssociationIF assoc,
                                org.xml.sax.DocumentHandler dh)
                         throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeMembers

protected void writeMembers(java.util.Collection roles,
                            org.xml.sax.DocumentHandler dh)
                     throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

writeRoleSpec

protected void writeRoleSpec(TopicIF topic,
                             org.xml.sax.DocumentHandler dh)
                      throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

reportInvalidLocator

protected void reportInvalidLocator(LocatorIF locator)


Copyright © 2000-2012 Ontopia.