KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > handler > DefaultArtifactHandler


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

18
19 /**
20  * @author <a HREF="mailto:brett@apache.org">Brett Porter</a>
21  * @version $Id: AbstractArtifactHandler.java 189871 2005-06-10 00:57:19Z brett $
22  */

23 public class DefaultArtifactHandler
24     implements ArtifactHandler
25 {
26     private String JavaDoc extension;
27
28     private String JavaDoc type;
29
30     private String JavaDoc classifier;
31
32     private String JavaDoc directory;
33
34     private String JavaDoc packaging;
35
36     private boolean includesDependencies;
37
38     private String JavaDoc language;
39
40     private boolean addedToClasspath;
41
42     public DefaultArtifactHandler()
43     {
44     }
45
46     public DefaultArtifactHandler( String JavaDoc type )
47     {
48         this.type = type;
49     }
50
51     public String JavaDoc getExtension()
52     {
53         if ( extension == null )
54         {
55             extension = type;
56         }
57         return extension;
58     }
59
60     public String JavaDoc getType()
61     {
62         return type;
63     }
64
65     public String JavaDoc getClassifier()
66     {
67         return classifier;
68     }
69
70     public String JavaDoc getDirectory()
71     {
72         if ( directory == null )
73         {
74             directory = getPackaging() + "s";
75         }
76         return directory;
77     }
78
79     public String JavaDoc getPackaging()
80     {
81         if ( packaging == null )
82         {
83             packaging = type;
84         }
85         return packaging;
86     }
87
88     public boolean isIncludesDependencies()
89     {
90         return includesDependencies;
91     }
92
93     public String JavaDoc getLanguage()
94     {
95         if ( language == null )
96         {
97             language = "none";
98         }
99
100         return language;
101     }
102
103     public boolean isAddedToClasspath()
104     {
105         return addedToClasspath;
106     }
107 }
108
Popular Tags