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)
If the rule is cacheable and the same id is found in the cache, the stored results are passed to this method to
allow double checking of the results.
|
java.lang.String |
resolveValue(EnforcerRuleHelper helper)
Resolves the property value
|
void |
setVariableName(java.lang.String variableName) |
execute, getRegex, getRegexMessage, setRegex, setRegexMessage
getLevel, getMessage, setLevel, setMessage
public 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)
AbstractPropertyEnforcerRule
resolveValue
in class AbstractPropertyEnforcerRule
public boolean isCacheable()
EnforcerRule
isCacheable
in interface EnforcerRule
isCacheable
in class AbstractNonCacheableEnforcerRule
true
if rule is cacheablepublic boolean isResultValid(EnforcerRule cachedRule)
EnforcerRule
isResultValid
in interface EnforcerRule
isResultValid
in class AbstractNonCacheableEnforcerRule
cachedRule
- 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()
EnforcerRule
getCacheId
in interface EnforcerRule
getCacheId
in class AbstractNonCacheableEnforcerRule
public java.lang.String getPropertyName()
AbstractPropertyEnforcerRule
getPropertyName
in class AbstractPropertyEnforcerRule
public java.lang.String getName()
AbstractPropertyEnforcerRule
getName
in class AbstractPropertyEnforcerRule