Package org.apache.maven.model
Class Activation
- java.lang.Object
-
- org.apache.maven.model.Activation
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,InputLocationTracker
public class Activation extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, InputLocationTracker
The conditions within the build runtime environment which will trigger the automatic inclusion of the build profile. Multiple conditions can be defined, which must be all satisfied to activate the profile.- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private booleanactiveByDefaultIf set to true, this profile will be active unless another profile in this pom is activated using the command line -P option or by one of that profile's activators.private InputLocationactiveByDefaultLocationField activeByDefaultLocation.private ActivationFilefileSpecifies that this profile will be activated based on existence of a file.private InputLocationfileLocationField fileLocation.private java.lang.StringjdkSpecifies that this profile will be activated when a matching JDK is detected.private InputLocationjdkLocationField jdkLocation.private InputLocationlocationField location.private java.util.Map<java.lang.Object,InputLocation>locationsField locations.private ActivationOSosSpecifies that this profile will be activated when matching operating system attributes are detected.private InputLocationosLocationField osLocation.private ActivationPropertypropertySpecifies that this profile will be activated when this system property is specified.private InputLocationpropertyLocationField propertyLocation.
-
Constructor Summary
Constructors Constructor Description Activation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Activationclone()Method clone.ActivationFilegetFile()Get specifies that this profile will be activated based on existence of a file.java.lang.StringgetJdk()Get specifies that this profile will be activated when a matching JDK is detected.InputLocationgetLocation(java.lang.Object key)Gets the location of the specified field in the input source.ActivationOSgetOs()Get specifies that this profile will be activated when matching operating system attributes are detected.private InputLocationgetOtherLocation(java.lang.Object key)ActivationPropertygetProperty()Get specifies that this profile will be activated when this system property is specified.booleanisActiveByDefault()Get if set to true, this profile will be active unless another profile in this pom is activated using the command line -P option or by one of that profile's activators.voidsetActiveByDefault(boolean activeByDefault)Set if set to true, this profile will be active unless another profile in this pom is activated using the command line -P option or by one of that profile's activators.voidsetFile(ActivationFile file)Set specifies that this profile will be activated based on existence of a file.voidsetJdk(java.lang.String jdk)Set specifies that this profile will be activated when a matching JDK is detected.voidsetLocation(java.lang.Object key, InputLocation location)Sets the location of the specified field.voidsetOs(ActivationOS os)Set specifies that this profile will be activated when matching operating system attributes are detected.voidsetOtherLocation(java.lang.Object key, InputLocation location)voidsetProperty(ActivationProperty property)Set specifies that this profile will be activated when this system property is specified.
-
-
-
Field Detail
-
activeByDefault
private boolean activeByDefault
If set to true, this profile will be active unless another profile in this pom is activated using the command line -P option or by one of that profile's activators.
-
jdk
private java.lang.String jdk
Specifies that this profile will be activated when a matching JDK is detected. For example,1.4only activates on JDKs versioned 1.4, while!1.4matches any JDK that is not version 1.4. Ranges are supported too:[1.5,)activates when the JDK is 1.5 minimum.
-
os
private ActivationOS os
Specifies that this profile will be activated when matching operating system attributes are detected.
-
property
private ActivationProperty property
Specifies that this profile will be activated when this system property is specified.
-
file
private ActivationFile file
Specifies that this profile will be activated based on existence of a file.
-
locations
private java.util.Map<java.lang.Object,InputLocation> locations
Field locations.
-
location
private InputLocation location
Field location.
-
activeByDefaultLocation
private InputLocation activeByDefaultLocation
Field activeByDefaultLocation.
-
jdkLocation
private InputLocation jdkLocation
Field jdkLocation.
-
osLocation
private InputLocation osLocation
Field osLocation.
-
propertyLocation
private InputLocation propertyLocation
Field propertyLocation.
-
fileLocation
private InputLocation fileLocation
Field fileLocation.
-
-
Method Detail
-
clone
public Activation clone()
Method clone.- Overrides:
clonein classjava.lang.Object- Returns:
- Activation
-
getFile
public ActivationFile getFile()
Get specifies that this profile will be activated based on existence of a file.- Returns:
- ActivationFile
-
getJdk
public java.lang.String getJdk()
Get specifies that this profile will be activated when a matching JDK is detected. For example,1.4only activates on JDKs versioned 1.4, while!1.4matches any JDK that is not version 1.4. Ranges are supported too:[1.5,)activates when the JDK is 1.5 minimum.- Returns:
- String
-
getLocation
public InputLocation getLocation(java.lang.Object key)
Description copied from interface:InputLocationTrackerGets the location of the specified field in the input source.- Specified by:
getLocationin interfaceInputLocationTracker- Parameters:
key-- Returns:
- InputLocation
-
getOs
public ActivationOS getOs()
Get specifies that this profile will be activated when matching operating system attributes are detected.- Returns:
- ActivationOS
-
setLocation
public void setLocation(java.lang.Object key, InputLocation location)Description copied from interface:InputLocationTrackerSets the location of the specified field.- Specified by:
setLocationin interfaceInputLocationTracker- Parameters:
key-location-
-
setOtherLocation
public void setOtherLocation(java.lang.Object key, InputLocation location)- Parameters:
key-location-
-
getOtherLocation
private InputLocation getOtherLocation(java.lang.Object key)
- Parameters:
key-- Returns:
- InputLocation
-
getProperty
public ActivationProperty getProperty()
Get specifies that this profile will be activated when this system property is specified.- Returns:
- ActivationProperty
-
isActiveByDefault
public boolean isActiveByDefault()
Get if set to true, this profile will be active unless another profile in this pom is activated using the command line -P option or by one of that profile's activators.- Returns:
- boolean
-
setActiveByDefault
public void setActiveByDefault(boolean activeByDefault)
Set if set to true, this profile will be active unless another profile in this pom is activated using the command line -P option or by one of that profile's activators.- Parameters:
activeByDefault-
-
setFile
public void setFile(ActivationFile file)
Set specifies that this profile will be activated based on existence of a file.- Parameters:
file-
-
setJdk
public void setJdk(java.lang.String jdk)
Set specifies that this profile will be activated when a matching JDK is detected. For example,1.4only activates on JDKs versioned 1.4, while!1.4matches any JDK that is not version 1.4. Ranges are supported too:[1.5,)activates when the JDK is 1.5 minimum.- Parameters:
jdk-
-
setOs
public void setOs(ActivationOS os)
Set specifies that this profile will be activated when matching operating system attributes are detected.- Parameters:
os-
-
setProperty
public void setProperty(ActivationProperty property)
Set specifies that this profile will be activated when this system property is specified.- Parameters:
property-
-
-