1 /* 2 =================== DO NOT EDIT THIS FILE ==================== 3 Generated by Modello 1.4.1 on 2011-08-31 21:34:19, 4 any modifications will be overwritten. 5 ============================================================== 6 */ 7 8 package org.apache.maven.archetype.metadata; 9 10 /** 11 * 12 * A fileset defines the way the project's files located in 13 * the jar file are used by the Archetype Plugin to generate a 14 * project. 15 * If file or directory name contains 16 * <code>__<i>property</i>__</code> pattern, it is replaced with 17 * corresponding property value. 18 * 19 * 20 * @version $Revision$ $Date$ 21 */ 22 @SuppressWarnings( "all" ) 23 public class FileSet 24 implements java.io.Serializable 25 { 26 27 //--------------------------/ 28 //- Class/Member Variables -/ 29 //--------------------------/ 30 31 /** 32 * 33 * Filesets can be filtered, which means the 34 * selected files will be used as 35 * <a 36 * href="http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html">Velocity 37 * templates</a>. 38 * They can be non-filtered, which means the 39 * selected files will be copied without modification. 40 * 41 */ 42 private boolean filtered = false; 43 44 /** 45 * Filesets can be packaged, which means the selected files 46 * will be generated/copied in a directory 47 * structure that is prepended by the package 48 * property. They can be non-packaged, which means that the 49 * selected 50 * files will be generated/copied without that 51 * prepend. 52 */ 53 private boolean packaged = false; 54 55 /** 56 * Encoding to use when filtering content. 57 */ 58 private String encoding; 59 60 /** 61 * The directory where the files will be searched for, which is 62 * also the directory where the 63 * project's files will be generated. 64 */ 65 private String directory; 66 67 /** 68 * Field includes. 69 */ 70 private java.util.List<String> includes; 71 72 /** 73 * Field excludes. 74 */ 75 private java.util.List<String> excludes; 76 77 78 //-----------/ 79 //- Methods -/ 80 //-----------/ 81 82 /** 83 * Method addExclude. 84 * 85 * @param string 86 */ 87 public void addExclude( String string ) 88 { 89 getExcludes().add( string ); 90 } //-- void addExclude( String ) 91 92 /** 93 * Method addInclude. 94 * 95 * @param string 96 */ 97 public void addInclude( String string ) 98 { 99 getIncludes().add( string ); 100 } //-- void addInclude( String ) 101 102 /** 103 * Get the directory where the files will be searched for, 104 * which is also the directory where the 105 * project's files will be generated. 106 * 107 * @return String 108 */ 109 public String getDirectory() 110 { 111 return this.directory; 112 } //-- String getDirectory() 113 114 /** 115 * Get encoding to use when filtering content. 116 * 117 * @return String 118 */ 119 public String getEncoding() 120 { 121 return this.encoding; 122 } //-- String getEncoding() 123 124 /** 125 * Method getExcludes. 126 * 127 * @return List 128 */ 129 public java.util.List<String> getExcludes() 130 { 131 if ( this.excludes == null ) 132 { 133 this.excludes = new java.util.ArrayList<String>(); 134 } 135 136 return this.excludes; 137 } //-- java.util.List<String> getExcludes() 138 139 /** 140 * Method getIncludes. 141 * 142 * @return List 143 */ 144 public java.util.List<String> getIncludes() 145 { 146 if ( this.includes == null ) 147 { 148 this.includes = new java.util.ArrayList<String>(); 149 } 150 151 return this.includes; 152 } //-- java.util.List<String> getIncludes() 153 154 /** 155 * Get filesets can be filtered, which means the selected files 156 * will be used as 157 * <a 158 * href="http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html">Velocity 159 * templates</a>. 160 * They can be non-filtered, which means the 161 * selected files will be copied without modification. 162 * 163 * @return boolean 164 */ 165 public boolean isFiltered() 166 { 167 return this.filtered; 168 } //-- boolean isFiltered() 169 170 /** 171 * Get filesets can be packaged, which means the selected files 172 * will be generated/copied in a directory 173 * structure that is prepended by the package 174 * property. They can be non-packaged, which means that the 175 * selected 176 * files will be generated/copied without that 177 * prepend. 178 * 179 * @return boolean 180 */ 181 public boolean isPackaged() 182 { 183 return this.packaged; 184 } //-- boolean isPackaged() 185 186 /** 187 * Method removeExclude. 188 * 189 * @param string 190 */ 191 public void removeExclude( String string ) 192 { 193 getExcludes().remove( string ); 194 } //-- void removeExclude( String ) 195 196 /** 197 * Method removeInclude. 198 * 199 * @param string 200 */ 201 public void removeInclude( String string ) 202 { 203 getIncludes().remove( string ); 204 } //-- void removeInclude( String ) 205 206 /** 207 * Set the directory where the files will be searched for, 208 * which is also the directory where the 209 * project's files will be generated. 210 * 211 * @param directory 212 */ 213 public void setDirectory( String directory ) 214 { 215 this.directory = directory; 216 } //-- void setDirectory( String ) 217 218 /** 219 * Set encoding to use when filtering content. 220 * 221 * @param encoding 222 */ 223 public void setEncoding( String encoding ) 224 { 225 this.encoding = encoding; 226 } //-- void setEncoding( String ) 227 228 /** 229 * Set exclusion definition "à la" Ant. 230 * 231 * @param excludes 232 */ 233 public void setExcludes( java.util.List<String> excludes ) 234 { 235 this.excludes = excludes; 236 } //-- void setExcludes( java.util.List ) 237 238 /** 239 * Set filesets can be filtered, which means the selected files 240 * will be used as 241 * <a 242 * href="http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html">Velocity 243 * templates</a>. 244 * They can be non-filtered, which means the 245 * selected files will be copied without modification. 246 * 247 * @param filtered 248 */ 249 public void setFiltered( boolean filtered ) 250 { 251 this.filtered = filtered; 252 } //-- void setFiltered( boolean ) 253 254 /** 255 * Set inclusion definition "à la" Ant. 256 * 257 * @param includes 258 */ 259 public void setIncludes( java.util.List<String> includes ) 260 { 261 this.includes = includes; 262 } //-- void setIncludes( java.util.List ) 263 264 /** 265 * Set filesets can be packaged, which means the selected files 266 * will be generated/copied in a directory 267 * structure that is prepended by the package 268 * property. They can be non-packaged, which means that the 269 * selected 270 * files will be generated/copied without that 271 * prepend. 272 * 273 * @param packaged 274 */ 275 public void setPackaged( boolean packaged ) 276 { 277 this.packaged = packaged; 278 } //-- void setPackaged( boolean ) 279 280 281 public String toString() 282 { 283 return 284 getDirectory() + " (" 285 + ( isFiltered() ? "Filtered" : "Copied" ) 286 + "-" 287 + ( isPackaged() ? "Packaged" : "Flat" ) 288 + ") [" 289 + org.codehaus.plexus.util.StringUtils.join( getIncludes().iterator(), ", " ) 290 + " -- " 291 + org.codehaus.plexus.util.StringUtils.join( getExcludes().iterator(), ", " ) 292 + "]"; 293 294 } 295 296 }