Package com.qulice.maven
Class DefaultMavenEnvironment
- java.lang.Object
-
- com.qulice.maven.DefaultMavenEnvironment
-
- All Implemented Interfaces:
Environment
public final class DefaultMavenEnvironment extends Object
Environment, passed from MOJO to validators.- Since:
- 0.3
- Suppressed Checkstyle violations:
- ClassDataAbstractionCouplingCheck (300 lines)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.qulice.spi.Environment
Environment.Mock
-
-
Constructor Summary
Constructors Constructor Description DefaultMavenEnvironment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<String>
asserts()
File
basedir()
ClassLoader
classloader()
Collection<String>
classpath()
Properties
config()
org.codehaus.plexus.context.Context
context()
Charset
encoding()
Get source files encoding.boolean
exclude(String check, String name)
Collection<String>
excludes(String checker)
MojoExecutor
executor()
Collection<File>
files(String pattern)
File
outdir()
String
param(String name, String value)
org.apache.maven.project.MavenProject
project()
Properties
properties()
void
setAsser(Collection<String> ass)
Set list of Xpath queries for pom.xml validation.void
setContext(org.codehaus.plexus.context.Context ctx)
Set context.void
setEncoding(String encoding)
void
setExcludes(Collection<String> exprs)
Set list of regular expressions to exclude.void
setMojoExecutor(MojoExecutor exec)
Set executor.void
setProject(org.apache.maven.project.MavenProject proj)
Set Maven Project (used mostly for unit testing).void
setProperty(String name, String value)
Set property.File
tempdir()
-
-
-
Method Detail
-
param
public String param(String name, String value)
- Specified by:
param
in interfaceEnvironment
-
basedir
public File basedir()
- Specified by:
basedir
in interfaceEnvironment
-
tempdir
public File tempdir()
- Specified by:
tempdir
in interfaceEnvironment
-
outdir
public File outdir()
- Specified by:
outdir
in interfaceEnvironment
-
classpath
public Collection<String> classpath()
- Specified by:
classpath
in interfaceEnvironment
-
classloader
public ClassLoader classloader()
- Specified by:
classloader
in interfaceEnvironment
-
project
public org.apache.maven.project.MavenProject project()
-
properties
public Properties properties()
-
context
public org.codehaus.plexus.context.Context context()
-
config
public Properties config()
-
executor
public MojoExecutor executor()
-
asserts
public Collection<String> asserts()
-
files
public Collection<File> files(String pattern)
- Specified by:
files
in interfaceEnvironment
-
exclude
public boolean exclude(String check, String name)
- Specified by:
exclude
in interfaceEnvironment
-
excludes
public Collection<String> excludes(String checker)
- Specified by:
excludes
in interfaceEnvironment
-
setProject
public void setProject(org.apache.maven.project.MavenProject proj)
Set Maven Project (used mostly for unit testing).- Parameters:
proj
- The project to set
-
setContext
public void setContext(org.codehaus.plexus.context.Context ctx)
Set context.- Parameters:
ctx
- The context to set
-
setMojoExecutor
public void setMojoExecutor(MojoExecutor exec)
Set executor.- Parameters:
exec
- The executor
-
setProperty
public void setProperty(String name, String value)
Set property.- Parameters:
name
- Its namevalue
- Its value
-
setExcludes
public void setExcludes(Collection<String> exprs)
Set list of regular expressions to exclude.- Parameters:
exprs
- Expressions
-
setAsser
public void setAsser(Collection<String> ass)
Set list of Xpath queries for pom.xml validation.- Parameters:
ass
- Xpath queries
-
setEncoding
public void setEncoding(String encoding)
-
encoding
public Charset encoding()
Get source files encoding.- Specified by:
encoding
in interfaceEnvironment
- Returns:
- Charset of the source files
-
-