KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > xml > Parser


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.xml;
9
10 import org.apache.avalon.framework.component.Component;
11 import org.w3c.dom.Document JavaDoc;
12 import org.xml.sax.ContentHandler JavaDoc;
13 import org.xml.sax.InputSource JavaDoc;
14 import org.xml.sax.SAXException JavaDoc;
15 import org.xml.sax.ext.LexicalHandler JavaDoc;
16
17 import java.io.IOException JavaDoc;
18
19 /**
20  *
21  * The parser can be used to parse any XML document given
22  * by a <code>InputSource</code> object.
23  * It can either send XML events or create a DOM from
24  * the parsed document.
25  *
26  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
27  * @version CVS $Revision: 1.5 $ $Date: 2001/12/11 09:53:38 $
28  */

29 public interface Parser extends Component {
30
31     String JavaDoc ROLE = "org.apache.avalon.excalibur.xml.Parser";
32
33     /**
34      * Parse the <code>InputSource</code> and send
35      * SAX events to the consumer.
36      * Attention: the consumer can either be an XMLConsumer
37      * or implement the <code>LexicalHandler</code> as well.
38      * The parse should take care of this.
39      */

40     void parse(InputSource JavaDoc in, ContentHandler JavaDoc consumer)
41     throws SAXException JavaDoc, IOException JavaDoc;
42
43     /**
44      * Parse the <code>InputSource</code> and create
45      * a DOM out of it.
46      */

47     Document JavaDoc parseDocument(InputSource JavaDoc in)
48     throws SAXException JavaDoc, IOException JavaDoc;
49 }
50
Popular Tags