public class RequireEnvironmentVariable extends AbstractPropertyEnforcerRule
Constructor and Description |
---|
RequireEnvironmentVariable() |
Modifier and Type | Method and Description |
---|---|
String |
getCacheId()
If the rule is to be cached, this id is used as part of the key.
|
String |
getName()
How the property that is being evaluated is called
|
String |
getPropertyName()
The name of the property currently being evaluated, this is used for default message pourpouses only
|
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.
|
String |
resolveValue(EnforcerRuleHelper helper)
Resolves the property value
|
void |
setVariableName(String variableName) |
execute, getRegex, getRegexMessage, setRegex, setRegexMessage
getLevel, getMessage, setLevel, setMessage
public RequireEnvironmentVariable()
public final void setVariableName(String variableName)
variableName
- the variable namesetVariableName(String)
,
getVariableName()
public final String getVariableName()
public 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 String getCacheId()
EnforcerRule
getCacheId
in interface EnforcerRule
getCacheId
in class AbstractNonCacheableEnforcerRule
public String getPropertyName()
AbstractPropertyEnforcerRule
getPropertyName
in class AbstractPropertyEnforcerRule
public String getName()
AbstractPropertyEnforcerRule
getName
in class AbstractPropertyEnforcerRule
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.