|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.plugin.enforcer.RequireOS
public class RequireOS
This rule checks that the OS is allowed by combinations of family, name, version and cpu architecture. The behavior is exactly the same as the Maven Os profile activation so the same values are allowed here.
Field Summary | |
---|---|
java.lang.String |
arch
Runtime information containing Maven Version. |
boolean |
display
Display detected OS information. |
java.lang.String |
family
The OS family type desired Possible values: dos mac netware os/2 tandem unix windows win9x z/os os/400 |
java.lang.String |
message
Specify an optional message to the user if the rule fails. |
java.lang.String |
name
Runtime information containing Maven Version. |
static java.lang.String |
OS_ARCH
|
static java.lang.String |
OS_NAME
|
static java.lang.String |
OS_VERSION
|
java.lang.String |
version
Runtime information containing Maven Version. |
Constructor Summary | |
---|---|
RequireOS()
|
Method Summary | |
---|---|
boolean |
allParamsEmpty()
Helper method to check that at least one of family, name, version or arch is set. |
java.lang.String |
determineOsFamily()
Helper method to determine the current OS family. |
void |
displayOSInfo(org.apache.maven.plugin.logging.Log log,
boolean info)
Log the current OS information |
void |
execute(org.apache.maven.shared.enforcer.rule.api.EnforcerRuleHelper helper)
|
java.lang.String |
getArch()
|
java.lang.String |
getFamily()
|
java.lang.String |
getName()
|
java.util.Set |
getValidFamilies()
|
java.lang.String |
getVersion()
|
boolean |
isAllowed()
Helper method to determine if the current OS is allowed based on the injected values for family, name, version and arch. |
boolean |
isValidFamily(java.lang.String theFamily)
Helper method to check if the given family is in the following list: dos mac netware os/2 tandem unix windows win9x z/os os/400 Note: '!' is allowed at the beginning of the string and still considered valid. |
void |
setArch(java.lang.String theArch)
|
void |
setFamily(java.lang.String theFamily)
|
void |
setName(java.lang.String theName)
|
void |
setValidFamilies(java.util.Set theValidFamilies)
|
void |
setVersion(java.lang.String theVersion)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String family
public java.lang.String name
public java.lang.String version
public java.lang.String arch
public java.lang.String message
public boolean display
public static final java.lang.String OS_NAME
public static final java.lang.String OS_ARCH
public static final java.lang.String OS_VERSION
Constructor Detail |
---|
public RequireOS()
Method Detail |
---|
public void execute(org.apache.maven.shared.enforcer.rule.api.EnforcerRuleHelper helper) throws org.apache.maven.shared.enforcer.rule.api.EnforcerRuleException
execute
in interface org.apache.maven.shared.enforcer.rule.api.EnforcerRule
org.apache.maven.shared.enforcer.rule.api.EnforcerRuleException
public void displayOSInfo(org.apache.maven.plugin.logging.Log log, boolean info)
log
- public java.lang.String determineOsFamily()
public boolean isAllowed()
public boolean allParamsEmpty()
public boolean isValidFamily(java.lang.String theFamily)
theFamily
- the family to check.
public java.lang.String getArch()
public void setArch(java.lang.String theArch)
theArch
- the arch to setpublic java.lang.String getFamily()
public void setFamily(java.lang.String theFamily)
theFamily
- the family to setpublic java.lang.String getName()
public void setName(java.lang.String theName)
theName
- the name to setpublic java.lang.String getVersion()
public void setVersion(java.lang.String theVersion)
theVersion
- the version to setpublic java.util.Set getValidFamilies()
public void setValidFamilies(java.util.Set theValidFamilies)
theValidFamilies
- the validFamilies to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |