Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PatternSet |
|
| 2.5555555555555554;2,556 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.0.1 on 2009-03-28 16:09:53, | |
4 | any modifications will be overwritten. | |
5 | ============================================================== | |
6 | */ | |
7 | ||
8 | package org.apache.maven.model; | |
9 | ||
10 | /** | |
11 | * Definition of include or exclude patterns. | |
12 | * | |
13 | * @version $Revision$ $Date$ | |
14 | */ | |
15 | 4 | public class PatternSet |
16 | implements java.io.Serializable | |
17 | { | |
18 | ||
19 | //--------------------------/ | |
20 | //- Class/Member Variables -/ | |
21 | //--------------------------/ | |
22 | ||
23 | /** | |
24 | * Field includes. | |
25 | */ | |
26 | private java.util.List/*<String>*/ includes; | |
27 | ||
28 | /** | |
29 | * Field excludes. | |
30 | */ | |
31 | private java.util.List/*<String>*/ excludes; | |
32 | ||
33 | ||
34 | //-----------/ | |
35 | //- Methods -/ | |
36 | //-----------/ | |
37 | ||
38 | /** | |
39 | * Method addExclude. | |
40 | * | |
41 | * @param string | |
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 | } //-- void addExclude( String ) |
51 | ||
52 | /** | |
53 | * Method addInclude. | |
54 | * | |
55 | * @param string | |
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 | } //-- void addInclude( String ) |
65 | ||
66 | /** | |
67 | * Method getExcludes. | |
68 | * | |
69 | * @return List | |
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 | } //-- java.util.List/*<String>*/ getExcludes() | |
80 | ||
81 | /** | |
82 | * Method getIncludes. | |
83 | * | |
84 | * @return List | |
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 | } //-- java.util.List/*<String>*/ getIncludes() | |
95 | ||
96 | /** | |
97 | * Method removeExclude. | |
98 | * | |
99 | * @param string | |
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 | } //-- void removeExclude( String ) |
109 | ||
110 | /** | |
111 | * Method removeInclude. | |
112 | * | |
113 | * @param string | |
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 | } //-- void removeInclude( String ) |
123 | ||
124 | /** | |
125 | * Set a list of patterns to exclude, e.g. | |
126 | * <code>**/*.xml</code> | |
127 | * | |
128 | * @param excludes | |
129 | */ | |
130 | public void setExcludes( java.util.List/*<String>*/ excludes ) | |
131 | { | |
132 | 0 | this.excludes = excludes; |
133 | 0 | } //-- void setExcludes( java.util.List ) |
134 | ||
135 | /** | |
136 | * Set a list of patterns to include, e.g. | |
137 | * <code>**/*.xml</code>. | |
138 | * | |
139 | * @param includes | |
140 | */ | |
141 | public void setIncludes( java.util.List/*<String>*/ includes ) | |
142 | { | |
143 | 0 | this.includes = includes; |
144 | 0 | } //-- void setIncludes( java.util.List ) |
145 | ||
146 | ||
147 | ||
148 | /** | |
149 | * @see java.lang.Object#toString() | |
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 | } | |
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 | } | |
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 | } |