Class SystemPropertySaveEnvironmentFacet
java.lang.Object
org.codehaus.mojo.jaxb2.shared.environment.AbstractLogAwareFacet
org.codehaus.mojo.jaxb2.shared.environment.sysprops.SystemPropertySaveEnvironmentFacet
- All Implemented Interfaces:
EnvironmentFacet
EnvironmentFacet which saves the value of a system property for the duration
of executing a tool. This may be required for tools (such as the XJC tool) which
may overwrite property values for its own purpose.
Unlike
SystemPropertyChangeEnvironmentFacet
, this does not a set a new
property value itself, just saves the old value and later restores or clears it.
This facet accepts the key of the property to save.- Since:
- 2.5
-
Field Summary
FieldsFields inherited from class org.codehaus.mojo.jaxb2.shared.environment.AbstractLogAwareFacet
log
-
Constructor Summary
ConstructorsConstructorDescriptionSystemPropertySaveEnvironmentFacet
(String key, org.apache.maven.plugin.logging.Log log) Creates a SystemPropertySave which will remember the original value of the supplied system property for the duration of this SystemPropertySave. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.toString()
-
Field Details
-
key
-
originalValue
-
-
Constructor Details
-
SystemPropertySaveEnvironmentFacet
Creates a SystemPropertySave which will remember the original value of the supplied system property for the duration of this SystemPropertySave.- Parameters:
key
- A non-null key.log
- The active Maven Log.
-
-
Method Details
-
restore
public void restore()Restores the original Environment, implying that the change performed insetup()
method are restored to the state before the setup method was called. -
setup
public 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. -
toString
-