LibreOffice Module xmerge (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
org.openoffice.xmerge.Convert Class Reference

The Convert class manages a conversion from one mime-type to another. More...

Inheritance diagram for org.openoffice.xmerge.Convert:
[legend]
Collaboration diagram for org.openoffice.xmerge.Convert:
[legend]

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...
 

Detailed Description

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.

See also
ConverterFactory
PluginFactory
org.openoffice.xmerge.util.registry.ConverterInfo

Definition at line 38 of file Convert.java.

Constructor & Destructor Documentation

◆ Convert()

org.openoffice.xmerge.Convert.Convert ( ConverterInfo  ci,
boolean  toOffice 
)
inline

Construct a Convert class with specified ConvertInfo registry information.

Parameters
ciA ConvertInfo object containing registry information corresponding to a specific plug-in.
toOfficetrue 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().

Member Function Documentation

◆ addInputStream() [1/2]

void org.openoffice.xmerge.Convert.addInputStream ( String  name,
InputStream  is 
) throws IOException
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.

Parameters
nameThe name corresponding to the InputStream.
isInputStream to be used as input.
Exceptions
IOExceptionIf 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().

◆ addInputStream() [2/2]

void org.openoffice.xmerge.Convert.addInputStream ( String  name,
InputStream  is,
boolean  isZip 
) throws IOException
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.

Parameters
nameThe name corresponding to the InputStream.
isInputStream to be used as input.
isZipboolean to identify that incoming stream is * zipped.
Exceptions
IOExceptionIf 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.

◆ clone()

Object org.openoffice.xmerge.Convert.clone ( )
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.

Returns
The cloned 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().

◆ convert()

ConvertData org.openoffice.xmerge.Convert.convert ( ) throws ConvertException, IOException
inline

◆ getDocumentMerger()

DocumentMerger org.openoffice.xmerge.Convert.getDocumentMerger ( Document  origDoc) throws IOException
inline

Returns a DocumentMerger for the given Document.

Parameters
origDocThe Document were later changes will be merged to.
Returns
The DocumentMerger object for the given document.
Exceptions
IOExceptionIf 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().

◆ getOfficeDocument()

Document org.openoffice.xmerge.Convert.getOfficeDocument ( String  name,
InputStream  is 
) throws IOException
inline

Returns the appropriate "Office" Document object for this plug-in.

Parameters
nameThe name of the Document to create.
isThe InputStream corresponding to the Document to create.
Returns
The appropriate "Office" Document object for this plug-in.
Exceptions
IOExceptionIf 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().

◆ reset()

void org.openoffice.xmerge.Convert.reset ( )
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().

Member Data Documentation

◆ ci

final ConverterInfo org.openoffice.xmerge.Convert.ci
private

◆ inputCD

final ConvertData org.openoffice.xmerge.Convert.inputCD = new ConvertData()
private

◆ toOffice

final boolean org.openoffice.xmerge.Convert.toOffice
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().


The documentation for this class was generated from the following file: