public abstract class DocumentExporter extends AbstractResource
Modifier and Type | Field and Description |
---|---|
protected String |
defaultExtension |
protected String |
fileType |
protected FileFilter |
filter |
protected String |
mimeType |
name
features
Constructor and Description |
---|
DocumentExporter(String fileType,
String defaultExtension,
String mimeType)
Creates a new exporter instance for a given file type with default
extension.
|
Modifier and Type | Method and Description |
---|---|
void |
export(Document doc,
File file)
Equivalent to
export(Document,File,FeatureMap) with an empty map
of options. |
void |
export(Document doc,
File file,
FeatureMap options)
Equivalent to
export(Document,OutputStream,FeatureMap) using a
FileOutputStream instance constructed from the File param. |
void |
export(Document doc,
OutputStream out)
Equivalent to
export(Document,OutputStream) with an empty
map of options. |
abstract void |
export(Document doc,
OutputStream out,
FeatureMap options)
Exports the provided
Document instance to the specified
OutputStream using the specified options. |
String |
getDefaultExtension()
The default extension added to files saved in this format
|
FileFilter |
getFileFilter()
A filter used in the file chooser to restrict the view to files of
this type.
|
String |
getFileType()
The name of the file type exported
|
static DocumentExporter |
getInstance(String className) |
String |
getMimeType() |
String |
getName()
Returns the name of this resource
|
checkParameterValues, cleanup, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getParameterValue, getParameterValue, getParameterValues, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toString
getFeatures, setFeatures
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFeatures, setFeatures
protected String fileType
protected String defaultExtension
protected String mimeType
protected FileFilter filter
public DocumentExporter(String fileType, String defaultExtension, String mimeType)
fileType
- this is the human readable file type name that will
appear on the menudefaultExtension
- the default file extension for this typepublic String getFileType()
public String getDefaultExtension()
public String getName()
AbstractResource
getName
in interface NameBearer
getName
in class AbstractResource
public String getMimeType()
public FileFilter getFileFilter()
public void export(Document doc, File file) throws IOException
export(Document,File,FeatureMap)
with an empty map
of options.IOException
public void export(Document doc, File file, FeatureMap options) throws IOException
export(Document,OutputStream,FeatureMap)
using a
FileOutputStream instance constructed from the File param.IOException
public void export(Document doc, OutputStream out) throws IOException
export(Document,OutputStream)
with an empty
map of options.IOException
public abstract void export(Document doc, OutputStream out, FeatureMap options) throws IOException
Document
instance to the specified
OutputStream
using the specified options.doc
- the document to exportout
- the OutputStream to export the document tooptions
- DocumentExporter specific optionsIOException
public static DocumentExporter getInstance(String className)
Copyright © 2024 GATE. All rights reserved.