1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.codehaus.mojo.license.header;
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 public class FileHeader
35 {
36
37
38
39
40 protected static final String COPYRIGHT_TO_STRING_FORMAT = "Copyright (C) %1$s %2$s";
41
42
43
44
45 protected String description;
46
47
48
49
50 protected String copyrightHolder;
51
52
53
54
55 protected Integer copyrightFirstYear;
56
57
58
59
60
61 protected Integer copyrightLastYear;
62
63
64
65
66 protected String license;
67
68
69
70
71
72 public String getDescription()
73 {
74 return description;
75 }
76
77
78
79
80 public String getCopyrightHolder()
81 {
82 return copyrightHolder;
83 }
84
85
86
87
88 public Integer getCopyrightFirstYear()
89 {
90 return copyrightFirstYear;
91 }
92
93
94
95
96
97 public Integer getCopyrightLastYear()
98 {
99 return copyrightLastYear;
100 }
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117 public String getCopyright()
118 {
119 String copyright;
120 if ( getCopyrightLastYear() == null )
121 {
122
123
124 copyright = String.format( COPYRIGHT_TO_STRING_FORMAT, getCopyrightFirstYear(), getCopyrightHolder() );
125 }
126 else
127 {
128
129
130 copyright =
131 String.format( COPYRIGHT_TO_STRING_FORMAT, getCopyrightFirstYear() + " - " + getCopyrightLastYear(),
132 getCopyrightHolder() );
133 }
134 return copyright;
135 }
136
137
138
139
140
141 public String getLicense()
142 {
143 return license;
144 }
145
146 public void setDescription( String description )
147 {
148 this.description = description;
149 }
150
151 public void setCopyrightHolder( String copyrightHolder )
152 {
153 this.copyrightHolder = copyrightHolder;
154 }
155
156 public void setCopyrightFirstYear( Integer copyrightFirstYear )
157 {
158 this.copyrightFirstYear = copyrightFirstYear;
159 }
160
161 public void setCopyrightLastYear( Integer copyrightLastYear )
162 {
163 this.copyrightLastYear = copyrightLastYear;
164 }
165
166 public void setLicense( String license )
167 {
168 this.license = license;
169 }
170 }