19package org.openoffice.xmerge.util.registry;
21import java.lang.reflect.Constructor;
23import java.net.URLClassLoader;
24import java.security.AccessController;
25import java.security.PrivilegedAction;
26import java.util.ArrayList;
27import java.util.Iterator;
81 ArrayList<String> deviceMime, String displayName,
82 String description, String version, String vendor,
83 String
impl,String xsltSerial, String xsltDeserial)
106 final URL jarURL =
new URL(jarName);
107 final URL[] urls =
new URL[] { jarURL };
108 URLClassLoader
loader = AccessController.doPrivileged(
109 new PrivilegedAction<URLClassLoader>() {
110 public URLClassLoader
run() {
116 Constructor<?> construct = clas.getConstructor(argumentTypes);
118 Object[] arguments = {
this };
124 for (
int i=0;
i < cl.length;
i++) {
126 if (cl[
i].getName().equals(
"org.openoffice.xmerge.DocumentSerializerFactory")) {
129 if (cl[
i].getName().equals(
"org.openoffice.xmerge.DocumentDeserializerFactory")) {
132 if (cl[
i].getName().equals(
"org.openoffice.xmerge.DocumentMergerFactory")) {
139 "Class implementation of the plug-in cannot be loaded.", e);
159 ArrayList<String> deviceMime, String displayName, String description,
160 String version, String vendor, String
impl)
163 if (officeMime ==
null || displayName ==
null || description ==
null ||
164 version ==
null || vendor ==
null ||
impl ==
null)
165 throw new IllegalArgumentException(
"arguments unexpected null");
169 "Invalid office type");
186 final URL jarURL =
new URL(jarName);
187 final URL[] urls =
new URL[] { jarURL };
188 URLClassLoader
loader = AccessController.doPrivileged(
189 new PrivilegedAction<URLClassLoader>() {
190 public URLClassLoader
run() {
196 Constructor<?> construct = clas.getConstructor(argumentTypes);
198 Object[] arguments = {
this };
204 for (
int i=0;
i < cl.length;
i++) {
206 if (cl[
i].getName().equals(
"org.openoffice.xmerge.DocumentSerializerFactory")) {
209 if (cl[
i].getName().equals(
"org.openoffice.xmerge.DocumentDeserializerFactory")) {
212 if (cl[
i].getName().equals(
"org.openoffice.xmerge.DocumentMergerFactory")) {
219 "Class implementation of the plug-in cannot be loaded.", e);
379 if (officeMime.equals(validOfficeType)) {
A PluginFactory encapsulates the conversions from one Document format to another.
Class for storing the information about a converter plug-in.
String getVersion()
Returns the version.
boolean canSerialize()
Returns true if this plug-in has a serializer, false otherwise.
PluginFactory piPluginFactory
static boolean isValidOfficeType(String officeMime)
Returns true if the officeMime is a valid Office mime type.
String getDescription()
Returns the description.
boolean canMerge()
Returns true if this plug-in has a merger, false otherwise.
String getDisplayName()
Returns the display name.
final ArrayList< String > piDeviceMime
final ClassLoader piClassLoader
String getVendor()
Returns the vendor name.
String getJarName()
Returns the jar file name.
final String piOfficeMime
final String piDisplayName
ConverterInfo(String jarName, String officeMime, ArrayList< String > deviceMime, String displayName, String description, String version, String vendor, String impl)
The constructor builds a ConverterInfo structure.
static final String[] validOfficeTypes
Keep track of the valid Office mime types.
String getOfficeMime()
Returns the office mime-type.
final String piDescription
ConverterInfo(String jarName, String officeMime, ArrayList< String > deviceMime, String displayName, String description, String version, String vendor, String impl, String xsltSerial, String xsltDeserial)
The constructor builds a ConverterInfo structure.
DocumentSerializerFactory getDocSerializerFactory()
Returns an instance of the DocumentDeserializerFactory interface.
DocumentDeserializerFactory getDocDeserializerFactory()
Returns an instance of the DocumentSerializerFactory interface.
String getXsltDeserial()
Returns a String containing the xslt stylesheet URL that is to be used by the Xslt Plug-in Deserializ...
PluginFactory getPluginFactory()
Returns the PluginFactory instance for this plug-in.
String getXsltSerial()
Returns a String containing the Xslt stylesheet URL that is to be used by the Xslt Plug-in Serializer...
boolean canDeserialize()
Returns true if this plug-in has a deserializer, false otherwise.
String getClassImpl()
Returns the implementation class name of PluginFactory.
DocumentMergerFactory getDocMergerFactory()
Returns an instance of the DocumentMergerFactory interface.
Iterator< String > getDeviceMime()
Returns an Enumeration of String objects indicating the device mime-type.
This Exception is thrown by converter registry algorithms.
A DocumentDeserializer object is used to convert from the "Device" Document format to the "Office" Do...
All plug-in implementations of the PluginFactory interface that also support merging must also implem...
A DocumentSerializer object is used to convert from the "Office" Document format to the "Device" Docu...
def run(arg=None, arg2=-1)
Provides an interface for plug-in registration.
Provides general purpose utilities.
Provides interfaces for converting between two Document formats, and supports a "merge" interface for...
PyRef getClass(const OUString &name, const Runtime &runtime)