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.RuleViolationdefines 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 ViolationDecoratorchain(List<? extends ViolationDecorator> list)Apply several decorators in a chain.voiddecorate(Node violationNode, Map<String,String> additionalInfo)Compute additional key/value pairs about the violation that should be reflected inRuleViolation.getAdditionalInfo().static ViolationDecoratornoop()
-
-
-
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 theadditionalInfoparameter.- 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()
-
-