1 package org.apache.maven.tools.plugin.extractor.model;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.io.File;
23
24 /**
25 * Exception when plugin metadata parsing occurred.
26 *
27 */
28 public class PluginMetadataParseException
29 extends Exception
30 {
31 /** serialVersionUID */
32 static final long serialVersionUID = 4022348153707995574L;
33
34 private final File metadataFile;
35
36 private final String originalMessage;
37
38 /**
39 * @param metadataFile could be null
40 * @param message could be null
41 * @param cause could be null
42 */
43 public PluginMetadataParseException( File metadataFile, String message, Throwable cause )
44 {
45 super( "Error parsing file: " + metadataFile + ". Reason: " + message, cause );
46
47 this.metadataFile = metadataFile;
48 this.originalMessage = message;
49 }
50
51 /**
52 * @param metadataFile could be null
53 * @param message could be null
54 */
55 public PluginMetadataParseException( File metadataFile, String message )
56 {
57 super( "Error parsing file: " + metadataFile + ". Reason: " + message );
58
59 this.metadataFile = metadataFile;
60 this.originalMessage = message;
61 }
62
63 /**
64 * @return the metadata file
65 */
66 public File getMetadataFile()
67 {
68 return metadataFile;
69 }
70
71 /**
72 * @return the original message
73 */
74 public String getOriginalMessage()
75 {
76 return originalMessage;
77 }
78 }