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