KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > htmlparser > util > EncodingChangeException


1 // HTMLParser Library $Name: v1_5_20050313 $ - A java-based parser for HTML
2
// http://sourceforge.org/projects/htmlparser
3
// Copyright (C) 2004 Claude Duguay
4
//
5
// Revision Control Information
6
//
7
// $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/EncodingChangeException.java,v $
8
// $Author: derrickoswald $
9
// $Date: 2004/01/10 15:23:33 $
10
// $Revision: 1.1 $
11
//
12
// This library is free software; you can redistribute it and/or
13
// modify it under the terms of the GNU Lesser General Public
14
// License as published by the Free Software Foundation; either
15
// version 2.1 of the License, or (at your option) any later version.
16
//
17
// This library is distributed in the hope that it will be useful,
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
// Lesser General Public License for more details.
21
//
22
// You should have received a copy of the GNU Lesser General Public
23
// License along with this library; if not, write to the Free Software
24
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
//
26

27 package org.htmlparser.util;
28
29 /**
30  * The encoding is changed invalidating already scanned characters.
31  * When the encoding is changed, as for example when encountering a <META>
32  * tag that includes a charset directive in the content attribute that
33  * disagrees with the encoding specified by the HTTP header (or the default
34  * encoding if none), the parser retraces the bytes it has interpreted so far
35  * comparing the characters produced under the new encoding. If the new
36  * characters differ from those it has already yielded to the application, it
37  * throws this exception to indicate that processing should be restarted under
38  * the new encoding.
39  * This exception is the object thrown so that applications may distinguish
40  * between an encoding change, which may be successfully cured by restarting
41  * the parse from the beginning, from more serious errors.
42  * @see IteratorImpl
43  * @see ParserException
44  **/

45 public class EncodingChangeException
46     extends
47         ParserException
48 {
49     /**
50      * Create an exception idicative of a problematic encoding change.
51      * @param message The message describing the error condifion.
52      */

53     public EncodingChangeException (String JavaDoc message)
54     {
55         super(message);
56     }
57 }
58
59
Popular Tags