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>DocumentSerializer</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>DocumentSerializer</code> object is created by a 34 * the <code>PluginFactory</code> {@link 35 * org.openoffice.xmerge.DocumentSerializerFactory#createDocumentSerializer 36 * createDocumentSerializer} method. When it is constructed, a 37 * "Office" <code>Document</code> object is passed in to 38 * be used as input.</p> 39 * 40 * @author Herbie Ong 41 * @see org.openoffice.xmerge.PluginFactory 42 * @see org.openoffice.xmerge.DocumentSerializerFactory 43 */ 44 public interface DocumentSerializer { 45 46 /** 47 * <p>Convert the data passed into the <code>DocumentSerializer</code> 48 * constructor into the "Device" <code>Document</code> 49 * format.</p> 50 * 51 * <p>This method may or may not be thread-safe. It is expected 52 * that the user code does not call this method in more than one 53 * thread. And for most cases, this method is only done once.</p> 54 * 55 * @return <code>ConvertData</code> object to pass back the 56 * converted data. 57 * 58 * @throws ConvertException If any conversion error occurs. 59 * @throws IOException If any I/O error occurs. 60 */ serialize()61 public ConvertData serialize() throws ConvertException, IOException; 62 } 63 64