public class LTMTopicMapWriter extends Object implements TopicMapWriterIF
Constructor and Description |
---|
LTMTopicMapWriter(File file)
PUBLIC: Create an LTMTopicMapWriter that writes to a given
File in UTF-8.
|
LTMTopicMapWriter(File file,
String encoding)
PUBLIC: Create an LTMTopicMapWriter that writes to a given
File in specified encoding.
|
LTMTopicMapWriter(OutputStream stream)
PUBLIC: Create an LTMTopicMapWriter that writes to a given
OutputStream in UTF-8.
|
LTMTopicMapWriter(OutputStream stream,
String encoding)
PUBLIC: Create an LTMTopicMapWriter that writes to a given
OutputStream in the given encoding.
|
LTMTopicMapWriter(Writer out,
String encoding)
PUBLIC: Create an LTMTopicMapWriter that writes to a given Writer.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addPrefix(String key,
String prefix) |
void |
setAdditionalProperties(Map<String,Object> properties)
Sets additional properties for LTMTopicMapWriter.
|
void |
setFilter(Predicate<Object> 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.
|
public static final String PROPERTY_PREFIXES
public static final String PROPERTY_FILTER
public static final String PROPERTY_PRESERVE_IDS
protected String encoding
protected boolean preserveIds
protected Writer out
protected boolean closeWriter
protected Calendar calendar
protected String base
protected Comparator<AssociationIF> associationComparator
protected Comparator<TopicNameIF> baseNameComparator
protected Comparator<TopicIF> elementIdComparator
protected Comparator<AssociationIF> supersubComparator
protected Comparator<AssociationRoleIF> supersubRoleComparator
protected Comparator<OccurrenceIF> occurrenceComparator
protected Comparator<Collection<TopicIF>> reifierComparator
protected Comparator<AssociationRoleIF> roleComparator
protected Comparator<Collection<TopicIF>> scopeComparator
protected Comparator<TopicIF> topicComparator
protected Comparator<VariantNameIF> variantComparator
protected net.ontopia.topicmaps.utils.ltm.LTMTopicMapWriter.IdManager idManager
protected String groupString1
public LTMTopicMapWriter(File file) throws IOException
file
- Where the output should be written to.IOException
public LTMTopicMapWriter(File file, String encoding) throws IOException
file
- Where the output should be written to.encoding
- The desired character encoding.IOException
public LTMTopicMapWriter(OutputStream stream) throws IOException
stream
- Where the output should be written.IOException
public LTMTopicMapWriter(OutputStream stream, String encoding) throws IOException
stream
- Where the output should be written.encoding
- The desired character encoding.IOException
public LTMTopicMapWriter(Writer out, String encoding)
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.public void setPreserveIds(boolean preserveIds)
preserveIds
- Should be set to true if IDs should be preserved.public void setFilter(Predicate<Object> filter)
filter
- Places constraints on individual topicmap constructs.public void write(TopicMapIF tm) throws IOException
write
in interface TopicMapWriterIF
tm
- The topic map to be exported/written;
an object implementing TopicMapIFIOException
- Thrown if writing the topic map fails.public void setAdditionalProperties(Map<String,Object> properties)
setPreserveIds(boolean)
#setFilter(net.ontopia.utils.DeciderIF)
addPrefix(java.lang.String, java.lang.String)
as Strings.setAdditionalProperties
in interface TopicMapWriterIF
properties
-