001 /*
002 =================== DO NOT EDIT THIS FILE ====================
003 Generated by Modello 1.4.1 on 2013-02-24 03:31:02,
004 any modifications will be overwritten.
005 ==============================================================
006 */
007
008 package org.apache.maven.model;
009
010 /**
011 * This element describes all of the classpath resources associated
012 * with a project
013 * or unit tests.
014 *
015 * @version $Revision$ $Date$
016 */
017 @SuppressWarnings( "all" )
018 public class Resource
019 extends FileSet
020 implements java.io.Serializable, java.lang.Cloneable
021 {
022
023 //--------------------------/
024 //- Class/Member Variables -/
025 //--------------------------/
026
027 /**
028 *
029 *
030 * Describe the resource target path. The path is
031 * relative to the target/classes
032 * directory (i.e.
033 * <code>${project.build.outputDirectory}</code>).
034 * For example, if you want that resource to appear
035 * in a specific package
036 * (<code>org.apache.maven.messages</code>), you
037 * must specify this
038 * element with this value:
039 * <code>org/apache/maven/messages</code>.
040 * This is not required if you simply put the
041 * resources in that directory
042 * structure at the source, however.
043 *
044 *
045 */
046 private String targetPath;
047
048 /**
049 *
050 *
051 * Whether resources are filtered to replace tokens
052 * with parameterised values or not.
053 * The values are taken from the
054 * <code>properties</code> element and from the
055 * properties in the files listed in the
056 * <code>filters</code> element. Note: While the type
057 * of this field is <code>String</code> for
058 * technical reasons, the semantic type is actually
059 * <code>Boolean</code>. Default value is
060 * <code>false</code>.
061 *
062 *
063 */
064 private String filtering;
065
066 /**
067 *
068 *
069 * FOR INTERNAL USE ONLY. This is a unique
070 * identifier assigned to each
071 * resource to allow Maven to merge changes to this
072 * resource that take
073 * place during the execution of a plugin. This
074 * field must be managed
075 * by the generated parser and formatter classes in
076 * order to allow it
077 * to survive model interpolation.
078 *
079 *
080 */
081 private String mergeId;
082
083
084 //-----------/
085 //- Methods -/
086 //-----------/
087
088 /**
089 * Method clone.
090 *
091 * @return Resource
092 */
093 public Resource clone()
094 {
095 try
096 {
097 Resource copy = (Resource) super.clone();
098
099 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 }