public class TMXMLWriter extends AbstractTopicMapExporter implements TopicMapWriterIF
Modifier and Type | Field and Description |
---|---|
protected static AttributesImpl |
EMPTY_ATTR_LIST |
protected static String |
EMPTY_LOCALNAME |
protected static String |
EMPTY_NAMESPACE |
static String |
NS_ISO |
static String |
NS_TM |
static String |
NS_XTM |
static String |
PROPERTY_DOCUMENT_ELEMENT |
static String |
PROPERTY_PREFIXES |
static String |
XSD_ANYURI |
static String |
XSD_STRING |
add_ids, filter
Constructor and Description |
---|
TMXMLWriter(ContentHandler out)
INTERNAL: Creates a writer writing to the given ContentHandler.
|
TMXMLWriter(File out)
PUBLIC: Creates a writer writing to the given file in UTF-8.
|
TMXMLWriter(File out,
String encoding)
PUBLIC: Creates a writer writing to the given file in given encoding.
|
TMXMLWriter(OutputStream out,
String encoding) |
TMXMLWriter(Writer out)
PUBLIC: Creates a writer writing to the given writer in the utf-8
character encoding.
|
TMXMLWriter(Writer out,
String encoding)
PUBLIC: Creates a writer writing to the given writer in the given
character encoding.
|
Modifier and Type | Method and Description |
---|---|
void |
addPrefix(String prefix,
String nsuri) |
void |
close()
PUBLIC: Closes the Writer created for internal use.
|
void |
endTopicMap()
PUBLIC: Write the end tag of the document element (fragment mode
only).
|
void |
gatherPrefixes(Collection topics)
PUBLIC: Gets the namespace prefixes to be used (to be used in
fragment exporting mode only).
|
void |
gatherPrefixes(TopicIF topic)
PUBLIC: Gets the namespace prefixes to be used (to be used in
fragment exporting mode only).
|
String |
getDocumentElement()
PUBLIC: Returns the element type name of the document element.
|
Map |
getNamespaceURIMapping()
PRIVATE: Returns the namespace URI to prefix mapping maintained
internally by the writer.
|
protected String |
getSubjectIndicatorRef(TopicIF topic,
LocatorIF indicator) |
void |
setAdditionalProperties(Map<String,Object> properties)
Sets additional properties for the TMXMLWriter.
|
void |
setDocumentElement(String docelem)
PUBLIC: Sets the document element type name to use.
|
void |
startTopicMap(TopicMapIF topicmap)
PUBLIC: Writes the start tag of the document element (to be used
in fragment exporting only).
|
void |
write(TopicMapIF topicmap)
PUBLIC: Writes the given topic map to the underlying writer.
|
void |
writeTopic(TopicIF topic)
PUBLIC: Writes a single topic (fragment exporting mode only).
|
void |
writeTopics(Collection topics)
PUBLIC: Writes a set of topics (fragment exporting mode only).
|
addId, filterCollection, filterOk, getElementId, isValidXMLId, mayCollide, setFilter
public static final String PROPERTY_PREFIXES
public static final String PROPERTY_DOCUMENT_ELEMENT
protected static final AttributesImpl EMPTY_ATTR_LIST
protected static final String EMPTY_NAMESPACE
protected static final String EMPTY_LOCALNAME
public static final String NS_ISO
public static final String NS_XTM
public static final String NS_TM
public static final String XSD_ANYURI
public static final String XSD_STRING
public TMXMLWriter(Writer out) throws IOException
IOException
public TMXMLWriter(Writer out, String encoding) throws IOException, IOException, IOException
IOException
public TMXMLWriter(File out) throws IOException
IOException
public TMXMLWriter(File out, String encoding) throws IOException
IOException
public TMXMLWriter(OutputStream out, String encoding) throws IOException
IOException
public TMXMLWriter(ContentHandler out)
public void close() throws IOException
IOException
public String getDocumentElement()
public void setDocumentElement(String docelem)
public void write(TopicMapIF topicmap) throws IOException
write
in interface TopicMapWriterIF
topicmap
- The topic map to be exported.IOException
- Thrown if writing the topic map fails.public void startTopicMap(TopicMapIF topicmap) throws SAXException
SAXException
public void gatherPrefixes(Collection topics)
public void writeTopics(Collection topics) throws SAXException
SAXException
public void writeTopic(TopicIF topic) throws SAXException
SAXException
public void endTopicMap() throws SAXException
SAXException
public void gatherPrefixes(TopicIF topic)
public Map getNamespaceURIMapping()
public void setAdditionalProperties(Map<String,Object> properties)
setDocumentElement(java.lang.String)
addPrefix(java.lang.String, java.lang.String)
as Strings.setAdditionalProperties
in interface TopicMapWriterIF
properties
-