Package org.openrewrite.java.marker
Class JavaVersion
java.lang.Object
org.openrewrite.java.marker.JavaVersion
- All Implemented Interfaces:
org.openrewrite.marker.Marker
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe major version of the JDK that compiled the sources, parsed fromcreatedBy(typically thejava.runtime.version).intintMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openrewrite.marker.Marker
getId, print, withId
-
Constructor Details
-
JavaVersion
public JavaVersion()
-
-
Method Details
-
getMajorVersion
public int getMajorVersion() -
getMajorReleaseVersion
public int getMajorReleaseVersion()- Returns:
- The major --release version.
-
getMajorCreatedByVersion
public int getMajorCreatedByVersion()The major version of the JDK that compiled the sources, parsed fromcreatedBy(typically thejava.runtime.version). UnlikegetMajorVersion()andgetMajorReleaseVersion(), which reflect the-source/--releasebytecode level, this reflects the JDK actually performing the compilation. Some features, such as Markdown documentation comments (JEP 467, JDK 23), are recognized based on the compiling JDK regardless of the targeted bytecode level.- Returns:
- The major version of the compiling JDK, or -1 if it cannot be determined.
-