Class ToolExecutionEnvironment
- java.lang.Object
-
- org.codehaus.mojo.jaxb2.shared.environment.AbstractLogAwareFacet
-
- org.codehaus.mojo.jaxb2.shared.environment.ToolExecutionEnvironment
-
- All Implemented Interfaces:
EnvironmentFacet
public class ToolExecutionEnvironment extends AbstractLogAwareFacet
Compound EnvironmentFacet implementation which is used to set up and use a collection of other EnvironmentFacet instances during the run of the JAXB2 Maven Plugin.- Author:
- Lennart Jörelid, jGuru Europe AB
-
-
Field Summary
-
Fields inherited from class org.codehaus.mojo.jaxb2.shared.environment.AbstractLogAwareFacet
log
-
-
Constructor Summary
Constructors Constructor Description ToolExecutionEnvironment(org.apache.maven.plugin.logging.Log mavenLog, ThreadContextClassLoaderBuilder builder, LoggingHandlerEnvironmentFacet loggingHandlerFacet, LocaleFacet localeFacet)
Creates a new ToolExecutionEnvironment object wrapping the supplied Maven Log.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(EnvironmentFacet facet)
Adds the supplied EnvironmentFacet to this ToolExecutionEnvironment.String
getClassPathAsArgument()
Delegate method retrieving the classpath as argument from the underlying ThreadContextClassLoaderHolder.void
restore()
Restores the original Environment, implying that the change performed insetup()
method are restored to the state before the setup method was called.void
setup()
Sets up this Environment, inferring temporary changes to environment variables or conditions.
-
-
-
Constructor Detail
-
ToolExecutionEnvironment
public ToolExecutionEnvironment(org.apache.maven.plugin.logging.Log mavenLog, ThreadContextClassLoaderBuilder builder, LoggingHandlerEnvironmentFacet loggingHandlerFacet, LocaleFacet localeFacet)
Creates a new ToolExecutionEnvironment object wrapping the supplied Maven Log.- Parameters:
mavenLog
- The active Maven Log.builder
- The ThreadContextClassLoaderBuilder used to set up a ThreadContext ClassLoader for this tool execution environment.localeFacet
- An optional LocaleFacet to alter the Locale for the tool execution environment. If the localeFacet isnull
, the locale will not be changed.loggingHandlerFacet
- The EnvironmentFacet for replacing Handlers from Java Util Logging with a Maven Log.
-
-
Method Detail
-
add
public void add(EnvironmentFacet facet)
Adds the supplied EnvironmentFacet to this ToolExecutionEnvironment.- Parameters:
facet
- the non-null EnvironmentFacet to add to this ToolExecutionEnvironment.
-
getClassPathAsArgument
public String getClassPathAsArgument()
Delegate method retrieving the classpath as argument from the underlying ThreadContextClassLoaderHolder. Note that the setup method must be invoked before this one is.- Returns:
- the ClassPath as an argument to external processes such as XJC.
- See Also:
ThreadContextClassLoaderHolder.getClassPathAsArgument()
-
setup
public final void setup()
Sets up this Environment, inferring temporary changes to environment variables or conditions. The changes must be reversible, and should be restored to their original values in therestore()
method.
-
restore
public final void restore()
Restores the original Environment, implying that the change performed insetup()
method are restored to the state before the setup method was called.
-
-