01 /*
02 * Java GPX Library (jpx-3.1.0).
03 *
04 * Licensed under the Apache License, Version 2.0 (the "License");
05 * you may not use this file except in compliance with the License.
06 * You may obtain a copy of the License at
07 *
08 * http://www.apache.org/licenses/LICENSE-2.0
09 *
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 */
16 package io.jenetics.jpx.format;
17
18 import static java.lang.String.format;
19
20 import java.io.Serial;
21
22 /**
23 * This exception is thrown when the parsing of a location pattern string fails.
24 *
25 * @see LocationFormatter
26 *
27 * @version 2.2
28 * @since 2.2
29 */
30 public class ParseException extends FormatterException {
31
32 @Serial
33 private static final long serialVersionUID = 1;
34
35 /**
36 * Create a new parse exception with the given parameters.
37 *
38 * @param message the error message
39 * @param in the erroneous location string
40 * @param position the error position
41 */
42 ParseException(
43 final String message,
44 final CharSequence in,
45 final int position
46 ) {
47 super(format("%s at position %d in '%s'.", message, position, in));
48 }
49
50 }
|