public final class Parser
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Parser.ParseResult
The diagnostic, parse trees, and
Trees instance for a parse task. |
Constructor and Description |
---|
Parser() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Iterable<? extends javax.tools.JavaFileObject> |
generate(javax.tools.JavaFileObject... sources)
Parses
sources into compilation units. |
static java.lang.Iterable<? extends javax.tools.JavaFileObject> |
generate(java.lang.String className,
java.lang.String code)
Parses
sources into compilation units. |
static boolean |
hasErrorNode(com.sun.source.tree.Tree tree)
Returns
true if the tree contains at least one "erroneous"
node. |
static java.lang.Iterable<? extends javax.lang.model.element.Element> |
parse(javax.tools.JavaFileObject... sources)
Parses
sources into compilation units. |
static java.lang.Iterable<? extends javax.lang.model.element.Element> |
parseLines(java.lang.String className,
java.lang.String... lines)
Parses
sources into compilation units. |
public static boolean hasErrorNode(com.sun.source.tree.Tree tree)
true
if the tree contains at least one "erroneous"
node.public static java.lang.Iterable<? extends javax.lang.model.element.Element> parse(javax.tools.JavaFileObject... sources)
sources
into compilation units. This method
does not compile the sources.public static java.lang.Iterable<? extends javax.lang.model.element.Element> parseLines(java.lang.String className, java.lang.String... lines)
sources
into compilation units. This method
does not compile the sources.public static java.lang.Iterable<? extends javax.tools.JavaFileObject> generate(java.lang.String className, java.lang.String code)
sources
into compilation units. This method
does not compile the sources.public static java.lang.Iterable<? extends javax.tools.JavaFileObject> generate(javax.tools.JavaFileObject... sources)
sources
into compilation units. This method
does not compile the sources.sources
- The sources