1 /* 2 =================== DO NOT EDIT THIS FILE ==================== 3 Generated by Modello 1.4.1 on 2012-01-20 18:05:12, 4 any modifications will be overwritten. 5 ============================================================== 6 */ 7 8 package org.apache.maven.model; 9 10 /** 11 * This element describes all of the classpath resources associated 12 * with a project 13 * or unit tests. 14 * 15 * @version $Revision$ $Date$ 16 */ 17 @SuppressWarnings( "all" ) 18 public class Resource 19 extends FileSet 20 implements java.io.Serializable, java.lang.Cloneable 21 { 22 23 //--------------------------/ 24 //- Class/Member Variables -/ 25 //--------------------------/ 26 27 /** 28 * 29 * 30 * Describe the resource target path. The path is 31 * relative to the target/classes 32 * directory (i.e. 33 * <code>${project.build.outputDirectory}</code>). 34 * For example, if you want that resource to appear 35 * in a specific package 36 * (<code>org.apache.maven.messages</code>), you 37 * must specify this 38 * element with this value: 39 * <code>org/apache/maven/messages</code>. 40 * This is not required if you simply put the 41 * resources in that directory 42 * structure at the source, however. 43 * 44 * 45 */ 46 private String targetPath; 47 48 /** 49 * 50 * 51 * Whether resources are filtered to replace tokens 52 * with parameterised values or not. 53 * The values are taken from the 54 * <code>properties</code> element and from the 55 * properties in the files listed in the 56 * <code>filters</code> element. Note: While the type 57 * of this field is <code>String</code> for 58 * technical reasons, the semantic type is actually 59 * <code>Boolean</code>. Default value is 60 * <code>false</code>. 61 * 62 * 63 */ 64 private String filtering; 65 66 /** 67 * 68 * 69 * FOR INTERNAL USE ONLY. This is a unique 70 * identifier assigned to each 71 * resource to allow Maven to merge changes to this 72 * resource that take 73 * place during the execution of a plugin. This 74 * field must be managed 75 * by the generated parser and formatter classes in 76 * order to allow it 77 * to survive model interpolation. 78 * 79 * 80 */ 81 private String mergeId; 82 83 84 //-----------/ 85 //- Methods -/ 86 //-----------/ 87 88 /** 89 * Method clone. 90 * 91 * @return Resource 92 */ 93 public Resource clone() 94 { 95 try 96 { 97 Resource copy = (Resource) super.clone(); 98 99 return copy; 100 } 101 catch ( java.lang.Exception ex ) 102 { 103 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() 104 + " does not support clone()" ).initCause( ex ); 105 } 106 } //-- Resource clone() 107 108 /** 109 * Get whether resources are filtered to replace tokens with 110 * parameterised values or not. 111 * The values are taken from the 112 * <code>properties</code> element and from the 113 * properties in the files listed in the 114 * <code>filters</code> element. Note: While the type 115 * of this field is <code>String</code> for 116 * technical reasons, the semantic type is actually 117 * <code>Boolean</code>. Default value is 118 * <code>false</code>. 119 * 120 * @return String 121 */ 122 public String getFiltering() 123 { 124 return this.filtering; 125 } //-- String getFiltering() 126 127 /** 128 * Get fOR INTERNAL USE ONLY. This is a unique identifier 129 * assigned to each 130 * resource to allow Maven to merge changes to this 131 * resource that take 132 * place during the execution of a plugin. This 133 * field must be managed 134 * by the generated parser and formatter classes in 135 * order to allow it 136 * to survive model interpolation. 137 * 138 * @return String 139 */ 140 public String getMergeId() 141 { 142 return this.mergeId; 143 } //-- String getMergeId() 144 145 /** 146 * Get describe the resource target path. The path is relative 147 * to the target/classes 148 * directory (i.e. 149 * <code>${project.build.outputDirectory}</code>). 150 * For example, if you want that resource to appear 151 * in a specific package 152 * (<code>org.apache.maven.messages</code>), you 153 * must specify this 154 * element with this value: 155 * <code>org/apache/maven/messages</code>. 156 * This is not required if you simply put the 157 * resources in that directory 158 * structure at the source, however. 159 * 160 * @return String 161 */ 162 public String getTargetPath() 163 { 164 return this.targetPath; 165 } //-- String getTargetPath() 166 167 /** 168 * Set whether resources are filtered to replace tokens with 169 * parameterised values or not. 170 * The values are taken from the 171 * <code>properties</code> element and from the 172 * properties in the files listed in the 173 * <code>filters</code> element. Note: While the type 174 * of this field is <code>String</code> for 175 * technical reasons, the semantic type is actually 176 * <code>Boolean</code>. Default value is 177 * <code>false</code>. 178 * 179 * @param filtering 180 */ 181 public void setFiltering( String filtering ) 182 { 183 this.filtering = filtering; 184 } //-- void setFiltering( String ) 185 186 /** 187 * Set fOR INTERNAL USE ONLY. This is a unique identifier 188 * assigned to each 189 * resource to allow Maven to merge changes to this 190 * resource that take 191 * place during the execution of a plugin. This 192 * field must be managed 193 * by the generated parser and formatter classes in 194 * order to allow it 195 * to survive model interpolation. 196 * 197 * @param mergeId 198 */ 199 public void setMergeId( String mergeId ) 200 { 201 this.mergeId = mergeId; 202 } //-- void setMergeId( String ) 203 204 /** 205 * Set describe the resource target path. The path is relative 206 * to the target/classes 207 * directory (i.e. 208 * <code>${project.build.outputDirectory}</code>). 209 * For example, if you want that resource to appear 210 * in a specific package 211 * (<code>org.apache.maven.messages</code>), you 212 * must specify this 213 * element with this value: 214 * <code>org/apache/maven/messages</code>. 215 * This is not required if you simply put the 216 * resources in that directory 217 * structure at the source, however. 218 * 219 * @param targetPath 220 */ 221 public void setTargetPath( String targetPath ) 222 { 223 this.targetPath = targetPath; 224 } //-- void setTargetPath( String ) 225 226 227 228 private static int mergeIdCounter = 0; 229 230 public void initMergeId() 231 { 232 if ( getMergeId() == null ) 233 { 234 setMergeId( "resource-" + (mergeIdCounter++) ); 235 } 236 } 237 238 public boolean isFiltering() 239 { 240 return ( filtering != null ) ? Boolean.parseBoolean( filtering ) : false; 241 } 242 243 public void setFiltering( boolean filtering ) 244 { 245 this.filtering = String.valueOf( filtering ); 246 } 247 248 /** 249 * @see java.lang.Object#toString() 250 */ 251 public String toString() 252 { 253 return "Resource {targetPath: " + getTargetPath() + ", filtering: " + isFiltering() + ", " + super.toString() + "}"; 254 } 255 256 257 }