LibreOffice Module xmerge (master) 1
|
The Convert
class manages a conversion from one mime-type to another.
More...
Public Member Functions | |
Convert (ConverterInfo ci, boolean toOffice) | |
Construct a Convert class with specified ConvertInfo registry information. More... | |
void | addInputStream (String name, InputStream is) throws IOException |
Adds an InputStream to be used as input by the Convert class. More... | |
void | addInputStream (String name, InputStream is, boolean isZip) throws IOException |
Adds an InputStream to be used as input by the Convert class. More... | |
DocumentMerger | getDocumentMerger (Document origDoc) throws IOException |
Returns a DocumentMerger for the given Document . More... | |
Object | clone () |
Clones a Convert object so another Convert object can do the same conversion. More... | |
ConvertData | convert () throws ConvertException, IOException |
Convert the input specified in calls to the addInputStream method to the output format specified by this Convert class. More... | |
Document | getOfficeDocument (String name, InputStream is) throws IOException |
Returns the appropriate "Office" Document object for this plug-in. More... | |
Private Member Functions | |
void | reset () |
Resets the input queue, so that the user can use this class to perform another conversion. More... | |
Private Attributes | |
final ConverterInfo | ci |
ConvertInfo that corresponds to the from-mime/to-mime conversion. More... | |
final boolean | toOffice |
true if converting to the Office format, false if converting to the device format. More... | |
final ConvertData | inputCD = new ConvertData() |
Holds the convert input data. More... | |
The Convert
class manages a conversion from one mime-type to another.
The ConvertFactory
is responsible for returning the appropriate Convert
class for a specified conversion. This class is responsible for all interactions with the PluginFactory
implementation.
Definition at line 38 of file Convert.java.
|
inline |
Construct a Convert class with specified ConvertInfo
registry information.
ci | A ConvertInfo object containing registry information corresponding to a specific plug-in. |
toOffice | true if converting to the Office format, false if converting to the device format. |
Definition at line 61 of file Convert.java.
References org.openoffice.xmerge.Convert.ci, and org.openoffice.xmerge.Convert.toOffice.
Referenced by org.openoffice.xmerge.Convert.clone().
|
inline |
Adds an InputStream
to be used as input by the Convert
class.
It is possible that many files need to be converted into a single output Document
, so this function may be called more than one time. It is the plug-in's responsibility to know how to handle the input.
name | The name corresponding to the InputStream . |
is | InputStream to be used as input. |
IOException | If any I/O error occurs. |
Definition at line 80 of file Convert.java.
References org.openoffice.xmerge.ConvertData.addDocument(), org.openoffice.xmerge.Convert.ci, org.openoffice.xmerge.PluginFactory.createDeviceDocument(), org.openoffice.xmerge.PluginFactory.createOfficeDocument(), org.openoffice.xmerge.util.registry.ConverterInfo.getPluginFactory(), org.openoffice.xmerge.Convert.inputCD, name, and org.openoffice.xmerge.Convert.toOffice.
Referenced by XMergeBridge._XMergeBridge.convert(), org.openoffice.xmerge.util.ActiveSyncDriver.Convert(), and org.openoffice.xmerge.test.Driver.doConversion().
|
inline |
Adds an InputStream
to be used as input by the Convert
class.
It is possible that many files need to be converted into a single output Document
, so this function may be called more than one time. It is the plug-in's responsibility to know how to handle the input.
name | The name corresponding to the InputStream . |
is | InputStream to be used as input. |
isZip | boolean to identify that incoming stream is * zipped. |
IOException | If any I/O error occurs. |
Definition at line 108 of file Convert.java.
References org.openoffice.xmerge.ConvertData.addDocument(), org.openoffice.xmerge.Convert.ci, org.openoffice.xmerge.PluginFactory.createDeviceDocument(), org.openoffice.xmerge.PluginFactory.createOfficeDocument(), org.openoffice.xmerge.util.registry.ConverterInfo.getPluginFactory(), org.openoffice.xmerge.Convert.inputCD, name, and org.openoffice.xmerge.Convert.toOffice.
|
inline |
Clones a Convert
object so another Convert object can do the same conversion.
InputStream
objects passed in via calls to the addInputStream
method are not copied.
Convert
object. Definition at line 158 of file Convert.java.
References org.openoffice.xmerge.Convert.clone(), org.openoffice.xmerge.Convert.Convert(), Object, org.openoffice.xmerge.Convert.reset(), and System.
Referenced by org.openoffice.xmerge.Convert.clone().
|
inline |
Convert the input specified in calls to the addInputStream
method to the output format specified by this Convert
class.
ConvertException | If any conversion error occurs. |
IOException | If any I/O error occurs. |
Definition at line 181 of file Convert.java.
References org.openoffice.xmerge.ConvertData.addDocument(), org.openoffice.xmerge.Convert.ci, org.openoffice.xmerge.DocumentDeserializerFactory.createDocumentDeserializer(), org.openoffice.xmerge.DocumentSerializerFactory.createDocumentSerializer(), org.openoffice.xmerge.DocumentDeserializer.deserialize(), org.openoffice.xmerge.util.registry.ConverterInfo.getDocDeserializerFactory(), org.openoffice.xmerge.util.registry.ConverterInfo.getDocSerializerFactory(), org.openoffice.xmerge.ConvertData.getDocumentEnumeration(), org.openoffice.xmerge.Convert.inputCD, org.openoffice.xmerge.DocumentSerializer.serialize(), and org.openoffice.xmerge.Convert.toOffice.
Referenced by XMergeBridge._XMergeBridge.convert(), org.openoffice.xmerge.util.ActiveSyncDriver.Convert(), and org.openoffice.xmerge.test.Driver.doConversion().
|
inline |
Returns a DocumentMerger
for the given Document
.
origDoc | The Document were later changes will be merged to. |
DocumentMerger
object for the given document.IOException | If any I/O error occurs. |
Definition at line 131 of file Convert.java.
References org.openoffice.xmerge.Convert.ci, org.openoffice.xmerge.DocumentMergerFactory.createDocumentMerger(), and org.openoffice.xmerge.util.registry.ConverterInfo.getDocMergerFactory().
Referenced by org.openoffice.xmerge.test.Driver.doConversion().
|
inline |
Returns the appropriate "Office" Document
object for this plug-in.
name | The name of the Document to create. |
is | The InputStream corresponding to the Document to create. |
Document
object for this plug-in.IOException | If any I/O error occurs. |
Definition at line 229 of file Convert.java.
References org.openoffice.xmerge.Convert.ci, org.openoffice.xmerge.PluginFactory.createOfficeDocument(), org.openoffice.xmerge.util.registry.ConverterInfo.getPluginFactory(), and name.
Referenced by org.openoffice.xmerge.test.Driver.doConversion().
|
inlineprivate |
Resets the input queue, so that the user can use this class to perform another conversion.
This causes the addInputStream
method to accept input for the next conversion.
Definition at line 144 of file Convert.java.
References org.openoffice.xmerge.Convert.inputCD, and org.openoffice.xmerge.ConvertData.reset().
Referenced by org.openoffice.xmerge.Convert.clone().
|
private |
ConvertInfo that corresponds to the from-mime/to-mime conversion.
Definition at line 41 of file Convert.java.
Referenced by org.openoffice.xmerge.Convert.addInputStream(), org.openoffice.xmerge.Convert.convert(), org.openoffice.xmerge.Convert.Convert(), org.openoffice.xmerge.Convert.getDocumentMerger(), and org.openoffice.xmerge.Convert.getOfficeDocument().
|
private |
Holds the convert input data.
Definition at line 50 of file Convert.java.
Referenced by org.openoffice.xmerge.Convert.addInputStream(), org.openoffice.xmerge.Convert.convert(), and org.openoffice.xmerge.Convert.reset().
|
private |
true
if converting to the Office format, false
if converting to the device format.
Definition at line 47 of file Convert.java.
Referenced by org.openoffice.xmerge.Convert.addInputStream(), org.openoffice.xmerge.Convert.convert(), and org.openoffice.xmerge.Convert.Convert().