Enum Class JavaFeature

java.lang.Object
java.lang.Enum<JavaFeature>
org.aspectj.org.eclipse.jdt.internal.compiler.impl.JavaFeature
All Implemented Interfaces:
Serializable, Comparable<JavaFeature>, java.lang.constant.Constable

public enum JavaFeature extends Enum<JavaFeature>
An internal enumeration of all Java language features that were introduced as standard feature or preview feature from Java 15. The idea is to have one location where the applicability of a feature, such as version supported in, whether or not a preview, what are the restricted keywords introduced by a feature etc. This is expected to be updated every time there's a new Java version and the change is expected to be one of the following kinds:
  • The preview feature continues to be a preview in the next version
  • The preview feature is upgraded to a standard feature
  • The preview feature is removed
Author:
jay
  • Enum Constant Details

    • SWITCH_EXPRESSIONS

      public static final JavaFeature SWITCH_EXPRESSIONS
    • TEXT_BLOCKS

      public static final JavaFeature TEXT_BLOCKS
    • PATTERN_MATCHING_IN_INSTANCEOF

      public static final JavaFeature PATTERN_MATCHING_IN_INSTANCEOF
    • RECORDS

      public static final JavaFeature RECORDS
    • SEALED_CLASSES

      public static final JavaFeature SEALED_CLASSES
    • PATTERN_MATCHING_IN_SWITCH

      public static final JavaFeature PATTERN_MATCHING_IN_SWITCH
  • Method Details

    • values

      public static JavaFeature[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JavaFeature valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isPreview

      public boolean isPreview()
    • getName

      public String getName()
    • getCompliance

      public long getCompliance()
    • getRestrictedKeywords

      public char[][] getRestrictedKeywords()
    • isSupported

      public boolean isSupported(CompilerOptions options)
    • isSupported

      public boolean isSupported(long comp, boolean preview)