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