Enum SourceLevel

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SourceLevel>, Feature<SourceLevel>

    public enum SourceLevel
    extends java.lang.Enum<SourceLevel>
    implements Feature<SourceLevel>
    Compliance levels which are idiomatically supported by this processor.

    SourceVersion is problematic to use, as the constants themselves will be missing on compilers that do not support them (e.g. "RELEASE_8" is not available on javac v6 or v7). Additionally, sourceLevel.javaUtilObjects().isPresent() is far more readable than sourceVersion.compareTo(SourceLevel.RELEASE_7) >= 0.

    • Enum Constant Detail

    • Constructor Detail

      • SourceLevel

        private SourceLevel​(java.lang.String humanReadableFormat,
                            int version)
    • Method Detail

      • values

        public static SourceLevel[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SourceLevel c : SourceLevel.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SourceLevel valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • javacArguments

        public java.util.List<java.lang.String> javacArguments()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<SourceLevel>