public class StubParser extends Object
parse(String, InputStream, AnnotatedTypeFactory,
ProcessingEnvironment, Map, Map)
, which side-effects its last two arguments.
The constructor acts in two parts. First, it calls the Stub Parser to parse a stub file. Then, itis walks the Stub Parser's AST to create/collect types and declaration annotations.
Constructor and Description |
---|
StubParser(String filename,
AnnotatedTypeFactory atypeFactory,
ProcessingEnvironment processingEnv,
Map<Element,AnnotatedTypeMirror> atypes,
Map<String,Set<AnnotationMirror>> declAnnos,
boolean isJdkAsStub)
Create a new StubParser object, which will parse and extract annotations from the given stub
file.
|
Modifier and Type | Method and Description |
---|---|
static void |
parse(String filename,
InputStream inputStream,
AnnotatedTypeFactory atypeFactory,
ProcessingEnvironment processingEnv,
Map<Element,AnnotatedTypeMirror> atypes,
Map<String,Set<AnnotationMirror>> declAnnos)
The main entry point.
|
static void |
parseJdkFileAsStub(String filename,
InputStream inputStream,
AnnotatedTypeFactory atypeFactory,
ProcessingEnvironment processingEnv,
Map<Element,AnnotatedTypeMirror> atypes,
Map<String,Set<AnnotationMirror>> declAnnos)
Parse a stub file that is a part of the annotated jdk and side-effects the last two
arguments.
|
public StubParser(String filename, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, Map<Element,AnnotatedTypeMirror> atypes, Map<String,Set<AnnotationMirror>> declAnnos, boolean isJdkAsStub)
filename
- name of stub file, used only for diagnostic messagesatypeFactory
- AnnotatedtypeFactory to useprocessingEnv
- ProcessingEnviroment to useisJdkAsStub
- whether or not the stub file is a part of the JDKpublic static void parse(String filename, InputStream inputStream, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, Map<Element,AnnotatedTypeMirror> atypes, Map<String,Set<AnnotationMirror>> declAnnos)
filename
- name of stub file, used only for diagnostic messagesinputStream
- of stub file to parseatypeFactory
- AnnotatedtypeFactory to useprocessingEnv
- ProcessingEnviroment to useatypes
- annotated types from this stub file is added to this mapdeclAnnos
- declaration annotations from this stub file are added to this mappublic static void parseJdkFileAsStub(String filename, InputStream inputStream, AnnotatedTypeFactory atypeFactory, ProcessingEnvironment processingEnv, Map<Element,AnnotatedTypeMirror> atypes, Map<String,Set<AnnotationMirror>> declAnnos)
filename
- name of stub file, used only for diagnostic messagesinputStream
- of stub file to parseatypeFactory
- AnnotatedtypeFactory to useprocessingEnv
- ProcessingEnviroment to useatypes
- annotated types from this stub file is added to this mapdeclAnnos
- declaration annotations from this stub file are added to this map