All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.maven.model.Resource Maven / Gradle / Ivy

There is a newer version: 3.0.0-alpha-3
Show newest version
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 2.1.2,
// any modifications will be overwritten.
// ==============================================================

package org.apache.maven.model;

/**
 * This element describes all of the classpath resources associated
 * with a project
 *         or unit tests.
 * 
 * @version $Revision$ $Date$
 */
@SuppressWarnings( "all" )
public class Resource
    extends FileSet
    implements java.io.Serializable, java.lang.Cloneable
{

      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * 
     *             
     *             Describe the resource target path. The path is
     * relative to the target/classes
     *             directory (i.e.
     * ${project.build.outputDirectory}).
     *             For example, if you want that resource to appear
     * in a specific package
     *             (org.apache.maven.messages), you
     * must specify this
     *             element with this value:
     * org/apache/maven/messages.
     *             This is not required if you simply put the
     * resources in that directory
     *             structure at the source, however.
     *             
     *           
     */
    private String targetPath;

    /**
     * 
     *             
     *             Whether resources are filtered to replace tokens
     * with parameterised values or not.
     *             The values are taken from the
     * properties element and from the
     *             properties in the files listed in the
     * filters element. Note: While the type
     *             of this field is String for
     * technical reasons, the semantic type is actually
     *             Boolean. Default value is
     * false.
     *             
     *           
     */
    private String filtering;

    /**
     * 
     *             
     *             FOR INTERNAL USE ONLY. This is a unique
     * identifier assigned to each
     *             resource to allow Maven to merge changes to this
     * resource that take
     *             place during the execution of a plugin. This
     * field must be managed
     *             by the generated parser and formatter classes in
     * order to allow it
     *             to survive model interpolation.
     *             
     *           
     */
    private String mergeId;


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method clone.
     * 
     * @return Resource
     */
    public Resource clone()
    {
        try
        {
            Resource copy = (Resource) super.clone();

            return copy;
        }
        catch ( java.lang.Exception ex )
        {
            throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
                + " does not support clone()" ).initCause( ex );
        }
    } //-- Resource clone()

    /**
     * Get whether resources are filtered to replace tokens with
     * parameterised values or not.
     *             The values are taken from the
     * properties element and from the
     *             properties in the files listed in the
     * filters element. Note: While the type
     *             of this field is String for
     * technical reasons, the semantic type is actually
     *             Boolean. Default value is
     * false.
     * 
     * @return String
     */
    public String getFiltering()
    {
        return this.filtering;
    } //-- String getFiltering()

    /**
     * Get fOR INTERNAL USE ONLY. This is a unique identifier
     * assigned to each
     *             resource to allow Maven to merge changes to this
     * resource that take
     *             place during the execution of a plugin. This
     * field must be managed
     *             by the generated parser and formatter classes in
     * order to allow it
     *             to survive model interpolation.
     * 
     * @return String
     */
    public String getMergeId()
    {
        return this.mergeId;
    } //-- String getMergeId()

    /**
     * Get describe the resource target path. The path is relative
     * to the target/classes
     *             directory (i.e.
     * ${project.build.outputDirectory}).
     *             For example, if you want that resource to appear
     * in a specific package
     *             (org.apache.maven.messages), you
     * must specify this
     *             element with this value:
     * org/apache/maven/messages.
     *             This is not required if you simply put the
     * resources in that directory
     *             structure at the source, however.
     * 
     * @return String
     */
    public String getTargetPath()
    {
        return this.targetPath;
    } //-- String getTargetPath()

    /**
     * Set whether resources are filtered to replace tokens with
     * parameterised values or not.
     *             The values are taken from the
     * properties element and from the
     *             properties in the files listed in the
     * filters element. Note: While the type
     *             of this field is String for
     * technical reasons, the semantic type is actually
     *             Boolean. Default value is
     * false.
     * 
     * @param filtering a filtering object.
     */
    public void setFiltering( String filtering )
    {
        this.filtering = filtering;
    } //-- void setFiltering( String )

    /**
     * Set fOR INTERNAL USE ONLY. This is a unique identifier
     * assigned to each
     *             resource to allow Maven to merge changes to this
     * resource that take
     *             place during the execution of a plugin. This
     * field must be managed
     *             by the generated parser and formatter classes in
     * order to allow it
     *             to survive model interpolation.
     * 
     * @param mergeId a mergeId object.
     */
    public void setMergeId( String mergeId )
    {
        this.mergeId = mergeId;
    } //-- void setMergeId( String )

    /**
     * Set describe the resource target path. The path is relative
     * to the target/classes
     *             directory (i.e.
     * ${project.build.outputDirectory}).
     *             For example, if you want that resource to appear
     * in a specific package
     *             (org.apache.maven.messages), you
     * must specify this
     *             element with this value:
     * org/apache/maven/messages.
     *             This is not required if you simply put the
     * resources in that directory
     *             structure at the source, however.
     * 
     * @param targetPath a targetPath object.
     */
    public void setTargetPath( String targetPath )
    {
        this.targetPath = targetPath;
    } //-- void setTargetPath( String )

    
            
    private static int mergeIdCounter = 0;

    public void initMergeId()
    {
        if ( getMergeId() == null )
        {
            setMergeId( "resource-" + (mergeIdCounter++) );
        }
    }

    public boolean isFiltering()
    {
        return ( filtering != null ) ? Boolean.parseBoolean( filtering ) : false;
    }

    public void setFiltering( boolean filtering )
    {
        this.filtering = String.valueOf( filtering );
    }

    /**
     * @see java.lang.Object#toString()
     */
    public String toString()
    {
        return "Resource {targetPath: " + getTargetPath() + ", filtering: " + isFiltering() + ", " + super.toString() + "}";
    }
            
          
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy