1 package org.apache.maven.artifact.handler;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.codehaus.plexus.component.annotations.Component;
23
24
25
26
27
28
29 @Component( role = ArtifactHandler.class )
30 public class DefaultArtifactHandler
31 implements ArtifactHandler
32 {
33 private String extension;
34
35 private String type;
36
37 private String classifier;
38
39 private String directory;
40
41 private String packaging;
42
43 private boolean includesDependencies;
44
45 private String language;
46
47 private boolean addedToClasspath;
48
49 public DefaultArtifactHandler()
50 {
51 }
52
53 public DefaultArtifactHandler( String type )
54 {
55 this.type = type;
56 }
57
58 public String getExtension()
59 {
60 if ( extension == null )
61 {
62 extension = type;
63 }
64 return extension;
65 }
66
67 public void setExtension( String extension )
68 {
69 this.extension = extension;
70 }
71
72 public String getType()
73 {
74 return type;
75 }
76
77 public String getClassifier()
78 {
79 return classifier;
80 }
81
82 public String getDirectory()
83 {
84 if ( directory == null )
85 {
86 directory = getPackaging() + "s";
87 }
88 return directory;
89 }
90
91 public String getPackaging()
92 {
93 if ( packaging == null )
94 {
95 packaging = type;
96 }
97 return packaging;
98 }
99
100 public boolean isIncludesDependencies()
101 {
102 return includesDependencies;
103 }
104
105 public void setIncludesDependencies( boolean includesDependencies )
106 {
107 this.includesDependencies = includesDependencies;
108 }
109
110 public String getLanguage()
111 {
112 if ( language == null )
113 {
114 language = "none";
115 }
116
117 return language;
118 }
119
120 public void setLanguage( String language )
121 {
122 this.language = language;
123 }
124
125 public boolean isAddedToClasspath()
126 {
127 return addedToClasspath;
128 }
129
130 public void setAddedToClasspath( boolean addedToClasspath )
131 {
132 this.addedToClasspath = addedToClasspath;
133 }
134
135 }