1 /* 2 * Enhydra Java Application Server Project 3 * 4 * The contents of this file are subject to the Enhydra Public License 5 * Version 1.1 (the "License"); you may not use this file except in 6 * compliance with the License. You may obtain a copy of the License on 7 * the Enhydra web site ( http://www.enhydra.org/ ). 8 * 9 * Software distributed under the License is distributed on an "AS IS" 10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 11 * the License for the specific terms governing rights and limitations 12 * under the License. 13 * 14 * The Initial Developer of the Enhydra Application Server is Lutris 15 * Technologies, Inc. The Enhydra Application Server and portions created 16 * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc. 17 * All Rights Reserved. 18 * 19 * Contributor(s): 20 * 21 * $Id: XMLCParser.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $ 22 */ 23 24 package org.enhydra.xml.xmlc.parsers; 25 26 import java.io.IOException; 27 28 import org.enhydra.xml.io.ErrorReporter; 29 import org.enhydra.xml.xmlc.XMLCException; 30 import org.enhydra.xml.xmlc.dom.XMLCDocument; 31 import org.enhydra.xml.xmlc.dom.XMLCDomFactory; 32 import org.enhydra.xml.xmlc.metadata.MetaData; 33 import org.enhydra.xml.xmlc.misc.LineNumberMap; 34 import org.xml.sax.InputSource; 35 import org.xml.sax.SAXException; 36 37 /** 38 * Interface for a class that specifies how to parse an XML file and provide 39 * information needed to compile that file into a XMLC object. The object 40 * must have a constructor that takes no arguments. The instance of the object 41 * will only be use to parse a single document. 42 */ 43 public interface XMLCParser { 44 /** 45 * Parse a XML file (or any file, such as HTML, that can be converted into 46 * XML). 47 * 48 * @param input The input source to parse. 49 * @param lineNumberMap If not null, a dynamic map of input stream 50 * line numbers and offsets to source files and line numbers. 51 * This object is dynamically updated as input is read. It may not 52 * have valid mappings for characeters that have not been read. 53 * @param domFactory The DOM factory object. 54 * @param metaData MetaData for the document. 55 * @param errorReporter Object for reporting errors during the parse. 56 * @param tracer Object for parser info tracing. 57 * @return A XMLC document object that contains the actual DOM Document. 58 * @exception XMLCException Thrown for fatal errors found parsing the 59 * document. 60 */ 61 public XMLCDocument parse(InputSource input, 62 LineNumberMap lineNumberMap, 63 XMLCDomFactory domFactory, 64 MetaData metaData, 65 ErrorReporter errorReporter, 66 ParseTracer tracer) 67 throws IOException, XMLCException, SAXException; 68 } 69