2 * Copyright (c) 2003-2004 Christopher Lenz and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * Christopher Lenz - initial API and implementation
11 * $Id: SyntaxErrorException.java,v 1.1 2004-09-02 18:07:12 jsurfer Exp $
14 package net.sourceforge.phpeclipse.css.core.parser;
19 public class SyntaxErrorException extends Exception {
21 // Instance Variables ------------------------------------------------------
24 * The line number at which the error was detected in the source.
26 private int lineNumber;
29 * The offset into the document.
34 * The length of the source range affected by the syntax error.
38 // Constructors ------------------------------------------------------------
43 public SyntaxErrorException() {
50 * @param message the exception message
52 public SyntaxErrorException(String message) {
59 * @param message the exception message
60 * @param lineNumber the line number
61 * @param offset the offset
62 * @param length the length
64 public SyntaxErrorException(String message, int lineNumber, int offset,
66 super(message + " (" + lineNumber + ")"); //$NON-NLS-1$ //$NON-NLS-2$
67 this.lineNumber = lineNumber;
72 // Public Methods ----------------------------------------------------------
75 * Returns the length of the offending code
77 * @return the length of the offending code
79 public final int getLength() {
84 * Returns the line number at which the error was detected.
86 * @return the line number
88 public final int getLineNumber() {
89 return this.lineNumber;
93 * Returns the offset of the offending code
95 * @return the offset of the offending code
97 public final int getOffset() {