KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > applications > packaging > util > ExtendedDocumentReader


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.applications.packaging.util;
11
12 import java.util.*;
13
14 import javax.xml.parsers.DocumentBuilder JavaDoc;
15
16 import org.mmbase.util.xml.DocumentReader;
17 import org.mmbase.util.*;
18 import org.w3c.dom.*;
19 import org.xml.sax.*;
20
21 /**
22  * XMLBasicReader has two goals.
23  * <ul>
24  * <li>It provides a way for parsing XML</li>
25  * <li>It provides a way for searching in this XML, without the need for an XPath implementation, and without the hassle of org.w3c.dom alone.
26  * It uses dots to lay a path in the XML (XPath uses slashes).</li>
27  * </ul>
28  *
29  * @author Case Roule
30  * @author Rico Jansen
31  * @author Pierre van Rooden
32  * @author Michiel Meeuwissen
33  * @version $Id: ExtendedDocumentReader.java,v 1.3 2005/07/09 15:29:12 nklasens Exp $
34  */

35 public class ExtendedDocumentReader extends XMLBasicReader {
36
37     public ExtendedDocumentReader(String JavaDoc path) {
38         super(path);
39     }
40
41     public ExtendedDocumentReader(String JavaDoc path, boolean validating) {
42         super(path, validating);
43     }
44
45     public ExtendedDocumentReader(String JavaDoc path, Class JavaDoc resolveBase) {
46         super(path, resolveBase);
47     }
48
49     public ExtendedDocumentReader(InputSource source) {
50         super(source, DocumentReader.validate(), null);
51     }
52
53     public ExtendedDocumentReader(InputSource source, boolean validating) {
54         super(source, validating, null);
55     }
56
57     public ExtendedDocumentReader(InputSource source, Class JavaDoc resolveBase) {
58         super(source, DocumentReader.validate(), resolveBase);
59     }
60
61     public ExtendedDocumentReader(InputSource source, boolean validating, Class JavaDoc resolveBase) {
62         super(source, validating, resolveBase);
63     }
64
65     public static DocumentBuilder JavaDoc getDocumentBuilder(boolean validating, ErrorHandler handler, EntityResolver resolver) {
66         return DocumentReader.getDocumentBuilder(validating, handler, resolver);
67     }
68
69     public static DocumentBuilder JavaDoc getDocumentBuilder(Class JavaDoc refer) {
70         return DocumentReader.getDocumentBuilder(DocumentReader.validate(), null, new XMLEntityResolver(DocumentReader.validate(), refer));
71     }
72 }
73
Popular Tags