KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > xml2 > XMLParserImpl


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Scott Ferguson
28  */

29
30 package com.caucho.xml2;
31
32 import com.caucho.xml.QName;
33
34 import org.xml.sax.*;
35
36 import java.io.IOException JavaDoc;
37 import java.util.Locale JavaDoc;
38
39 /**
40  * A fast XML parser.
41  */

42 public class XMLParserImpl implements Parser {
43   // Xerces uses the following
44
public static final String JavaDoc XMLNS = "http://www.w3.org/2000/xmlns/";
45
46   static final QName DOC_NAME = new QName(null, "#document", null);
47   static final QName TEXT_NAME = new QName(null, "#text", null);
48   static final QName JSP_NAME = new QName(null, "#jsp", null);
49   static final QName WHITESPACE_NAME = new QName(null, "#whitespace", null);
50   static final QName JSP_ATTRIBUTE_NAME = new QName("xtp", "jsp-attribute", null);
51
52   private EntityResolver _entityResolver;
53   private ErrorHandler _errorHandler;
54   private DocumentHandler _documentHandler;
55   private DTDHandler _dtdHandler;
56   private Locale JavaDoc _locale;
57
58   /**
59    * Sets the SAX errorHandler.
60    *
61    * @param handler the error handler
62    */

63   public void setErrorHandler(ErrorHandler handler)
64   {
65     _errorHandler = handler;
66   }
67
68   /**
69    * Sets the SAX entityResolver.
70    *
71    * @param resolver the entity resolver
72    */

73   public void setEntityResolver(EntityResolver resolver)
74   {
75     _entityResolver = resolver;
76   }
77
78   /**
79    * Sets the SAX document handler
80    *
81    * @param handler the document handler
82    */

83   public void setDocumentHandler(DocumentHandler handler)
84   {
85     _documentHandler = handler;
86   }
87
88   /**
89    * Sets the SAX DTD handler
90    *
91    * @param handler the dtd handler
92    */

93   public void setDTDHandler(DTDHandler handler)
94   {
95     _dtdHandler = handler;
96   }
97
98   /**
99    * Sets the SAX locale
100    *
101    * @param locale locale
102    */

103   public void setLocale(Locale JavaDoc locale)
104   {
105     _locale = locale;
106   }
107   
108   /**
109    * parses the input source.
110    *
111    * @param source the source to parse from
112    */

113   public void parse(InputSource source)
114     throws IOException JavaDoc, SAXException
115   {
116     
117   }
118   
119   /**
120    * parses the file at the given string
121    *
122    * @param url the source url to parse from
123    */

124   public void parse(String JavaDoc source)
125     throws IOException JavaDoc, SAXException
126   {
127     
128   }
129 }
130
Popular Tags