|
||||||||||
| 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 | |
|---|---|
String |
arch
Runtime information containing Maven Version. |
boolean |
display
Display detected OS information. |
String |
family
The OS family type desired Possible values: dos mac netware os/2 tandem unix windows win9x z/os os/400 |
String |
message
Specify an optional message to the user if the rule fails. |
String |
name
Runtime information containing Maven Version. |
static String |
OS_ARCH
|
static String |
OS_NAME
|
static String |
OS_VERSION
|
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. |
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)
|
String |
getArch()
|
String |
getFamily()
|
String |
getName()
|
Set |
getValidFamilies()
|
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(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(String theArch)
|
void |
setFamily(String theFamily)
|
void |
setName(String theName)
|
void |
setValidFamilies(Set theValidFamilies)
|
void |
setVersion(String theVersion)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public String family
public String name
public String version
public String arch
public String message
public boolean display
public static final String OS_NAME
public static final String OS_ARCH
public static final 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.EnforcerRuleorg.apache.maven.shared.enforcer.rule.api.EnforcerRuleException
public void displayOSInfo(org.apache.maven.plugin.logging.Log log,
boolean info)
log - public String determineOsFamily()
public boolean isAllowed()
public boolean allParamsEmpty()
public boolean isValidFamily(String theFamily)
theFamily - the family to check.
public String getArch()
public void setArch(String theArch)
theArch - the arch to setpublic String getFamily()
public void setFamily(String theFamily)
theFamily - the family to setpublic String getName()
public void setName(String theName)
theName - the name to setpublic String getVersion()
public void setVersion(String theVersion)
theVersion - the version to setpublic Set getValidFamilies()
public void setValidFamilies(Set theValidFamilies)
theValidFamilies - the validFamilies to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||