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>DocumentDeserializer</code> represents a converter that 30 * converts "Device" <code>Document</code> objects into the 31 * "Office" <code>Document</code> format.</p> 32 * 33 * <p>The <code>PluginFactory</code> {@link 34 * org.openoffice.xmerge.DocumentDeserializerFactory#createDocumentDeserializer 35 * createDocumentDeserializer} method creates a <code>DocumentDeserializer</code>, 36 * which may or may not implement <code>DocumentDeserializer2</code>. 37 * When it is constructed, a 38 * <code>ConvertData</code> object is passed in to be used as input.</p> 39 * 40 * @author Henrik Just 41 * @see org.openoffice.xmerge.PluginFactory 42 * @see org.openoffice.xmerge.DocumentDeserializerFactory 43 */ 44 public interface DocumentDeserializer2 extends DocumentSerializer { 45 46 /** 47 * <p>Convert the data passed into the <code>DocumentDeserializer2</code> 48 * constructor into the "Office" <code>Document</code> 49 * format. The URL's passed may be used to resolve links and to choose the 50 * name of the output office document.</p> 51 * 52 * <p>This method may or may not be thread-safe. It is expected 53 * that the user code does not call this method in more than one 54 * thread. And for most cases, this method is only done once.</p> 55 * 56 * @return The resulting <code>Document</code> object from conversion. 57 * 58 * @param deviceURL URL of the device document (may be null if unknown) 59 * @param officeURL URL of the office document (may be null if unknown) 60 * 61 * @throws ConvertException If any Convert error occurs. 62 * @throws IOException If any I/O error occurs. 63 */ deserialize(String deviceURL, String officeURL)64 public Document deserialize(String deviceURL, String officeURL) throws 65 ConvertException, IOException; 66 } 67 68