KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lobobrowser > html > parser > InputSourceImpl


1 /*
2     GNU LESSER GENERAL PUBLIC LICENSE
3     Copyright (C) 2006 The Lobo Project
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Lesser General Public
7     License as published by the Free Software Foundation; either
8     version 2.1 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13     Lesser General Public License for more details.
14
15     You should have received a copy of the GNU Lesser General Public
16     License along with this library; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19     Contact info: xamjadmin@users.sourceforge.net
20 */

21 /*
22  * Created on Oct 22, 2005
23  */

24 package org.lobobrowser.html.parser;
25
26 import java.io.InputStream JavaDoc;
27 import java.io.Reader JavaDoc;
28
29 import org.xml.sax.InputSource JavaDoc;
30
31 /**
32  * The <code>InputSourceImpl</code> class implements
33  * the <code>InputSource</code> interface.
34  * @author J. H. S.
35  */

36 public class InputSourceImpl extends InputSource JavaDoc {
37     /**
38      * Constructs an <code>InputSourceImpl</code>.
39      */

40     public InputSourceImpl() {
41         super();
42     }
43
44     /**
45      * Constructs an <code>InputSourceImpl</code>.
46      * Note that the parameter does not represent a
47      * string to be parsed. To parse a string, use
48      * a StringReader.
49      * @param systemId The system ID of the input source.
50      */

51     public InputSourceImpl(String JavaDoc systemId) {
52         super(systemId);
53     }
54
55     /**
56      * Constructs an <code>InputSourceImpl</code>.
57      * @param byteStream The input stream where content can be read.
58      * @deprecated Use constructor with <code>uri</code> parameter.
59      */

60     public InputSourceImpl(InputStream JavaDoc byteStream) {
61         super(byteStream);
62     }
63
64     /**
65      * Constructs an <code>InputSourceImpl</code>.
66      * @param characterStream The <code>Reader</code> where characters can be read.
67      * @deprecated Use constructor with <code>uri</code> parameter.
68      */

69     public InputSourceImpl(Reader JavaDoc characterStream) {
70         super(characterStream);
71     }
72
73     /**
74      * Constructs an <code>InputSourceImpl</code>.
75      * @param characterStream The <code>Reader</code> where characters can be read.
76      * @param uri The URI of the document.
77      */

78     public InputSourceImpl(Reader JavaDoc characterStream, String JavaDoc uri) {
79         super(characterStream);
80         this.setSystemId(uri);
81     }
82     
83     /**
84      * Constructs an <code>InputSourceImpl</code>.
85      * @param byteStream The input stream where content can be read.
86      * @param uri The URI that identifies the content.
87      * @param charset The character set of the input stream.
88      */

89     public InputSourceImpl(InputStream JavaDoc byteStream, String JavaDoc uri, String JavaDoc charset) {
90         super(byteStream);
91         this.setEncoding(charset);
92         this.setSystemId(uri);
93         this.setPublicId(uri);
94     }
95 }
96
Popular Tags