View Javadoc
1   package org.apache.maven.plugin.tools.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   * @version $Id: PluginMetadataParseException.html 907040 2014-04-27 09:50:12Z hboutemy $
28   */
29  public class PluginMetadataParseException
30      extends Exception
31  {
32      /** serialVersionUID */
33      static final long serialVersionUID = 4022348153707995574L;
34  
35      private final File metadataFile;
36  
37      private final String originalMessage;
38  
39      /**
40       * @param metadataFile could be null
41       * @param message could be null
42       * @param cause could be null
43       */
44      public PluginMetadataParseException( File metadataFile, String message, Throwable cause )
45      {
46          super( "Error parsing file: " + metadataFile + ". Reason: " + message, cause );
47  
48          this.metadataFile = metadataFile;
49          this.originalMessage = message;
50      }
51  
52      /**
53       * @param metadataFile could be null
54       * @param message could be null
55       */
56      public PluginMetadataParseException( File metadataFile, String message )
57      {
58          super( "Error parsing file: " + metadataFile + ". Reason: " + message );
59  
60          this.metadataFile = metadataFile;
61          this.originalMessage = message;
62      }
63  
64      /**
65       * @return the metadata file
66       */
67      public File getMetadataFile()
68      {
69          return metadataFile;
70      }
71  
72      /**
73       * @return the original message
74       */
75      public String getOriginalMessage()
76      {
77          return originalMessage;
78      }
79  }