< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java

Print this page




 745                     }
 746                 }
 747 
 748             } catch (ClientCodeException e) {
 749                 throw e;
 750             } catch (Throwable t) {
 751                 throw new AnnotationProcessingError(t);
 752             } finally {
 753                 dcfh.setHandler(prevDeferredHandler);
 754             }
 755         }
 756 
 757         /**
 758          * Checks whether or not a processor's source version is
 759          * compatible with the compilation source version.  The
 760          * processor's source version needs to be greater than or
 761          * equal to the source version of the compile.
 762          */
 763         private void checkSourceVersionCompatibility(Source source, Log log) {
 764             SourceVersion procSourceVersion = processor.getSupportedSourceVersion();
 765 
 766             if (procSourceVersion.compareTo(Source.toSourceVersion(source)) < 0 )  {
 767                 log.warning(Warnings.ProcProcessorIncompatibleSourceVersion(procSourceVersion,
 768                                                                             processor.getClass().getName(),
 769                                                                             source.name));
 770             }
 771         }
 772 
 773         private boolean checkOptionName(String optionName, Log log) {
 774             boolean valid = isValidOptionName(optionName);
 775             if (!valid)
 776                 log.error(Errors.ProcProcessorBadOptionName(optionName,
 777                                                             processor.getClass().getName()));
 778             return valid;
 779         }
 780 
 781         public boolean annotationSupported(String annotationName) {
 782             for(Pattern p: supportedAnnotationPatterns) {
 783                 if (p.matcher(annotationName).matches())
 784                     return true;
 785             }




 745                     }
 746                 }
 747 
 748             } catch (ClientCodeException e) {
 749                 throw e;
 750             } catch (Throwable t) {
 751                 throw new AnnotationProcessingError(t);
 752             } finally {
 753                 dcfh.setHandler(prevDeferredHandler);
 754             }
 755         }
 756 
 757         /**
 758          * Checks whether or not a processor's source version is
 759          * compatible with the compilation source version.  The
 760          * processor's source version needs to be greater than or
 761          * equal to the source version of the compile.
 762          */
 763         private void checkSourceVersionCompatibility(Source source, Log log) {
 764             SourceVersion procSourceVersion = processor.getSupportedSourceVersion();

 765             if (procSourceVersion.compareTo(Source.toSourceVersion(source)) < 0 )  {
 766                 log.warning(Warnings.ProcProcessorIncompatibleSourceVersion(procSourceVersion,
 767                                                                             processor.getClass().getName(),
 768                                                                             source.name));
 769             }
 770         }
 771 
 772         private boolean checkOptionName(String optionName, Log log) {
 773             boolean valid = isValidOptionName(optionName);
 774             if (!valid)
 775                 log.error(Errors.ProcProcessorBadOptionName(optionName,
 776                                                             processor.getClass().getName()));
 777             return valid;
 778         }
 779 
 780         public boolean annotationSupported(String annotationName) {
 781             for(Pattern p: supportedAnnotationPatterns) {
 782                 if (p.matcher(annotationName).matches())
 783                     return true;
 784             }


< prev index next >