Package net.ontopia.topicmaps.xml
Class AbstractTopicMapExporter
java.lang.Object
net.ontopia.topicmaps.xml.AbstractTopicMapExporter
- Direct Known Subclasses:
TMXMLWriter,XTM2TopicMapExporter,XTMTopicMapExporter
INTERNAL: Abstract class providing common operations used by XML
exporters.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddId(AttributesImpl atts, TMObjectIF tmobject) protected CollectionfilterCollection(Collection unfiltered) Filter a whole collection of objects.protected booleanINTERNAL: Filter a single object.getElementId(TMObjectIF tmobject) INTERNAL: Method used to extract the XTM element id from a topic map object when a source locator relative to the topic map base address exists.protected booleanisValidXMLId(String id) INTERNAL: Used to test whether the ID is a syntactically valid XML ID.static booleanmayCollide(String id) INTERNAL: Used to find out whether this ID may collide with IDs produced from object IDs.voidPUBLIC: Sets the filter that decides which topic map constructs are accepted in the exported TM/XML.
-
Field Details
-
EMPTY_NAMESPACE
- See Also:
-
EMPTY_LOCALNAME
- See Also:
-
filter
-
add_ids
protected boolean add_idsINTERNAL: Whether or not IDs should be added to all elements.
-
-
Constructor Details
-
AbstractTopicMapExporter
public AbstractTopicMapExporter()
-
-
Method Details
-
setFilter
PUBLIC: Sets the filter that decides which topic map constructs are accepted in the exported TM/XML. 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.- Since:
- 3.2
-
filterCollection
Filter a whole collection of objects.- Parameters:
unfiltered- The objects to filter.- Returns:
- A new collection containing all objects accepted by the filter, or if this.filter is null, returns the original collection.
-
filterOk
INTERNAL: Filter a single object.- Parameters:
unfiltered- The object to filter.- Returns:
- True if the object is accepted by the filter or the filter is null. False otherwise.
-
addId
-
getElementId
INTERNAL: Method used to extract the XTM element id from a topic map object when a source locator relative to the topic map base address exists.This method is critical because we want to preserve the connection between subject indicators used to reify local objects, and at the same time we wish to keep the symbolic IDs often used in XTM and LTM files.
When setting the IDs of elements we set the ID to "fragment" if the object has a source locator of the form "base#fragment", where base is the base address of the topic map store. If no such source locator is found, the ID becomes "id" + object ID.
See the getSubjectIndicatorRef method in XTMTopicMapExporter to see how subject indicators are exported. Synchronization of these two methods is vital.
-
mayCollide
INTERNAL: Used to find out whether this ID may collide with IDs produced from object IDs. See bug #654. Works for both id234234 and idT234234. -
isValidXMLId
INTERNAL: Used to test whether the ID is a syntactically valid XML ID.
-