1/**
2 * Copyright (c) 2008, http://www.snakeyaml.org
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.yaml.snakeyaml.scanner;
17
18import org.yaml.snakeyaml.error.Mark;
19import org.yaml.snakeyaml.error.MarkedYAMLException;
20
21/**
22 * Exception thrown by the {@link Scanner} implementations in case of malformed
23 * input.
24 */
25public class ScannerException extends MarkedYAMLException {
26
27    private static final long serialVersionUID = 4782293188600445954L;
28
29    /**
30     * Constructs an instance.
31     *
32     * @param context
33     *            Part of the input document in which vicinity the problem
34     *            occurred.
35     * @param contextMark
36     *            Position of the <code>context</code> within the document.
37     * @param problem
38     *            Part of the input document that caused the problem.
39     * @param problemMark
40     *            Position of the <code>problem</code> within the document.
41     * @param note
42     *            Message for the user with further information about the
43     *            problem.
44     */
45    public ScannerException(String context, Mark contextMark, String problem, Mark problemMark,
46            String note) {
47        super(context, contextMark, problem, problemMark, note);
48    }
49
50    /**
51     * Constructs an instance.
52     *
53     * @param context
54     *            Part of the input document in which vicinity the problem
55     *            occurred.
56     * @param contextMark
57     *            Position of the <code>context</code> within the document.
58     * @param problem
59     *            Part of the input document that caused the problem.
60     * @param problemMark
61     *            Position of the <code>problem</code> within the document.
62     */
63    public ScannerException(String context, Mark contextMark, String problem, Mark problemMark) {
64        this(context, contextMark, problem, problemMark, null);
65    }
66}
67