Package javax.lang.model

Examples of javax.lang.model.SourceVersion


@SupportedOptions("ExpectedVersion")
public class TestSourceVersion extends JavacTestingAbstractProcessor {

    public boolean process(Set<? extends TypeElement> annotations,
                           RoundEnvironment roundEnvironment) {
        SourceVersion expectedVersion =
            SourceVersion.valueOf(processingEnv.getOptions().get("ExpectedVersion"));
        SourceVersion actualVersion =  processingEnv.getSourceVersion();
        System.out.println("Expected SourceVersion " + expectedVersion +
                           " actual SourceVersion "  + actualVersion);
        if (expectedVersion != actualVersion)
            throw new RuntimeException();
View Full Code Here


@SupportedOptions("ExpectedVersion")
public class TestSourceVersion extends JavacTestingAbstractProcessor {

    public boolean process(Set<? extends TypeElement> annotations,
                           RoundEnvironment roundEnvironment) {
        SourceVersion expectedVersion =
            SourceVersion.valueOf(processingEnv.getOptions().get("ExpectedVersion"));
        SourceVersion actualVersion =  processingEnv.getSourceVersion();
        System.out.println("Expected SourceVersion " + expectedVersion +
                           " actual SourceVersion "  + actualVersion);
        if (expectedVersion != actualVersion)
            throw new RuntimeException();
View Full Code Here

         * compatible with the compilation source version.  The
         * processor's source version needs to be greater than or
         * equal to the source version of the compile.
         */
        private void checkSourceVersionCompatibility(Source source, Log log) {
            SourceVersion procSourceVersion = processor.getSupportedSourceVersion();

            if (procSourceVersion.compareTo(Source.toSourceVersion(source)) < 0 )  {
                log.warning("proc.processor.incompatible.source.version",
                            procSourceVersion,
                            processor.getClass().getName(),
                            source.name);
            }
View Full Code Here

     *
     * @return the latest source version supported by this processor
     */
    public SourceVersion getSupportedSourceVersion() {
  SupportedSourceVersion ssv = this.getClass().getAnnotation(SupportedSourceVersion.class);
  SourceVersion sv = null;
  if (ssv == null) {
      sv = SourceVersion.RELEASE_6;
      if (isInitialized())
    processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING,
               "No SupportedSourceVersion annotation " +
View Full Code Here

     *
     * @return the latest source version supported by this processor
     */
    public SourceVersion getSupportedSourceVersion() {
  SupportedSourceVersion ssv = this.getClass().getAnnotation(SupportedSourceVersion.class);
  SourceVersion sv = null;
  if (ssv == null) {
      sv = SourceVersion.RELEASE_6;
      if (isInitialized())
    processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING,
               "No SupportedSourceVersion annotation " +
View Full Code Here

         * compatible with the compilation source version.  The
         * processor's source version needs to be greater than or
         * equal to the source version of the compile.
         */
        private void checkSourceVersionCompatibility(Source source, Log log) {
            SourceVersion procSourceVersion = processor.getSupportedSourceVersion();

            if (procSourceVersion.compareTo(Source.toSourceVersion(source)) < 0 )  {
                log.warning("proc.processor.incompatible.source.version",
                            procSourceVersion,
                            processor.getClass().getName(),
                            source.name);
            }
View Full Code Here

TOP

Related Classes of javax.lang.model.SourceVersion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.