Package net.sourceforge.pmd.reporting
Interface ViolationDecorator
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ViolationDecorator
Adds additional key/value pairs to a violation in a language-specific manner. The keys are completely free.RuleViolation
defines some of these keys.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Map<String,String>
apply(ViolationDecorator decorator, Node violationNode)
static ViolationDecorator
chain(List<? extends ViolationDecorator> list)
Apply several decorators in a chain.void
decorate(Node violationNode, Map<String,String> additionalInfo)
Compute additional key/value pairs about the violation that should be reflected inRuleViolation.getAdditionalInfo()
.static ViolationDecorator
noop()
-
-
-
Method Detail
-
decorate
void decorate(Node violationNode, Map<String,String> additionalInfo)
Compute additional key/value pairs about the violation that should be reflected inRuleViolation.getAdditionalInfo()
. This additional info should be accumulated into theadditionalInfo
parameter.- Parameters:
violationNode
- The node on which the violation was reportedadditionalInfo
- Accumulator
-
apply
static Map<String,String> apply(ViolationDecorator decorator, Node violationNode)
-
chain
static ViolationDecorator chain(List<? extends ViolationDecorator> list)
Apply several decorators in a chain.
-
noop
static ViolationDecorator noop()
-
-