Interface JavaVersionAwareVisitor

  • All Known Implementing Classes:
    MapComputeIfAbsentOrPresentCheck

    @Beta
    public interface JavaVersionAwareVisitor
    Implementing this interface allows a check to be executed - or not - during analysis, depending of expected java version.
    In order to be taken into account during analysis, the property sonar.java.source must be set.
    • Method Detail

      • isCompatibleWithJavaVersion

        boolean isCompatibleWithJavaVersion​(JavaVersion version)
        Control if the check is compatible with the java version of the project being analyzed. The version used as parameter depends of the property sonar.java.source (6 or 1.6 for java 1.6, 7 or 1.7, etc.).
        Parameters:
        version - The java version of the sources
        Returns:
        true if the check is compatible with detected java version and should be executed on sources, false otherwise.