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

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

There is a newer version: 1.3.3
Show newest version
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.8.3,
// any modifications will be overwritten.
// ==============================================================

package org.apache.maven.model;

/**
 * Definition of include or exclude patterns.
 * 
 * @version $Revision$ $Date$
 */
@SuppressWarnings( "all" )
public class PatternSet
    implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
{

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

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

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

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


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

    /**
     * Method addExclude.
     * 
     * @param string
     */
    public void addExclude( String string )
    {
        getExcludes().add( string );
    } //-- void addExclude( String )

    /**
     * Method addInclude.
     * 
     * @param string
     */
    public void addInclude( String string )
    {
        getIncludes().add( string );
    } //-- void addInclude( String )

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

            if ( this.includes != null )
            {
                copy.includes = new java.util.ArrayList();
                copy.includes.addAll( this.includes );
            }

            if ( this.excludes != null )
            {
                copy.excludes = new java.util.ArrayList();
                copy.excludes.addAll( this.excludes );
            }

            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 );
        }
    } //-- PatternSet clone()

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

        return this.excludes;
    } //-- java.util.List getExcludes()

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

        return this.includes;
    } //-- java.util.List getIncludes()

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

    /**
     * Method removeExclude.
     * 
     * @param string
     */
    public void removeExclude( String string )
    {
        getExcludes().remove( string );
    } //-- void removeExclude( String )

    /**
     * Method removeInclude.
     * 
     * @param string
     */
    public void removeInclude( String string )
    {
        getIncludes().remove( string );
    } //-- void removeInclude( String )

    /**
     * Set a list of patterns to exclude, e.g.
     * **/*.xml
     * 
     * @param excludes
     */
    public void setExcludes( java.util.List excludes )
    {
        this.excludes = excludes;
    } //-- void setExcludes( java.util.List )

    /**
     * Set a list of patterns to include, e.g.
     * **/*.xml.
     * 
     * @param includes
     */
    public void setIncludes( java.util.List includes )
    {
        this.includes = includes;
    } //-- void setIncludes( java.util.List )

    /**
     * 
     * 
     * @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 )

    
            
    /**
     * @see java.lang.Object#toString()
     */
    public String toString()
    {
        StringBuilder sb = new StringBuilder( 128 );

        sb.append("PatternSet [includes: {");
        for (java.util.Iterator i = getIncludes().iterator(); i.hasNext(); )
        {
            String str = (String) i.next();
            sb.append(str).append(", ");
        }
        if (sb.substring(sb.length() - 2).equals(", ")) sb.delete(sb.length() - 2, sb.length());

        sb.append("}, excludes: {");
        for (java.util.Iterator i = getExcludes().iterator(); i.hasNext(); )
        {
            String str = (String) i.next();
            sb.append(str).append(", ");
        }
        if (sb.substring(sb.length() - 2).equals(", ")) sb.delete(sb.length() - 2, sb.length());

        sb.append("}]");
        return sb.toString();
    }
            
          
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy