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