OpenOffice.org
XMerge API

org.openoffice.xmerge.converter.xml.sxw.pocketword
Class PluginFactoryImpl

java.lang.Object
  |
  +--org.openoffice.xmerge.PluginFactory
        |
        +--org.openoffice.xmerge.converter.xml.sxw.SxwPluginFactory
              |
              +--org.openoffice.xmerge.converter.xml.sxw.pocketword.PluginFactoryImpl
All Implemented Interfaces:
DocumentDeserializerFactory, DocumentMergerFactory, DocumentSerializerFactory

public final class PluginFactoryImpl
extends SxwPluginFactory
implements DocumentDeserializerFactory, DocumentSerializerFactory, DocumentMergerFactory

Factory class used to create converters to/from the Pocket Word format.

Version:
1.1

Constructor Summary
PluginFactoryImpl(ConverterInfo ci)
          Constructor that caches the ConvertInfo that corresponds to the registry information for this plug-in.
 
Method Summary
 Document createDeviceDocument(java.lang.String name, java.io.InputStream is)
          Create a Document object that corresponds to the Pocket Word data passed in via the InputStream object.
 DocumentDeserializer createDocumentDeserializer(ConvertData cd)
          The DocumentDeserializer is used to convert from the Pocket Word Document format to the OpenOffice Writer Document format.
 DocumentMerger createDocumentMerger(Document doc)
          Returns an instance of DocumentMergerImpl, which is an implementation of the DocumentMerger interface.
 DocumentSerializer createDocumentSerializer(Document doc)
          The DocumentSerializer is used to convert from the OpenOffice Writer Document format to the Pocket Word Document format.
 
Methods inherited from class org.openoffice.xmerge.converter.xml.sxw.SxwPluginFactory
createOfficeDocument, createOfficeDocument
 
Methods inherited from class org.openoffice.xmerge.PluginFactory
getConverterInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginFactoryImpl

public PluginFactoryImpl(ConverterInfo ci)

Constructor that caches the ConvertInfo that corresponds to the registry information for this plug-in.

Parameters:
ci - ConvertInfo object.
Method Detail

createDeviceDocument

public Document createDeviceDocument(java.lang.String name,
                                     java.io.InputStream is)
                              throws java.io.IOException

Create a Document object that corresponds to the Pocket Word data passed in via the InputStream object.

This method will read from the given InputStream object. The returned Document object will contain the necessary data for the other objects created by the PluginFactoryImpl to process, like the DocumentSerializerImpl object and a DocumentMerger object.

Overrides:
createDeviceDocument in class PluginFactory
Parameters:
name - The Document name.
is - InputStream object corresponding to the Document.
Returns:
A Document object representing the Pocket Word format.
Throws:
java.io.IOException - If any I/O error occurs.

createDocumentDeserializer

public DocumentDeserializer createDocumentDeserializer(ConvertData cd)
The DocumentDeserializer is used to convert from the Pocket Word Document format to the OpenOffice Writer Document format.

The ConvertData object is passed along to the created DocumentDeserializer via its constructor. The ConvertData is read and converted when the the DocumentDeserializer object's deserialize method is called.

Specified by:
createDocumentDeserializer in interface DocumentDeserializerFactory
Parameters:
cd - ConvertData object that the created DocumentDeserializer object uses as input.
Returns:
A DocumentDeserializer object.

createDocumentMerger

public DocumentMerger createDocumentMerger(Document doc)
Returns an instance of DocumentMergerImpl, which is an implementation of the DocumentMerger interface.
Specified by:
createDocumentMerger in interface DocumentMergerFactory
Parameters:
doc - Document to merge.
Returns:
A DocumentMergerImpl object.

createDocumentSerializer

public DocumentSerializer createDocumentSerializer(Document doc)

The DocumentSerializer is used to convert from the OpenOffice Writer Document format to the Pocket Word Document format.

The ConvertData object is passed along to the created DocumentSerializer via its constructor. The ConvertData is read and converted when the the DocumentSerializer object's serialize method is called.

Specified by:
createDocumentSerializer in interface DocumentSerializerFactory
Parameters:
doc - Document object that the created DocumentSerializer object uses as input.
Returns:
A DocumentSerializer object.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org