All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.enhydra.xml.xmlc.parsers.XMLCParser Maven / Gradle / Ivy

The newest version!
/*
 * Enhydra Java Application Server Project
 * 
 * The contents of this file are subject to the Enhydra Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License on
 * the Enhydra web site ( http://www.enhydra.org/ ).
 * 
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 
 * the License for the specific terms governing rights and limitations
 * under the License.
 * 
 * The Initial Developer of the Enhydra Application Server is Lutris
 * Technologies, Inc. The Enhydra Application Server and portions created
 * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
 * All Rights Reserved.
 * 
 * Contributor(s):
 * 
 * $Id: XMLCParser.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $
 */

package org.enhydra.xml.xmlc.parsers;

import java.io.IOException;

import org.enhydra.xml.io.ErrorReporter;
import org.enhydra.xml.xmlc.XMLCException;
import org.enhydra.xml.xmlc.dom.XMLCDocument;
import org.enhydra.xml.xmlc.dom.XMLCDomFactory;
import org.enhydra.xml.xmlc.metadata.MetaData;
import org.enhydra.xml.xmlc.misc.LineNumberMap;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

/**
 * Interface for a class that specifies how to parse an XML file and provide
 * information needed to compile that file into a XMLC object.  The object
 * must have a constructor that takes no arguments. The instance of the object
 * will only be use to parse a single document.
 */
public interface XMLCParser {
    /**
     * Parse a XML file (or any file, such as HTML, that can be converted into
     * XML).
     *
     * @param input The input source to parse.
     * @param lineNumberMap If not null, a dynamic map of input stream
     *  line numbers and offsets to source files and line numbers.
     *  This object is dynamically updated as input is read.  It may not
     *  have valid mappings for characeters that have not been read.
     * @param domFactory The DOM factory object.
     * @param metaData MetaData for the document.
     * @param errorReporter Object for reporting errors during the parse.
     * @param tracer Object for parser info tracing.
     * @return A XMLC document object that contains the actual DOM Document.
     * @exception XMLCException Thrown for fatal errors found parsing the
     *  document.
     */
    public XMLCDocument parse(InputSource input,
                              LineNumberMap lineNumberMap,
                              XMLCDomFactory domFactory,
                              MetaData metaData,
                              ErrorReporter errorReporter,
                              ParseTracer tracer)
        throws IOException, XMLCException, SAXException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy