Package Summary  Overview Summary

class:SourceVersion [NONE]

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


    public enum SourceVersion
    extends java.lang.Enum<SourceVersion>
    Source versions of the Java™ programming language. See the appropriate edition of The Java™ Language Specification for information about a particular source version.

    Note that additional source version constants will be added to model future releases of the language.

    Since:
    1.6

field:RELEASE_0 [NONE]

  • RELEASE_0

    public static final SourceVersion RELEASE_0
    The original version. The language described in The Java™ Language Specification, First Edition .

field:RELEASE_1 [NONE]

  • RELEASE_1

    public static final SourceVersion RELEASE_1
    The version recognized by the Java Platform 1.1. The language is RELEASE_0 augmented with nested classes as described in the 1.1 update to The Java™ Language Specification, First Edition .

field:RELEASE_2 [NONE]

  • RELEASE_2

    public static final SourceVersion RELEASE_2
    The version recognized by the Java 2 Platform, Standard Edition, v 1.2. The language described in The Java™ Language Specification, Second Edition , which includes the strictfp modifier.

field:RELEASE_3 [NONE]

  • RELEASE_3

    public static final SourceVersion RELEASE_3
    The version recognized by the Java 2 Platform, Standard Edition, v 1.3. No major changes from RELEASE_2.

field:RELEASE_4 [NONE]

  • RELEASE_4

    public static final SourceVersion RELEASE_4
    The version recognized by the Java 2 Platform, Standard Edition, v 1.4. Added a simple assertion facility.

field:RELEASE_5 [NONE]

  • RELEASE_5

    public static final SourceVersion RELEASE_5
    The version recognized by the Java 2 Platform, Standard Edition 5.0. The language described in The Java™ Language Specification, Third Edition . First release to support generics, annotations, autoboxing, var-args, enhanced for loop, and hexadecimal floating-point literals.

field:RELEASE_6 [NONE]

  • RELEASE_6

    public static final SourceVersion RELEASE_6
    The version recognized by the Java Platform, Standard Edition 6. No major changes from RELEASE_5.

field:RELEASE_7 [CHANGED]

  • RELEASE_7

    public static final SourceVersion RELEASE_7
    The version recognized by the Java Platform, Standard Edition 7. Additions in this release include, diamond syntax for constructors, try-with-resources, strings in switch, binary literals, and multi-catch.
    Since:
    1.7
  • RELEASE_7

    public static final SourceVersion RELEASE_7
    The version recognized by the Java Platform, Standard Edition 7.
    Since:
    1.7
  • RELEASE_7

    public static final SourceVersion RELEASE_7
    The version recognized by the Java Platform, Standard Edition 7. Additions in this release include, diamond syntax for constructors, try-with-resources, strings in switch, binary literals, and multi-catch.
    Since:
    1.7

method:values-- [NONE]

  • values

    public static SourceVersion[] 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 (SourceVersion c : SourceVersion.values())
        System.out.println(c);
    
    Returns:
    an array containing the constants of this enum type, in the order they are declared

method:valueOf-java.lang.String- [NONE]

  • valueOf

    public static SourceVersion 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

method:latest-- [NONE]

  • latest

    public static SourceVersion latest()
    Returns the latest source version that can be modeled.
    Returns:
    the latest source version that can be modeled

method:latestSupported-- [NONE]

  • latestSupported

    public static SourceVersion latestSupported()
    Returns the latest source version fully supported by the current execution environment. RELEASE_5 or later must be returned.
    Returns:
    the latest source version that is fully supported

method:isIdentifier-java.lang.CharSequence- [NONE]

  • isIdentifier

    public static boolean isIdentifier(java.lang.CharSequence name)
    Returns whether or not name is a syntactically valid identifier (simple name) or keyword in the latest source version. The method returns true if the name consists of an initial character for which Character.isJavaIdentifierStart(int) returns true, followed only by characters for which Character.isJavaIdentifierPart(int) returns true. This pattern matches regular identifiers, keywords, and the literals "true", "false", and "null". The method returns false for all other strings.
    Parameters:
    name - the string to check
    Returns:
    true if this string is a syntactically valid identifier or keyword, false otherwise.

method:isName-java.lang.CharSequence- [NONE]

  • isName

    public static boolean isName(java.lang.CharSequence name)
    Returns whether or not name is a syntactically valid qualified name in the latest source version. Unlike isIdentifier, this method returns false for keywords and literals.
    Parameters:
    name - the string to check
    Returns:
    true if this string is a syntactically valid name, false otherwise.
    See The Java™ Language Specification :
    6.2 Names and Identifiers

method:isKeyword-java.lang.CharSequence- [NONE]

  • isKeyword

    public static boolean isKeyword(java.lang.CharSequence s)
    Returns whether or not s is a keyword or literal in the latest source version.
    Parameters:
    s - the string to check
    Returns:
    true if s is a keyword or literal, false otherwise.

field:RELEASE_8 [ADDED]

  • RELEASE_8

    public static final SourceVersion RELEASE_8
    
    The version recognized by the Java Platform, Standard Edition 8. Additions in this release include lambda expressions and default methods.
    Since:
    1.8