1
2
3
4
5
6
7
8 package org.apache.maven.model;
9
10
11
12
13
14
15 @SuppressWarnings( "all" )
16 public class PatternSet
17 implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
18 {
19
20
21
22
23
24
25
26
27 private java.util.List<String> includes;
28
29
30
31
32 private java.util.List<String> excludes;
33
34
35
36
37 private java.util.Map<Object, InputLocation> locations;
38
39
40
41
42
43
44
45
46
47
48
49 public void addExclude( String string )
50 {
51 getExcludes().add( string );
52 }
53
54
55
56
57
58
59 public void addInclude( String string )
60 {
61 getIncludes().add( string );
62 }
63
64
65
66
67
68
69 public PatternSet clone()
70 {
71 try
72 {
73 PatternSet copy = (PatternSet) super.clone();
74
75 if ( this.includes != null )
76 {
77 copy.includes = new java.util.ArrayList<String>();
78 copy.includes.addAll( this.includes );
79 }
80
81 if ( this.excludes != null )
82 {
83 copy.excludes = new java.util.ArrayList<String>();
84 copy.excludes.addAll( this.excludes );
85 }
86
87 if ( copy.locations != null )
88 {
89 copy.locations = new java.util.LinkedHashMap( copy.locations );
90 }
91
92 return copy;
93 }
94 catch ( java.lang.Exception ex )
95 {
96 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
97 + " does not support clone()" ).initCause( ex );
98 }
99 }
100
101
102
103
104
105
106 public java.util.List<String> getExcludes()
107 {
108 if ( this.excludes == null )
109 {
110 this.excludes = new java.util.ArrayList<String>();
111 }
112
113 return this.excludes;
114 }
115
116
117
118
119
120
121 public java.util.List<String> getIncludes()
122 {
123 if ( this.includes == null )
124 {
125 this.includes = new java.util.ArrayList<String>();
126 }
127
128 return this.includes;
129 }
130
131
132
133
134
135
136
137 public InputLocation getLocation( Object key )
138 {
139 return ( locations != null ) ? locations.get( key ) : null;
140 }
141
142
143
144
145
146
147 public void removeExclude( String string )
148 {
149 getExcludes().remove( string );
150 }
151
152
153
154
155
156
157 public void removeInclude( String string )
158 {
159 getIncludes().remove( string );
160 }
161
162
163
164
165
166
167
168 public void setExcludes( java.util.List<String> excludes )
169 {
170 this.excludes = excludes;
171 }
172
173
174
175
176
177
178
179 public void setIncludes( java.util.List<String> includes )
180 {
181 this.includes = includes;
182 }
183
184
185
186
187
188
189
190 public void setLocation( Object key, InputLocation location )
191 {
192 if ( location != null )
193 {
194 if ( this.locations == null )
195 {
196 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
197 }
198 this.locations.put( key, location );
199 }
200 }
201
202
203
204
205
206
207 public String toString()
208 {
209 StringBuilder sb = new StringBuilder( 128 );
210
211 sb.append("PatternSet [includes: {");
212 for (java.util.Iterator i = getIncludes().iterator(); i.hasNext(); )
213 {
214 String str = (String) i.next();
215 sb.append(str).append(", ");
216 }
217 if (sb.substring(sb.length() - 2).equals(", ")) sb.delete(sb.length() - 2, sb.length());
218
219 sb.append("}, excludes: {");
220 for (java.util.Iterator i = getExcludes().iterator(); i.hasNext(); )
221 {
222 String str = (String) i.next();
223 sb.append(str).append(", ");
224 }
225 if (sb.substring(sb.length() - 2).equals(", ")) sb.delete(sb.length() - 2, sb.length());
226
227 sb.append("}]");
228 return sb.toString();
229 }
230
231
232 }