Class SourceVersion

java.lang.Object
com.google.errorprone.util.SourceVersion

public final class SourceVersion extends Object
JDK source version utilities.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    supportsInstanceMainMethods(com.sun.tools.javac.util.Context context)
    Returns true if the compiler source version level supports instance main methods.
    static boolean
    supportsPatternMatchingInstanceof(com.sun.tools.javac.util.Context context)
    Returns whether the compiler supports pattern-matching instanceofs.
    static boolean
    supportsPatternMatchingSwitch(com.sun.tools.javac.util.Context context)
    Returns true if the compiler source version level supports pattern-matching switches.
    static boolean
    supportsStaticInnerClass(com.sun.tools.javac.util.Context context)
    Returns true if the compiler source version level supports static inner classes.
    static boolean
    supportsSwitchExpressions(com.sun.tools.javac.util.Context context)
    Returns true if the compiler source version level supports switch expressions.
    static boolean
    supportsTextBlocks(com.sun.tools.javac.util.Context context)
    Returns true if the compiler source version level supports text blocks.
    static boolean
    supportsUnnamedVariablesAndPatterns(com.sun.tools.javac.util.Context context)
    Returns true if the compiler source version level supports unnamed variables and patterns.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • supportsSwitchExpressions

      public static boolean supportsSwitchExpressions(com.sun.tools.javac.util.Context context)
      Returns true if the compiler source version level supports switch expressions.
    • supportsTextBlocks

      public static boolean supportsTextBlocks(com.sun.tools.javac.util.Context context)
      Returns true if the compiler source version level supports text blocks.
    • supportsPatternMatchingInstanceof

      public static boolean supportsPatternMatchingInstanceof(com.sun.tools.javac.util.Context context)
      Returns whether the compiler supports pattern-matching instanceofs.
    • supportsStaticInnerClass

      public static boolean supportsStaticInnerClass(com.sun.tools.javac.util.Context context)
      Returns true if the compiler source version level supports static inner classes.
    • supportsPatternMatchingSwitch

      public static boolean supportsPatternMatchingSwitch(com.sun.tools.javac.util.Context context)
      Returns true if the compiler source version level supports pattern-matching switches.
    • supportsUnnamedVariablesAndPatterns

      public static boolean supportsUnnamedVariablesAndPatterns(com.sun.tools.javac.util.Context context)
      Returns true if the compiler source version level supports unnamed variables and patterns.
    • supportsInstanceMainMethods

      public static boolean supportsInstanceMainMethods(com.sun.tools.javac.util.Context context)
      Returns true if the compiler source version level supports instance main methods.