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