1 /* gnu.classpath.tools.MalformedInputEvent
2 Copyright (C) 2004 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 package gnu.classpath.tools;
23 import java.util.EventObject;
26 * Encapsulates information about malformed input encountered by a
27 * {@link NotifyingInputStreamReader}.
29 * You can use {@link getSource()} to fetch a reference to the
30 * <code>NotifyingInputStreamReader</code> which encountered the
33 * @author Julian Scheid
35 public class MalformedInputEvent
38 private int lineNumber;
39 private int columnNumber;
42 MalformedInputEvent(NotifyingInputStreamReader source,
48 this.columnNumber = columnNumber;
49 this.lineNumber = lineNumber;
54 * Return the 1-based line number where the malformed input begins
55 * in the stream read by the
56 * <code>NotifyingInputStreamReader</code>.
58 public int getLineNumber()
64 * Return the 0-based column number where the malformed input
65 * begins in the stream read by the
66 * <code>NotifyingInputStreamReader</code>.
68 public int getColumnNumber()
74 * Return the length (in bytes) of the malformed input encountered
75 * by the <code>NotifyingInputStreamReader</code>. Note that a
76 * consecutive run of malformed input isn't necessarily reported
77 * as a whole; depending on the <code>Charset</code> and
78 * implementation details of <code>CharsetDecoder</code>, the run
79 * could be reported in chunks down to individual bytes.
81 public int getLength()
86 public String toString()
88 return "MalformedInputEvent{line=" + lineNumber
89 + ",column=" + columnNumber