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

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

The newest version!
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.7,
// any modifications will be overwritten.
// ==============================================================

package org.apache.maven.model;

/**
 * 
 *         
 *         The <parent> element contains
 * information required to locate the parent project from which
 *         this project will inherit from.
 *         Note: The children of this element are
 * not interpolated and must be given as literal values.
 *         
 *       
 * 
 * @version $Revision$ $Date$
 */
@SuppressWarnings( "all" )
public class Parent
    implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
{

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

    /**
     * The group id of the parent project to inherit from.
     */
    private String groupId;

    /**
     * The artifact id of the parent project to inherit from.
     */
    private String artifactId;

    /**
     * The version of the parent project to inherit.
     */
    private String version;

    /**
     * 
     *             
     *             The relative path of the parent
     * pom.xml file within the check out.
     *             If not specified, it defaults to
     * ../pom.xml.
     *             Maven looks for the parent POM first in this
     * location on
     *             the filesystem, then the local repository, and
     * lastly in the remote repo.
     *             relativePath allows you to select a
     * different location,
     *             for example when your structure is flat, or
     * deeper without an intermediate parent POM.
     *             However, the group ID, artifact ID and version
     * are still required,
     *             and must match the file in the location given or
     * it will revert to the repository for the POM.
     *             This feature is only for enhancing the
     * development in a local checkout of that project.
     *             Set the value to an empty string in case you
     * want to disable the feature and always resolve
     *             the parent POM from the repositories.
     *             
     *           
     */
    private String relativePath = "../pom.xml";

    /**
     * Field locations.
     */
    private java.util.Map locations;


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

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

            if ( copy.locations != null )
            {
                copy.locations = new java.util.LinkedHashMap( copy.locations );
            }

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

    /**
     * Get the artifact id of the parent project to inherit from.
     * 
     * @return String
     */
    public String getArtifactId()
    {
        return this.artifactId;
    } //-- String getArtifactId()

    /**
     * Get the group id of the parent project to inherit from.
     * 
     * @return String
     */
    public String getGroupId()
    {
        return this.groupId;
    } //-- String getGroupId()

    /**
     * 
     * 
     * @param key
     * @return InputLocation
     */
    public InputLocation getLocation( Object key )
    {
        return ( locations != null ) ? locations.get( key ) : null;
    } //-- InputLocation getLocation( Object )

    /**
     * Get the relative path of the parent pom.xml
     * file within the check out.
     *             If not specified, it defaults to
     * ../pom.xml.
     *             Maven looks for the parent POM first in this
     * location on
     *             the filesystem, then the local repository, and
     * lastly in the remote repo.
     *             relativePath allows you to select a
     * different location,
     *             for example when your structure is flat, or
     * deeper without an intermediate parent POM.
     *             However, the group ID, artifact ID and version
     * are still required,
     *             and must match the file in the location given or
     * it will revert to the repository for the POM.
     *             This feature is only for enhancing the
     * development in a local checkout of that project.
     *             Set the value to an empty string in case you
     * want to disable the feature and always resolve
     *             the parent POM from the repositories.
     * 
     * @return String
     */
    public String getRelativePath()
    {
        return this.relativePath;
    } //-- String getRelativePath()

    /**
     * Get the version of the parent project to inherit.
     * 
     * @return String
     */
    public String getVersion()
    {
        return this.version;
    } //-- String getVersion()

    /**
     * Set the artifact id of the parent project to inherit from.
     * 
     * @param artifactId
     */
    public void setArtifactId( String artifactId )
    {
        this.artifactId = artifactId;
    } //-- void setArtifactId( String )

    /**
     * Set the group id of the parent project to inherit from.
     * 
     * @param groupId
     */
    public void setGroupId( String groupId )
    {
        this.groupId = groupId;
    } //-- void setGroupId( String )

    /**
     * 
     * 
     * @param key
     * @param location
     */
    public void setLocation( Object key, InputLocation location )
    {
        if ( location != null )
        {
            if ( this.locations == null )
            {
                this.locations = new java.util.LinkedHashMap();
            }
            this.locations.put( key, location );
        }
    } //-- void setLocation( Object, InputLocation )

    /**
     * Set the relative path of the parent pom.xml
     * file within the check out.
     *             If not specified, it defaults to
     * ../pom.xml.
     *             Maven looks for the parent POM first in this
     * location on
     *             the filesystem, then the local repository, and
     * lastly in the remote repo.
     *             relativePath allows you to select a
     * different location,
     *             for example when your structure is flat, or
     * deeper without an intermediate parent POM.
     *             However, the group ID, artifact ID and version
     * are still required,
     *             and must match the file in the location given or
     * it will revert to the repository for the POM.
     *             This feature is only for enhancing the
     * development in a local checkout of that project.
     *             Set the value to an empty string in case you
     * want to disable the feature and always resolve
     *             the parent POM from the repositories.
     * 
     * @param relativePath
     */
    public void setRelativePath( String relativePath )
    {
        this.relativePath = relativePath;
    } //-- void setRelativePath( String )

    /**
     * Set the version of the parent project to inherit.
     * 
     * @param version
     */
    public void setVersion( String version )
    {
        this.version = version;
    } //-- void setVersion( String )

    
            
    /**
     * @return the id as groupId:artifactId:version
     */
    public String getId()
    {
        StringBuilder id = new StringBuilder( 64 );

        id.append( getGroupId() );
        id.append( ":" );
        id.append( getArtifactId() );
        id.append( ":" );
        id.append( "pom" );
        id.append( ":" );
        id.append( getVersion() );

        return id.toString();
    }

    @Override
    public String toString()
    {
        return getId();
    }
            
          
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy