KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > InvalidArtifactRTException


1 package org.apache.maven.artifact;
2
3
4 /*
5  * Copyright 2001-2005 The Apache Software Foundation.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19
20 public class InvalidArtifactRTException
21     extends RuntimeException JavaDoc
22 {
23     
24     private final String JavaDoc groupId;
25     private final String JavaDoc artifactId;
26     private final String JavaDoc version;
27     private final String JavaDoc type;
28     private final String JavaDoc baseMessage;
29
30     public InvalidArtifactRTException( String JavaDoc groupId, String JavaDoc artifactId, String JavaDoc version, String JavaDoc type, String JavaDoc message )
31     {
32         this.groupId = groupId;
33         this.artifactId = artifactId;
34         this.version = version;
35         this.type = type;
36         this.baseMessage = message;
37     }
38
39     public InvalidArtifactRTException( String JavaDoc groupId, String JavaDoc artifactId, String JavaDoc version, String JavaDoc type, String JavaDoc message, Throwable JavaDoc cause )
40     {
41         super( cause );
42         
43         this.groupId = groupId;
44         this.artifactId = artifactId;
45         this.version = version;
46         this.type = type;
47         this.baseMessage = message;
48     }
49
50     public String JavaDoc getMessage()
51     {
52         return "For artifact {" + getArtifactKey() + "}: " + getBaseMessage();
53     }
54     
55     public String JavaDoc getBaseMessage()
56     {
57         return baseMessage;
58     }
59
60     public String JavaDoc getArtifactId()
61     {
62         return artifactId;
63     }
64
65     public String JavaDoc getGroupId()
66     {
67         return groupId;
68     }
69
70     public String JavaDoc getType()
71     {
72         return type;
73     }
74
75     public String JavaDoc getVersion()
76     {
77         return version;
78     }
79     
80     public String JavaDoc getArtifactKey()
81     {
82         return groupId + ":" + artifactId + ":" + version + ":" + type;
83     }
84
85 }
86
Popular Tags