PatternSet.java
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.9.1,
// 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<String> includes;
/**
* Field excludes.
*/
private java.util.List<String> excludes;
/**
* Field locations.
*/
private java.util.Map<Object, InputLocation> 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<String>();
copy.includes.addAll( this.includes );
}
if ( this.excludes != null )
{
copy.excludes = new java.util.ArrayList<String>();
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<String> getExcludes()
{
if ( this.excludes == null )
{
this.excludes = new java.util.ArrayList<String>();
}
return this.excludes;
} //-- java.util.List<String> getExcludes()
/**
* Method getIncludes.
*
* @return List
*/
public java.util.List<String> getIncludes()
{
if ( this.includes == null )
{
this.includes = new java.util.ArrayList<String>();
}
return this.includes;
} //-- java.util.List<String> 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.
* <code>**/*.xml</code>
*
* @param excludes
*/
public void setExcludes( java.util.List<String> excludes )
{
this.excludes = excludes;
} //-- void setExcludes( java.util.List )
/**
* Set a list of patterns to include, e.g.
* <code>**/*.xml</code>.
*
* @param includes
*/
public void setIncludes( java.util.List<String> 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<Object, InputLocation>();
}
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();
}
}