public class RequireEnvironmentVariable extends AbstractPropertyEnforcerRule
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
variableName
Specify the required variable.
|
| Constructor and Description |
|---|
RequireEnvironmentVariable() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCacheId()
If the rule is to be cached, this id is used as part of the key.
|
java.lang.String |
getName()
How the property that is being evaluated is called
|
java.lang.String |
getPropertyName()
The name of the property currently being evaluated, this is used for default message pourpouses only
|
java.lang.String |
getVariableName() |
boolean |
isCacheable()
This method tells the enforcer if the rule results may be cached.
|
boolean |
isResultValid(EnforcerRule cachedRule)
Checks if cached result is valid.
|
java.lang.String |
resolveValue(EnforcerRuleHelper helper)
Resolves the property value
|
void |
setVariableName(java.lang.String variableName) |
execute, getRegex, getRegexMessage, setRegex, setRegexMessagegetLevel, getMessage, setLevel, setMessagepublic final void setVariableName(java.lang.String variableName)
variableName - the variable namesetVariableName(String),
getVariableName()public final java.lang.String getVariableName()
public java.lang.String resolveValue(EnforcerRuleHelper helper)
AbstractPropertyEnforcerRuleresolveValue in class AbstractPropertyEnforcerRulepublic boolean isCacheable()
EnforcerRuleisCacheable in interface EnforcerRuleisCacheable in class AbstractNonCacheableEnforcerRuletrue if rule is cacheablepublic boolean isResultValid(EnforcerRule cachedRule)
EnforcerRuleisResultValid in interface EnforcerRuleisResultValid in class AbstractNonCacheableEnforcerRulecachedRule - the last cached instance of the rule. This is to be used by the rule to
potentially determine if the results are still valid (ie if the configuration has been overridden)true if the stored results are valid for the same id.public java.lang.String getCacheId()
EnforcerRulegetCacheId in interface EnforcerRulegetCacheId in class AbstractNonCacheableEnforcerRulepublic java.lang.String getPropertyName()
AbstractPropertyEnforcerRulegetPropertyName in class AbstractPropertyEnforcerRulepublic java.lang.String getName()
AbstractPropertyEnforcerRulegetName in class AbstractPropertyEnforcerRule