1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
package org.apache.maven.model; |
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | 6 | public class PatternSet |
16 | |
implements java.io.Serializable |
17 | |
{ |
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
private java.util.List<String> includes; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
private java.util.List<String> excludes; |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
public void addExclude( String string ) |
44 | |
{ |
45 | 0 | if ( !(string instanceof String) ) |
46 | |
{ |
47 | 0 | throw new ClassCastException( "PatternSet.addExcludes(string) parameter must be instanceof " + String.class.getName() ); |
48 | |
} |
49 | 0 | getExcludes().add( string ); |
50 | 0 | } |
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
public void addInclude( String string ) |
58 | |
{ |
59 | 0 | if ( !(string instanceof String) ) |
60 | |
{ |
61 | 0 | throw new ClassCastException( "PatternSet.addIncludes(string) parameter must be instanceof " + String.class.getName() ); |
62 | |
} |
63 | 0 | getIncludes().add( string ); |
64 | 0 | } |
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
public java.util.List<String> getExcludes() |
72 | |
{ |
73 | 1 | if ( this.excludes == null ) |
74 | |
{ |
75 | 1 | this.excludes = new java.util.ArrayList<String>(); |
76 | |
} |
77 | |
|
78 | 1 | return this.excludes; |
79 | |
} |
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
public java.util.List<String> getIncludes() |
87 | |
{ |
88 | 1 | if ( this.includes == null ) |
89 | |
{ |
90 | 1 | this.includes = new java.util.ArrayList<String>(); |
91 | |
} |
92 | |
|
93 | 1 | return this.includes; |
94 | |
} |
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
public void removeExclude( String string ) |
102 | |
{ |
103 | 0 | if ( !(string instanceof String) ) |
104 | |
{ |
105 | 0 | throw new ClassCastException( "PatternSet.removeExcludes(string) parameter must be instanceof " + String.class.getName() ); |
106 | |
} |
107 | 0 | getExcludes().remove( string ); |
108 | 0 | } |
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
|
114 | |
|
115 | |
public void removeInclude( String string ) |
116 | |
{ |
117 | 0 | if ( !(string instanceof String) ) |
118 | |
{ |
119 | 0 | throw new ClassCastException( "PatternSet.removeIncludes(string) parameter must be instanceof " + String.class.getName() ); |
120 | |
} |
121 | 0 | getIncludes().remove( string ); |
122 | 0 | } |
123 | |
|
124 | |
|
125 | |
|
126 | |
|
127 | |
|
128 | |
|
129 | |
|
130 | |
public void setExcludes( java.util.List<String> excludes ) |
131 | |
{ |
132 | 0 | this.excludes = excludes; |
133 | 0 | } |
134 | |
|
135 | |
|
136 | |
|
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
public void setIncludes( java.util.List<String> includes ) |
142 | |
{ |
143 | 0 | this.includes = includes; |
144 | 0 | } |
145 | |
|
146 | |
|
147 | |
|
148 | |
|
149 | |
|
150 | |
|
151 | |
public String toString() |
152 | |
{ |
153 | 1 | StringBuffer sb = new StringBuffer(); |
154 | |
|
155 | 1 | sb.append("PatternSet [includes: {"); |
156 | 1 | for (java.util.Iterator i = getIncludes().iterator(); i.hasNext(); ) |
157 | |
{ |
158 | 0 | String str = (String) i.next(); |
159 | 0 | sb.append(str).append(", "); |
160 | 0 | } |
161 | 1 | if (sb.substring(sb.length() - 2).equals(", ")) sb.delete(sb.length() - 2, sb.length()); |
162 | |
|
163 | 1 | sb.append("}, excludes: {"); |
164 | 1 | for (java.util.Iterator i = getExcludes().iterator(); i.hasNext(); ) |
165 | |
{ |
166 | 0 | String str = (String) i.next(); |
167 | 0 | sb.append(str).append(", "); |
168 | 0 | } |
169 | 1 | if (sb.substring(sb.length() - 2).equals(", ")) sb.delete(sb.length() - 2, sb.length()); |
170 | |
|
171 | 1 | sb.append("}]"); |
172 | 1 | return sb.toString(); |
173 | |
} |
174 | |
|
175 | |
|
176 | |
} |