Class AnnotationFileParser
AnnotationFileParser.AnnotationFileAnnotations passed as an argument.
 The first main entry point is parseStubFile(String, InputStream, AnnotatedTypeFactory, ProcessingEnvironment, AnnotationFileAnnotations, AnnotationFileUtil.AnnotationFileType), which
 side-effects its last argument. It operates in two steps. First, it calls the Annotation File
 Parser to parse an annotation file. Then, it walks the AST to create/collect types and
 declaration annotations.
 
The second main entry point is parseAjavaFile(String, InputStream, CompilationUnitTree, AnnotatedTypeFactory, ProcessingEnvironment, AnnotationFileAnnotations).
 This behaves the same as parseStubFile(String, InputStream, AnnotatedTypeFactory, ProcessingEnvironment, AnnotationFileAnnotations, AnnotationFileUtil.AnnotationFileType), but takes an ajava file instead.
 
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classThe result of calling AnnotationFileParser.parse: the annotated types and declaration annotations from the file.static classAn exception indicating a problem while parsing an annotation file.static classInformation about a record component: its type, and whether there was an accessor in the stubs for that component.static classInformation about a record from a stub file.
- 
Method SummaryModifier and TypeMethodDescriptionstatic Map<String,TypeElement> annosInPackage(PackageElement packageElement) All annotations defined in the package (but not those nested within classes in the package).static Map<String,TypeElement> annosInType(TypeElement typeElement) All annotations declared (directly) within a class.static Map<String,TypeElement> createNameToAnnotationMap(List<TypeElement> typeElements) All annotations declared within any of the given elements.static voidparseAjavaFile(String filename, InputStream inputStream, CompilationUnitTree root, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, AnnotationFileParser.AnnotationFileAnnotations ajavaAnnos) The main entry point when parsing an ajava file.static voidparseJdkFileAsStub(String filename, InputStream inputStream, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, AnnotationFileParser.AnnotationFileAnnotations stubAnnos) Parse a stub file that is a part of the annotated JDK and side-effects thestubAnnosargument.static voidparseStubFile(String filename, InputStream inputStream, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, AnnotationFileParser.AnnotationFileAnnotations annotationFileAnnos, AnnotationFileUtil.AnnotationFileType fileType) The main entry point.static <K,V> void Just like Map.putAll, but modifies existing values usingputIfAbsent(Map, Object, Object).static <K,V> void putIfAbsent(Map<K, V> m, K key, V value) Just like Map.put, but does not override any existing value in the map.
- 
Method Details- 
annosInPackageAll annotations defined in the package (but not those nested within classes in the package). Keys are both fully-qualified and simple names.- Parameters:
- packageElement- a package
- Returns:
- a map from annotation name to TypeElement
 
- 
annosInTypeAll annotations declared (directly) within a class. Keys are both fully-qualified and simple names.- Parameters:
- typeElement- a type
- Returns:
- a map from annotation name to TypeElement
 
- 
createNameToAnnotationMapAll annotations declared within any of the given elements.- Parameters:
- typeElements- the elements whose annotations to retrieve
- Returns:
- a map from annotation names (both fully-qualified and simple names) to TypeElement
 
- 
parseStubFilepublic static void parseStubFile(String filename, InputStream inputStream, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, AnnotationFileParser.AnnotationFileAnnotations annotationFileAnnos, AnnotationFileUtil.AnnotationFileType fileType) The main entry point. Parse a stub file and side-effects theannotationFileAnnosargument.- Parameters:
- filename- name of stub file, used only for diagnostic messages
- inputStream- of stub file to parse
- atypeFactory- AnnotatedTypeFactory to use
- processingEnv- ProcessingEnvironment to use
- annotationFileAnnos- annotations from the annotation file; side-effected by this method
- fileType- the annotation file type and source
 
- 
parseAjavaFilepublic static void parseAjavaFile(String filename, InputStream inputStream, CompilationUnitTree root, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, AnnotationFileParser.AnnotationFileAnnotations ajavaAnnos) The main entry point when parsing an ajava file. Parses an ajava file and side-effects the last two arguments.- Parameters:
- filename- name of ajava file, used only for diagnostic messages
- inputStream- of ajava file to parse
- root- javac tree for the file to be parsed
- atypeFactory- AnnotatedTypeFactory to use
- processingEnv- ProcessingEnvironment to use
- ajavaAnnos- annotations from the ajava file; side-effected by this method
 
- 
parseJdkFileAsStubpublic static void parseJdkFileAsStub(String filename, InputStream inputStream, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, AnnotationFileParser.AnnotationFileAnnotations stubAnnos) Parse a stub file that is a part of the annotated JDK and side-effects thestubAnnosargument.- Parameters:
- filename- name of stub file, used only for diagnostic messages
- inputStream- of stub file to parse
- atypeFactory- AnnotatedTypeFactory to use
- processingEnv- ProcessingEnvironment to use
- stubAnnos- annotations from the stub file; side-effected by this method
 
- 
putIfAbsentJust like Map.put, but does not override any existing value in the map.- Type Parameters:
- K- the key type
- V- the value type
- Parameters:
- m- a map
- key- a key
- value- the value to associate with the key, if the key isn't already in the map
 
- 
putAllNewJust like Map.putAll, but modifies existing values usingputIfAbsent(Map, Object, Object).- Type Parameters:
- K- the key type for the maps
- V- the value type for the maps
- Parameters:
- m- the destination map
- m2- the source map
 
 
-