• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pmd / pmd / 4553

25 Apr 2025 06:55AM UTC coverage: 77.84% (+0.008%) from 77.832%
4553

push

github

adangel
[core] Support language dialects (#5438)

Merge pull request #5438 from Monits:lang-dialects

17661 of 23654 branches covered (74.66%)

Branch coverage included in aggregate %.

113 of 137 new or added lines in 12 files covered. (82.48%)

20 existing lines in 5 files now uncovered.

38710 of 48765 relevant lines covered (79.38%)

0.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java
1
/**
2
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3
 */
4

5
package net.sourceforge.pmd.lang;
6

7
import java.util.Collections;
8
import java.util.List;
9

10
import net.sourceforge.pmd.lang.ast.Parser;
11
import net.sourceforge.pmd.lang.metrics.LanguageMetricsProvider;
12
import net.sourceforge.pmd.lang.rule.xpath.impl.XPathHandler;
13
import net.sourceforge.pmd.reporting.ViolationDecorator;
14
import net.sourceforge.pmd.reporting.ViolationSuppressor;
15
import net.sourceforge.pmd.util.designerbindings.DesignerBindings;
16
import net.sourceforge.pmd.util.designerbindings.DesignerBindings.DefaultDesignerBindings;
17

18

19
/**
20
 * Interface for obtaining the classes necessary for checking source files of a
21
 * specific language.
22
 *
23
 * @author pieter_van_raemdonck - Application Engineers NV/SA - www.ae.be
24
 */
25
public interface LanguageVersionHandler {
26

27

28
    /**
29
     * Get the XPathHandler.
30
     */
31
    default XPathHandler getXPathHandler() {
UNCOV
32
        return XPathHandler.noFunctionDefinitions();
×
33
    }
34

35

36
    /**
37
     * Returns the parser instance.
38
     */
39
    Parser getParser();
40

41
    /**
42
     * Returns the language-specific violation decorator.
43
     */
44
    default ViolationDecorator getViolationDecorator() {
45
        return ViolationDecorator.noop();
×
46
    }
47

48
    /**
49
     * Returns additional language-specific violation suppressors.
50
     * These take precedence over the default suppressors (eg nopmd comment),
51
     * but do not replace them.
52
     */
53
    default List<ViolationSuppressor> getExtraViolationSuppressors() {
54
        return Collections.emptyList();
1✔
55
    }
56

57

58
    /**
59
     * Returns the metrics provider for this language version,
60
     * or null if it has none.
61
     */
62
    default LanguageMetricsProvider getLanguageMetricsProvider() {
63
        return null;
×
64
    }
65

66

67
    /**
68
     * Returns the designer bindings for this language version.
69
     * Null is not an acceptable result, use {@link DefaultDesignerBindings#getInstance()}
70
     * instead.
71
     *
72
     * @since 6.20.0
73
     */
74
    default DesignerBindings getDesignerBindings() {
75
        return DefaultDesignerBindings.getInstance();
×
76
    }
77

78
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc