Utility for parsing Java code.
| Constructor and description |
|---|
JavaParser
()Default constructor. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.Iterable<? extends javax.tools.JavaFileObject> |
generate(java.lang.String className, java.lang.String code)Parses sources into {
|
|
java.lang.Iterable<? extends javax.tools.JavaFileObject> |
generate(javax.tools.JavaFileObject... sources)Parses sources into {
|
|
protected java.util.List<javax.annotation.processing.Processor> |
getAnnotationProcessors()The list of processors to use. |
|
protected io.micronaut.annotation.processing.BeanDefinitionInjectProcessor |
getBeanDefinitionInjectProcessor()The io.micronaut.annotation.processing.BeanDefinitionInjectProcessor to use. |
|
protected io.micronaut.annotation.processing.TypeElementVisitorProcessor |
getTypeElementVisitorProcessor()The type element visitor processor to use. |
|
java.lang.Iterable<? extends javax.lang.model.element.Element> |
parse(javax.tools.JavaFileObject... sources)Parses sources into CompilationUnitTree units. |
|
java.lang.Iterable<? extends javax.lang.model.element.Element> |
parseLines(java.lang.String className, java.lang.String... lines)Parses sources into {
|
|
java.io.Reader |
readGenerated(java.lang.String filePath, java.lang.String className, java.lang.String code)Reads the contents of a generated file as a reader. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Parses sources into {
className - The class namecode - the raw code Parses sources into {
sources - The sourcesThe list of processors to use.
The io.micronaut.annotation.processing.BeanDefinitionInjectProcessor to use.
The type element visitor processor to use.
Parses sources into CompilationUnitTree units. This method
does not compile the sources.
sources - The sources Parses sources into {
className - The class namelines - The lines to parseReads the contents of a generated file as a reader.
filePath - The file pathclassName - The class name that produces the filecode - The code of the class