Package net.ontopia.topicmaps.xml
Class XTMTopicMapExporter
java.lang.Object
net.ontopia.topicmaps.xml.AbstractTopicMapExporter
net.ontopia.topicmaps.xml.XTMTopicMapExporter
- Direct Known Subclasses:
XTMFragmentExporter
INTERNAL: Exports topic maps to the XTM 1.0 interchange format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AttributesImplprotected static final AttributesImplprotected static final Stringprotected static final Stringprotected booleanFields inherited from class net.ontopia.topicmaps.xml.AbstractTopicMapExporter
add_ids, filter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexport(TopicMapIF tm) INTERNAL: Default export method.voidexport(TopicMapIF tm, ContentHandler dh) INTERNAL: Traverses a Topic Map and emits SAX document handler events according to the Topic Map interchange format to the given document handler.booleanINTERNAL: Returns true if configured to add IDs to all elements.booleanINTERNAL: Returns true if source locators should be exported.protected StringgetSubjectIndicatorRef(TopicIF topic, LocatorIF indicator) INTERNAL: This method is used to get the string form of the subject indicator of a topic.protected voidreportInvalidLocator(LocatorIF locator) voidsetAddIds(boolean add_ids) INTERNAL: Tells the exporter whether or not to add IDs to all elements.voidsetExportSourceLocators(boolean export_srclocs) INTERNAL: Set the flag that says whether source locators should be exported or not.protected voidwriteAssociation(AssociationIF assoc, ContentHandler dh) protected voidwriteInstanceOf(TopicIF topic, ContentHandler dh) protected voidwriteInstanceOf(TypedIF typed, ContentHandler dh) protected voidwriteMembers(Collection roles, ContentHandler dh) protected voidwriteOccurrences(Collection occurrences, ContentHandler dh) protected voidwriteParameters(VariantNameIF variant, ContentHandler dh) protected voidwriteRoleSpec(TopicIF topic, ContentHandler dh) protected voidwriteScope(Collection scope, ContentHandler dh) protected voidwriteSubjectIdentity(TopicIF topic, ContentHandler dh) protected voidwriteTopic(TopicIF topic, ContentHandler dh) protected voidwriteTopicNames(Collection names, ContentHandler dh) protected voidwriteTopicRef(TopicIF topic, ContentHandler dh) protected voidwriteVariantName(VariantNameIF variant, ContentHandler dh) protected voidwriteVariants(Collection variants, ContentHandler dh) Methods inherited from class net.ontopia.topicmaps.xml.AbstractTopicMapExporter
addId, filterCollection, filterOk, getElementId, isValidXMLId, mayCollide, setFilter
-
Field Details
-
atts
-
EMPTY_ATTR_LIST
-
EMPTY_NAMESPACE
- See Also:
-
EMPTY_LOCALNAME
- See Also:
-
export_srclocs
protected boolean export_srclocs
-
-
Constructor Details
-
XTMTopicMapExporter
public XTMTopicMapExporter()Used to initialize the XTM Exporter
-
-
Method Details
-
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
INTERNAL: Default export method. An XML pretty printer is used and the output is written to stdout.- Throws:
SAXExceptionIOException
-
export
INTERNAL: Traverses a Topic Map and emits SAX document handler events according to the Topic Map interchange format to the given document handler.- Throws:
SAXException
-
writeTopic
- Throws:
SAXException
-
writeInstanceOf
- Throws:
SAXException
-
writeInstanceOf
- Throws:
SAXException
-
writeTopicNames
- Throws:
SAXException
-
writeTopicRef
- Throws:
SAXException
-
getSubjectIndicatorRef
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
- Throws:
SAXException
-
writeVariants
- Throws:
SAXException
-
writeVariantName
- Throws:
SAXException
-
writeParameters
- Throws:
SAXException
-
writeScope
- Throws:
SAXException
-
writeOccurrences
- Throws:
SAXException
-
writeAssociation
- Throws:
SAXException
-
writeMembers
- Throws:
SAXException
-
writeRoleSpec
- Throws:
SAXException
-
reportInvalidLocator
-