public class XTMTopicMapWriter extends Object implements TopicMapWriterIF
Modifier and Type | Field and Description |
---|---|
protected boolean |
add_ids |
protected boolean |
export_srclocs |
protected Predicate |
filter |
protected ContentHandler |
out |
static String |
PROPERTY_ADD_IDS |
static String |
PROPERTY_EXPORT_SOURCE_LOCATORS |
static String |
PROPERTY_FILTER |
static String |
PROPERTY_VERSION |
protected Writer |
writer |
Constructor and Description |
---|
XTMTopicMapWriter(File file)
PUBLIC: Creates a topic map writer bound to the file given in the
arguments.
|
XTMTopicMapWriter(File file,
String encoding)
PUBLIC: Creates a topic map writer bound to the file given in the
arguments.
|
XTMTopicMapWriter(OutputStream stream,
String encoding)
PUBLIC: Creates a topic map writer bound to the output stream
given in the arguments.
|
XTMTopicMapWriter(Writer writer,
String encoding)
PUBLIC: Creates a topic map writer bound to the Writer given in
the arguments; we do not recommend the use of this
method.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAddIds()
PUBLIC: Returns true if configured to add IDs to all elements.
|
boolean |
getExportSourceLocators()
INTERNAL: Returns true if source locators should be exported.
|
void |
setAddIds(boolean add_ids)
PUBLIC: Tells the exporter whether or not to add IDs to all
elements.
|
void |
setAdditionalProperties(Map<String,Object> properties)
Sets additional properties for the XTMTopicMapWriter.
|
void |
setExportSourceLocators(boolean export_srclocs)
INTERNAL: Set the flag that says whether source locators should
be exported or not.
|
void |
setFilter(Predicate filter)
PUBLIC: Sets a filter used to filter the topic map before export.
|
void |
setVersion(XTMVersion version)
PUBLIC: Set XTM version to use on export.
|
void |
write(TopicMapIF topicmap)
PUBLIC: Writes the given topic map to an implicit implementation
dependent destination.
|
public static final String PROPERTY_ADD_IDS
public static final String PROPERTY_EXPORT_SOURCE_LOCATORS
public static final String PROPERTY_FILTER
public static final String PROPERTY_VERSION
protected ContentHandler out
protected Writer writer
protected Predicate filter
protected boolean export_srclocs
protected boolean add_ids
public XTMTopicMapWriter(File file) throws IOException
file
- The file object to which the topic map is to be written.IOException
public XTMTopicMapWriter(File file, String encoding) throws IOException
file
- The file object to which the topic map is to be written.encoding
- The character encoding to write the topic map in.IOException
public XTMTopicMapWriter(OutputStream stream, String encoding) throws IOException, UnsupportedEncodingException
stream
- The output stream to which the topic map is to be
written.encoding
- The character encoding to write the topic map in.UnsupportedEncodingException
- Thrown when the character
encoding is not supported by the Java environment.IOException
public XTMTopicMapWriter(Writer writer, String encoding) throws IOException
writer
- The Writer to which the topic map is to be
written.encoding
- The character encoding the Writer writes in.
Note that this must be set correctly, or the XML
document will not parse correctly.IOException
public void setFilter(Predicate filter)
public boolean getAddIds()
public void setAddIds(boolean add_ids)
public void setVersion(XTMVersion version)
public void write(TopicMapIF topicmap) throws IOException
TopicMapWriterIF
write
in interface TopicMapWriterIF
topicmap
- The topic map to be exported/written;
an object implementing TopicMapIFIOException
- Thrown if writing the topic map fails.public boolean getExportSourceLocators()
public void setExportSourceLocators(boolean export_srclocs)
public void setAdditionalProperties(Map<String,Object> properties)
setAddIds(boolean)
setExportSourceLocators(boolean)
setVersion(net.ontopia.topicmaps.xml.XTMVersion)
#setFilter(net.ontopia.utils.DeciderIF)
setAdditionalProperties
in interface TopicMapWriterIF
properties
-