/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package org.openoffice.xmerge.converter.xml.sxw.aportisdoc;
import java.io.IOException;
import java.util.Iterator;
import org.openoffice.xmerge.ConvertData;
import org.openoffice.xmerge.ConvertException;
import org.openoffice.xmerge.Document;
import org.openoffice.xmerge.DocumentDeserializer;
import org.openoffice.xmerge.converter.palm.PalmDB;
import org.openoffice.xmerge.converter.palm.PalmDocument;
import org.openoffice.xmerge.converter.palm.Record;
import org.openoffice.xmerge.converter.xml.OfficeConstants;
import org.openoffice.xmerge.converter.xml.sxw.SxwDocument;
import org.openoffice.xmerge.util.Debug;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
/**
*
AportisDoc implementation of DocumentDeserializer
* for the {@link
* org.openoffice.xmerge.converter.xml.sxw.aportisdoc.PluginFactoryImpl
* PluginFactoryImpl}.
*
*
This converts an file in AportisDoc PDB format to StarOffice
* XML format.
*
*
The deserialize method uses a DocDecoder
* to read the AportisDoc format into a String object, then
* it calls buildDocument to create a SxwDocument
* object from it.
*
* @author Herbie Ong
*/
public final class DocumentDeserializerImpl
implements OfficeConstants, DocConstants, DocumentDeserializer {
/** A ConvertData object assigned to this object. */
private ConvertData cd = null;
/**
* Constructor that assigns the given ConvertData
* to this object as input.
*
* @param cd A ConvertData object to read data for
* the conversion process by the deserialize
* method.
*/
public DocumentDeserializerImpl(ConvertData cd) {
this.cd = cd;
}
/**
* Convert the given ConvertData object
* into a SxwDocument object.
*
* @return Resulting SxwDocument object.
*
* @throws ConvertException If any conversion error occurs.
* @throws IOException If any I/O error occurs.
*/
public Document deserialize() throws IOException, ConvertException {
Document doc = null;
Iterator