OpenOffice.org
XMerge API

org.openoffice.xmerge.converter.xml.xslt
Class PluginFactoryImpl

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

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

Xslt implementation of the PluginFactory. This encapsulates conversion of StarWriter XML format to and from a supported format.

The superclass produces a particular Document object, i.e. SxwDocument that the converters in this class work with. Thus, this class only implements the methods that produces the converters, i.e. DocumentSerializer and DocumentDeserializer


Constructor Summary
PluginFactoryImpl(ConverterInfo ci)
           
 
Method Summary
 Document createDeviceDocument(java.lang.String str, java.io.InputStream inputStream)
          Create a Document object that corresponds to the device data passed in via the InputStream object.
 DocumentDeserializer createDocumentDeserializer(ConvertData cd)
          Returns an instance of DocumentDeserializerImpl, which is an implementation of the DocumentDeserializer interface.
 DocumentMerger createDocumentMerger(Document doc)
          Returns an instance of DocumentMergerImpl, which is an implementation of the DocumentMerger interface.
 DocumentSerializer createDocumentSerializer(Document doc)
          Returns an instance of DocumentSerializerImpl, which is an implementation of the DocumentSerializer interface.
 Document createOfficeDocument(java.lang.String name, java.io.InputStream is)
          Create a Document object that corresponds to the Office data passed in via the InputStream object.
 Document createOfficeDocument(java.lang.String name, java.io.InputStream is, boolean isZip)
          Create a Document object that corresponds to the Office data passed in via the InputStream object.
 java.lang.String getDeviceFileExtension()
          Returns a String containing the file extension of a Document.
 
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)
Method Detail

createDeviceDocument

public Document createDeviceDocument(java.lang.String str,
                                     java.io.InputStream inputStream)
                              throws java.io.IOException
Description copied from class: PluginFactory

Create a Document object that corresponds to the device data passed in via the InputStream object. This abstract method must be implemented for each plug-in.

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 PluginFactory to process, like a DocumentSerializer object and a DocumentMerger object.

Overrides:
createDeviceDocument in class PluginFactory
Following copied from class: org.openoffice.xmerge.PluginFactory
Parameters:
name - The Document name.
is - InputStream object corresponding to the Document.
Returns:
A Document object representing the particular Document format for the PluginFactory.
Throws:
java.io.IOException - If any I/O error occurs.

createDocumentDeserializer

public DocumentDeserializer createDocumentDeserializer(ConvertData cd)
Returns an instance of DocumentDeserializerImpl, which is an implementation of the DocumentDeserializer interface.
Specified by:
createDocumentDeserializer in interface DocumentDeserializerFactory
Parameters:
is - ConvertData object.
Returns:
A DocumentDeserializerImpl 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)
Returns an instance of DocumentSerializerImpl, which is an implementation of the DocumentSerializer interface.
Specified by:
createDocumentSerializer in interface DocumentSerializerFactory
Parameters:
doc - Document object to be converted/serialized.
Returns:
A DocumentSerializerImpl object.

createOfficeDocument

public Document createOfficeDocument(java.lang.String name,
                                     java.io.InputStream is)
                              throws java.io.IOException
Description copied from class: PluginFactory

Create a Document object that corresponds to the Office data passed in via the InputStream object. This abstract method must be implemented for each plug-in.

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 PluginFactory to process, like a DocumentSerializer object and a DocumentMerger object.

Overrides:
createOfficeDocument in class PluginFactory
Following copied from class: org.openoffice.xmerge.PluginFactory
Parameters:
name - The Document name.
is - InputStream object corresponding to the Document.
Returns:
A Document object representing the particular Document format for the PluginFactory.
Throws:
java.io.IOException - If any I/O error occurs.

createOfficeDocument

public Document createOfficeDocument(java.lang.String name,
                                     java.io.InputStream is,
                                     boolean isZip)
                              throws java.io.IOException
Description copied from class: PluginFactory

Create a Document object that corresponds to the Office data passed in via the InputStream object. This abstract method must be implemented for each plug-in.

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 PluginFactory to process, like a DocumentSerializer object and a DocumentMerger object.

Overrides:
createOfficeDocument in class PluginFactory
Following copied from class: org.openoffice.xmerge.PluginFactory
Parameters:
name - The Document name.
is - InputStream object corresponding to the Document.
isZip - boolean to show that the created office document is to be zipped.
Returns:
A Document object representing the particular Document format for the PluginFactory.
Throws:
java.io.IOException - If any I/O error occurs.

getDeviceFileExtension

public java.lang.String getDeviceFileExtension()
Returns a String containing the file extension of a Document. This method uses a properties file to determine a mapping from the device mime in the ConverterInfo to a particular file extension. If a mapping is not specified, the default is ".txt".
Returns:
String.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org