public abstract class AbstractPropertyEnforcerRule extends AbstractNonCacheableEnforcerRule
Constructor and Description |
---|
AbstractPropertyEnforcerRule() |
Modifier and Type | Method and Description |
---|---|
void |
execute(EnforcerRuleHelper helper)
Execute the rule.
|
abstract String |
getName()
How the property that is being evaluated is called
|
abstract String |
getPropertyName()
The name of the property currently being evaluated, this is used for default message pourpouses only
|
String |
getRegex()
Get the property value to a given regular expression.
|
String |
getRegexMessage()
Get a warning message if the regular expression is not matched.
|
abstract Object |
resolveValue(EnforcerRuleHelper helper)
Resolves the property value
|
void |
setRegex(String regex)
Set the property value to a given regular expression.
|
void |
setRegexMessage(String regexMessage)
Set a warning message if the regular expression is not matched.
|
getCacheId, isCacheable, isResultValid
getLevel, getMessage, setLevel, setMessage
public AbstractPropertyEnforcerRule()
public final void setRegex(String regex)
null
(any value is ok).regex
- The regular expressionpublic final String getRegex()
null
(any value is ok).public final void setRegexMessage(String regexMessage)
regexMessage
- the regex messagepublic final String getRegexMessage()
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
helper
- the helperEnforcerRuleException
- the enforcer rule exceptionpublic abstract String getPropertyName()
public abstract Object resolveValue(EnforcerRuleHelper helper) throws EnforcerRuleException
helper
- EnforcerRuleException
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.