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