|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FilterException | Line # 27 | 9 | 0% | 9 | 20 | 0% |
0.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| No Tests | |||
| 1 | /* | |
| 2 | * See the NOTICE file distributed with this work for additional | |
| 3 | * information regarding copyright ownership. | |
| 4 | * | |
| 5 | * This is free software; you can redistribute it and/or modify it | |
| 6 | * under the terms of the GNU Lesser General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2.1 of | |
| 8 | * the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This software 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 software; if not, write to the Free | |
| 17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
| 19 | */ | |
| 20 | package org.xwiki.rendering.parser.xwiki10; | |
| 21 | ||
| 22 | /** | |
| 23 | * | |
| 24 | * @version $Id$ | |
| 25 | * @since 1.8M1 | |
| 26 | */ | |
| 27 | public class FilterException extends Exception | |
| 28 | { | |
| 29 | private static final long serialVersionUID = 1L; | |
| 30 | ||
| 31 | /** | |
| 32 | * The file that caused the ParseException.. | |
| 33 | */ | |
| 34 | private String fileName; | |
| 35 | ||
| 36 | /** | |
| 37 | * Line number where the parse exception occurred. | |
| 38 | */ | |
| 39 | private int lineNumber; | |
| 40 | ||
| 41 | /** | |
| 42 | * Construct a new ParseException with the specified detail message. | |
| 43 | * | |
| 44 | * @param message The detailed message. This can later be retrieved by the Throwable.getMessage() method. | |
| 45 | */ | |
| 46 | 0 |
public FilterException(String message) |
| 47 | { | |
| 48 | 0 | this(null, message, null, -1); |
| 49 | } | |
| 50 | ||
| 51 | /** | |
| 52 | * Construct a new ParseException with the specified detail message and cause. | |
| 53 | * | |
| 54 | * @param message The detailed message. This can later be retrieved by the Throwable.getMessage() method. | |
| 55 | * @param e the cause. This can be retrieved later by the Throwable.getCause() method. (A null value is permitted, | |
| 56 | * and indicates that the cause is nonexistent or unknown.) | |
| 57 | */ | |
| 58 | 0 |
public FilterException(String message, Exception e) |
| 59 | { | |
| 60 | 0 | this(e, message, null, -1); |
| 61 | } | |
| 62 | ||
| 63 | /** | |
| 64 | * Constructs a new exception with the specified cause. The error message is (cause == null ? null : | |
| 65 | * cause.toString() ). | |
| 66 | * | |
| 67 | * @param e the cause. This can be retrieved later by the Throwable.getCause() method. (A null value is permitted, | |
| 68 | * and indicates that the cause is nonexistent or unknown.) | |
| 69 | */ | |
| 70 | 0 |
public FilterException(Exception e) |
| 71 | { | |
| 72 | 0 | this(e, null, null, -1); |
| 73 | } | |
| 74 | ||
| 75 | /** | |
| 76 | * Construct a new ParseException with the specified cause, filename and linenumber. | |
| 77 | * | |
| 78 | * @param e the cause. This can be retrieved later by the Throwable.getCause() method. (A null value is permitted, | |
| 79 | * and indicates that the cause is nonexistent or unknown.) | |
| 80 | * @param file Name of a file that couldn't be parsed. This can later be retrieved by the getFileName() method. | |
| 81 | * @param line The line number where the parsing failed. This can later be retrieved by the getLineNumber() method. | |
| 82 | */ | |
| 83 | 0 |
public FilterException(Exception e, String file, int line) |
| 84 | { | |
| 85 | 0 | this(e, null, file, line); |
| 86 | } | |
| 87 | ||
| 88 | /** | |
| 89 | * Construct a new ParseException with the specified cause, detail message, filename and linenumber. | |
| 90 | * | |
| 91 | * @param e the cause. This can be retrieved later by the Throwable.getCause() method. (A null value is permitted, | |
| 92 | * and indicates that the cause is nonexistent or unknown.) | |
| 93 | * @param message The detailed message. This can later be retrieved by the Throwable.getMessage() method. | |
| 94 | * @param file Name of a file that couldn't be parsed. This can later be retrieved by the getFileName() method. | |
| 95 | * @param line The line number where the parsing failed. This can later be retrieved by the getLineNumber() method. | |
| 96 | */ | |
| 97 | 0 |
public FilterException(Exception e, String message, String file, int line) |
| 98 | { | |
| 99 | 0 | super((message == null) ? ((e == null) ? null : e.getMessage()) : message, e); |
| 100 | ||
| 101 | 0 | this.fileName = file; |
| 102 | 0 | this.lineNumber = line; |
| 103 | } | |
| 104 | ||
| 105 | /** | |
| 106 | * Returns the file that caused the ParseException. | |
| 107 | * | |
| 108 | * @return the file that caused the ParseException. | |
| 109 | */ | |
| 110 | 0 |
public String getFileName() |
| 111 | { | |
| 112 | 0 | return fileName; |
| 113 | } | |
| 114 | ||
| 115 | /** | |
| 116 | * Returns the line number where the ParseException ocurred. | |
| 117 | * | |
| 118 | * @return the line number. | |
| 119 | */ | |
| 120 | 0 |
public int getLineNumber() |
| 121 | { | |
| 122 | 0 | return lineNumber; |
| 123 | } | |
| 124 | } | |
|
||||||||||||