Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Java™ Platform Standard Ed. 6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD

## javax.lang.model
Enum SourceVersion

    java.lang.Object
      java.lang.Enum<SourceVersion>
          javax.lang.model.SourceVersion

All Implemented Interfaces:
  Serializable, Comparable<SourceVersion>

    public enum SourceVersion

extends Enum<SourceVersion>

Source versions of the Java™ programming language. See http://java.sun.com/docs/books/jls/ for information on editions of The Java™ Language Specification, including updates and clarifications.

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

Since:
  1.6

Enum Constant Summary
`RELEASE_0` The original version.
`RELEASE_1` The version recognized by the Java Platform 1.1.
`RELEASE_2` The version recognized by the Java 2 Platform, Standard Edition, v 1.2.
`RELEASE_3` The version recognized by the Java 2 Platform, Standard Edition, v 1.3.
`RELEASE_4` The version recognized by the Java 2 Platform, Standard Edition, v 1.4.
`RELEASE_5` The version recognized by the Java 2 Platform, Standard Edition 5.0.
`RELEASE_6` The version recognized by the Java Platform, Standard Edition 6.

Method Summary
`static boolean` | `isIdentifier(CharSequence name)` Returns whether or not `name` is a syntactically valid identifier (simple name) or keyword in the latest source version.
`static boolean` | `isKeyword(CharSequence s)` Returns whether or not `s` is a keyword or literal in the latest source version.
`static boolean` | `isName(CharSequence name)` Returns whether or not `name` is a syntactically valid qualified name in the latest source version.
`static SourceVersion` | `latest()` Returns the latest source version that can be modeled.
`static SourceVersion` | `latestSupported()` Returns the latest source version fully supported by the current execution environment.
`static SourceVersion` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static SourceVersion[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum
`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Enum Constant Detail

### RELEASE_0

    public static final SourceVersion RELEASE_0

  The original version. The language described in the first edition of The Java™ Language Specification.

### 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.

### 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.

### 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`.

### 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.

### 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.

### RELEASE_6

    public static final SourceVersion RELEASE_6

  The version recognized by the Java Platform, Standard Edition 6. No major changes from `RELEASE_5`.

Method Detail

### 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

### valueOf

    public static SourceVersion valueOf(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:
    `IllegalArgumentException` - if this enum type has no constant with the specified name
    `NullPointerException` - if the argument is null

### latest

    public static SourceVersion latest()

  Returns the latest source version that can be modeled.

  Returns:
    the latest source version that can be modeled

### 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

### isIdentifier

    public static boolean isIdentifier(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.

### isName

    public static boolean isName(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.

### isKeyword

    public static boolean isKeyword(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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Java™ Platform Standard Ed. 6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD

Submit a bug or feature
For further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 1993, 2010, Oracle and/or its affiliates. All rights reserved.