1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package org.openoffice.xmerge; 25 26 import java.io.IOException; 27 28 /** 29 * <p>A <code>DocumentSerializer2</code> represents a converter that 30 * converts a "Office" <code>Document</code> to a 31 * "Device" <code>Document</code> format.</p> 32 * 33 * <p>The <code>PluginFactory</code> {@link 34 * org.openoffice.xmerge.DocumentSerializerFactory#createDocumentSerializer 35 * createDocumentSerializer} method creates a <code>DocumentSerializer</code>, 36 * which may or may not implement <code>DocumentSerializer2</code>. 37 * When it is constructed, a 38 * "Office" <code>Document</code> object is passed in to 39 * be used as input.</p> 40 * 41 * @author Henrik Just 42 * @see org.openoffice.xmerge.PluginFactory 43 * @see org.openoffice.xmerge.DocumentSerializerFactory 44 */ 45 public interface DocumentSerializer2 extends DocumentSerializer { 46 47 /** 48 * <p>Convert the data passed into the <code>DocumentSerializer2</code> 49 * constructor into the "Device" <code>Document</code> 50 * format. The URL's passed may be used to resolve links and to name 51 * the output device document(s).</p> 52 * 53 * <p>This method may or may not be thread-safe. It is expected 54 * that the user code does not call this method in more than one 55 * thread. And for most cases, this method is only done once.</p> 56 * 57 * @return <code>ConvertData</code> object to pass back the 58 * converted data. 59 * 60 * @param officeURL URL of the office document (may be null if unknown) 61 * @param deviceURL URL of the device document (may be null if unknown) 62 * 63 * @throws ConvertException If any conversion error occurs. 64 * @throws IOException If any I/O error occurs. 65 */ serialize(String officeURL, String deviceURL)66 public ConvertData serialize(String officeURL, String deviceURL) throws 67 ConvertException, IOException; 68 } 69 70