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