public class JavaParser extends Object implements Closeable
| Constructor and Description | 
|---|
| JavaParser()Default constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close() | 
| Iterable<? extends JavaFileObject> | generate(JavaFileObject... sources)Parses  sourcesintocom.sun.source.tree.CompilationUnitTreeunits. | 
| Iterable<? extends JavaFileObject> | generate(String className,
        String code)Parses  sourcesintocom.sun.source.tree.CompilationUnitTreeunits. | 
| protected AggregatingTypeElementVisitorProcessor | getAggregatingTypeElementVisitorProcessor()The type element visitor processor to use. | 
| protected List<Processor> | getAnnotationProcessors()The list of processors to use. | 
| protected BeanDefinitionInjectProcessor | getBeanDefinitionInjectProcessor()The  BeanDefinitionInjectProcessorto use. | 
| JavaCompiler | getCompiler() | 
| JavaFileManager | getFileManager() | 
| Filer | getFiler() | 
| JavacTask | getJavacTask(JavaFileObject... sources)gets the javac task. | 
| Optional<JavacTask> | getLastTask() | 
| ProcessingEnvironment | getProcessingEnv() | 
| protected TypeElementVisitorProcessor | getTypeElementVisitorProcessor()The type element visitor processor to use. | 
| Iterable<? extends Element> | parse(JavaFileObject... sources)Parses  sourcesintocom.sun.source.tree.CompilationUnitTreeunits. | 
| Iterable<? extends Element> | parseLines(String className,
          String... lines)Parses  sourcesinto compilation units. | 
| Reader | readGenerated(String filePath,
             String className,
             String code)Reads the contents of a generated file as a reader. | 
public JavaCompiler getCompiler()
public JavaFileManager getFileManager()
public Filer getFiler()
public ProcessingEnvironment getProcessingEnv()
public Iterable<? extends Element> parseLines(String className, String... lines)
sources into compilation units. This method
 does not compile the sources.className - The class namelines - The lines to parsepublic Iterable<? extends Element> parse(JavaFileObject... sources)
sources into com.sun.source.tree.CompilationUnitTree units. This method
 does not compile the sources.sources - The sourcespublic Optional<JavacTask> getLastTask()
public JavacTask getJavacTask(JavaFileObject... sources)
sources - The sourcespublic Iterable<? extends JavaFileObject> generate(String className, String code)
sources into com.sun.source.tree.CompilationUnitTree units. This method
 does not compile the sources.className - The class namecode - the raw code@Nullable public Reader readGenerated(@NonNull String filePath, String className, String code) throws IOException
filePath - The file pathclassName - The class name that produces the filecode - The code of the classIOException - when an error occurs reading the filepublic Iterable<? extends JavaFileObject> generate(JavaFileObject... sources)
sources into com.sun.source.tree.CompilationUnitTree units. This method
 does not compile the sources.sources - The sources@NonNull protected List<Processor> getAnnotationProcessors()
@NonNull protected BeanDefinitionInjectProcessor getBeanDefinitionInjectProcessor()
BeanDefinitionInjectProcessor to use.BeanDefinitionInjectProcessor@NonNull protected TypeElementVisitorProcessor getTypeElementVisitorProcessor()
@NonNull protected AggregatingTypeElementVisitorProcessor getAggregatingTypeElementVisitorProcessor()
public void close()
close in interface Closeableclose in interface AutoCloseable