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

org.apache.maven.profiles.ProfilesRoot Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
/*
 * $Id$
 */

package org.apache.maven.profiles;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import java.util.Date;

/**
 * Root element of the profiles.xml file.
 * 
 * @version $Revision$ $Date$
 */
public class ProfilesRoot implements java.io.Serializable {


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

    /**
     * Field profiles.
     */
    private java.util.List profiles;

    /**
     * Field activeProfiles.
     */
    private java.util.List activeProfiles;


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

    /**
     * Method addActiveProfile.
     * 
     * @param string
     */
    public void addActiveProfile( String string )
    {
        if ( !(string instanceof String) )
        {
            throw new ClassCastException( "ProfilesRoot.addActiveProfiles(string) parameter must be instanceof " + String.class.getName() );
        }
        getActiveProfiles().add( string );
    } //-- void addActiveProfile( String ) 

    /**
     * Method addProfile.
     * 
     * @param profile
     */
    public void addProfile( Profile profile )
    {
        if ( !(profile instanceof Profile) )
        {
            throw new ClassCastException( "ProfilesRoot.addProfiles(profile) parameter must be instanceof " + Profile.class.getName() );
        }
        getProfiles().add( profile );
    } //-- void addProfile( Profile ) 

    /**
     * Method getActiveProfiles.
     * 
     * @return java.util.List
     */
    public java.util.List getActiveProfiles()
    {
        if ( this.activeProfiles == null )
        {
            this.activeProfiles = new java.util.ArrayList();
        }
    
        return this.activeProfiles;
    } //-- java.util.List getActiveProfiles() 

    /**
     * Method getProfiles.
     * 
     * @return java.util.List
     */
    public java.util.List getProfiles()
    {
        if ( this.profiles == null )
        {
            this.profiles = new java.util.ArrayList();
        }
    
        return this.profiles;
    } //-- java.util.List getProfiles() 

    /**
     * Method removeActiveProfile.
     * 
     * @param string
     */
    public void removeActiveProfile( String string )
    {
        if ( !(string instanceof String) )
        {
            throw new ClassCastException( "ProfilesRoot.removeActiveProfiles(string) parameter must be instanceof " + String.class.getName() );
        }
        getActiveProfiles().remove( string );
    } //-- void removeActiveProfile( String ) 

    /**
     * Method removeProfile.
     * 
     * @param profile
     */
    public void removeProfile( Profile profile )
    {
        if ( !(profile instanceof Profile) )
        {
            throw new ClassCastException( "ProfilesRoot.removeProfiles(profile) parameter must be instanceof " + Profile.class.getName() );
        }
        getProfiles().remove( profile );
    } //-- void removeProfile( Profile ) 

    /**
     * Set 
     *             List of manually-activated build profiles,
     * specified in the order in which
     *             they should be applied.
     *           
     * 
     * @param activeProfiles
     */
    public void setActiveProfiles( java.util.List activeProfiles )
    {
        this.activeProfiles = activeProfiles;
    } //-- void setActiveProfiles( java.util.List ) 

    /**
     * Set 
     *             Configuration of build profiles for adjusting
     * the build 
     *             according to environmental parameters
     *           .
     * 
     * @param profiles
     */
    public void setProfiles( java.util.List profiles )
    {
        this.profiles = profiles;
    } //-- void setProfiles( java.util.List ) 


    private String modelEncoding = "UTF-8";

    /**
     * Set an encoding used for reading/writing the model.
     *
     * @param modelEncoding the encoding used when reading/writing the model.
     */
    public void setModelEncoding( String modelEncoding )
    {
        this.modelEncoding = modelEncoding;
    }

    /**
     * @return the current encoding used when reading/writing this model.
     */
    public String getModelEncoding()
    {
        return modelEncoding;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy