javax.lang.model.SourceVersion should have a static method that returns the SourceVersion for a version string as accepted by javac -source option.