Class EclipseSourceDir
- java.lang.Object
-
- org.apache.maven.plugin.eclipse.EclipseSourceDir
-
- All Implemented Interfaces:
Comparable
public class EclipseSourceDir extends Object implements Comparable
Represent an eclipse source dir. Eclipse has no "main", "test" or "resource" concepts, so two source dirs with the same path are equal.source directories should always have a null output value.
- Version:
- $Id$
- Author:
- Fabrizio Giustina
-
-
Constructor Summary
Constructors Constructor Description EclipseSourceDir(String path, String output, boolean isResource, boolean test, List include, List exclude, boolean filtering)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object obj)
boolean
equals(Object obj)
List
getExclude()
Getter forexclude
.String
getExcludeAsString()
List
getInclude()
Getter forinclude
.String
getIncludeAsString()
String
getOutput()
Getter foroutput
.String
getPath()
Getter forpath
.int
hashCode()
boolean
isFiltering()
Wheter this resource should be copied with filtering.boolean
isResource()
Getter forisResource
.boolean
isTest()
Getter fortest
.boolean
merge(EclipseSourceDir mergeWith)
Merge with the provided directory.void
setExclude(List exclude)
Setter forexclude
.void
setFiltering(boolean filtering)
Wheter this resource should be copied with filtering.void
setInclude(List include)
Setter forinclude
.void
setOutput(String output)
Setter foroutput
.void
setPath(String path)
Setter forpath
.void
setTest(boolean test)
Setter fortest
.String
toString()
-
-
-
Constructor Detail
-
EclipseSourceDir
public EclipseSourceDir(String path, String output, boolean isResource, boolean test, List include, List exclude, boolean filtering)
- Parameters:
path
- the eclipse source directoryoutput
- path output directoryisResource
- true if the directory only contains resources, false if a compilation directorytest
- true if is a test directory, false otherwiseinclude
- a string in the eclipse pattern format for the include filterexclude
- a string in the eclipse pattern format for the exclude filterfiltering
- true if filtering should be applied, false otherwise. Note: Filtering will only be applied if this become a "special directory" by being nested within the default output directory.
-
-
Method Detail
-
getExclude
public List getExclude()
Getter forexclude
.- Returns:
- Returns the exclude. Never null.
-
setExclude
public void setExclude(List exclude)
Setter forexclude
.- Parameters:
exclude
- The exclude to set.
-
getInclude
public List getInclude()
Getter forinclude
.- Returns:
- Returns the include. Never null.
-
setInclude
public void setInclude(List include)
Setter forinclude
.- Parameters:
include
- The include to set.
-
getExcludeAsString
public String getExcludeAsString()
- Returns:
- Returns the exclude as a string pattern suitable for eclipse
-
getIncludeAsString
public String getIncludeAsString()
- Returns:
- Returns the include as a string pattern suitable for eclipse
-
getOutput
public String getOutput()
Getter foroutput
.source directories should always have a null output value.
- Returns:
- Returns the output.
-
setOutput
public void setOutput(String output)
Setter foroutput
.- Parameters:
output
- The output to set.
-
getPath
public String getPath()
Getter forpath
.- Returns:
- Returns the path.
-
setPath
public void setPath(String path)
Setter forpath
. Converts \\ to / in path.- Parameters:
path
- The path to set.
-
isTest
public boolean isTest()
Getter fortest
.- Returns:
- Returns the test.
-
setTest
public void setTest(boolean test)
Setter fortest
.- Parameters:
test
- The test to set.
-
isResource
public boolean isResource()
Getter forisResource
.- Returns:
- Returns the isResource.
-
isFiltering
public boolean isFiltering()
Wheter this resource should be copied with filtering.
-
setFiltering
public void setFiltering(boolean filtering)
Wheter this resource should be copied with filtering.- Parameters:
filtering
- filter resources
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
compareTo
public int compareTo(Object obj)
- Specified by:
compareTo
in interfaceComparable
- See Also:
Comparable.compareTo(java.lang.Object)
-
merge
public boolean merge(EclipseSourceDir mergeWith) throws org.apache.maven.plugin.MojoExecutionException
Merge with the provided directory.If one directory is a source and the other is a resource directory then the result will be a source directory and any includes or excludes will be removed since Eclipse has no "main", "test" or "resource" concepts. The output directory will be the source directories value.
If the two directories are the same resources type (i.e isResource is equal) then the result will be the same resource type with the includes from each merged together (duplicates will be removed), similarly for the excludes. No effort is made to ensure that the includes and excludes are disjointed sets. Please fix your pom instead.
No support for cases where the test, or filtering values are not identical.
- Parameters:
mergeWith
- the directory to merge with- Throws:
org.apache.maven.plugin.MojoExecutionException
- test or filtering values are not identical, or isResource true and output are not identical
-
-