Package | Description |
---|---|
com.github.javaparser | |
com.github.javaparser.ast | |
com.github.javaparser.ast.visitor | |
com.github.javaparser.printer | |
com.github.javaparser.utils |
Modifier and Type | Field and Description |
---|---|
static ParseStart<CompilationUnit> |
ParseStart.COMPILATION_UNIT |
Modifier and Type | Method and Description |
---|---|
static CompilationUnit |
JavaParser.parse(File file)
Parses the Java code contained in a
File and returns a
CompilationUnit that represents it.Note: Uses UTF-8 encoding |
static CompilationUnit |
JavaParser.parse(File file,
Charset encoding)
Parses the Java code contained in a
File and returns a
CompilationUnit that represents it. |
static CompilationUnit |
JavaParser.parse(InputStream in)
Parses the Java code contained in the
InputStream and returns a
CompilationUnit that represents it.Note: Uses UTF-8 encoding |
static CompilationUnit |
JavaParser.parse(InputStream in,
Charset encoding)
Parses the Java code contained in the
InputStream and returns a
CompilationUnit that represents it. |
static CompilationUnit |
JavaParser.parse(Path path)
Parses the Java code contained in a file and returns a
CompilationUnit that represents it.Note: Uses UTF-8 encoding |
static CompilationUnit |
JavaParser.parse(Path path,
Charset encoding)
Parses the Java code contained in a file and returns a
CompilationUnit that represents it. |
static CompilationUnit |
JavaParser.parse(Reader reader)
Parses Java code from a Reader and returns a
CompilationUnit that represents it. |
static CompilationUnit |
JavaParser.parse(String code)
Parses the Java code contained in code and returns a
CompilationUnit that represents it. |
static CompilationUnit |
JavaParser.parseResource(ClassLoader classLoader,
String path,
Charset encoding)
Parses the Java code contained in a resource and returns a
CompilationUnit that represents it. |
static CompilationUnit |
JavaParser.parseResource(String path)
Parses the Java code contained in a resource and returns a
CompilationUnit that represents it.Note: Uses UTF-8 encoding |
static CompilationUnit |
JavaParser.parseResource(String path,
Charset encoding)
Parses the Java code contained in a resource and returns a
CompilationUnit that represents it. |
Modifier and Type | Method and Description |
---|---|
CompilationUnit |
CompilationUnit.addImport(Class<?> clazz)
Add an import to the list of
ImportDeclaration of this compilation unitshorthand for addImport(String) with clazz.getName() |
CompilationUnit |
CompilationUnit.addImport(ImportDeclaration imports) |
CompilationUnit |
CompilationUnit.addImport(String name)
Add an import to the list of
ImportDeclaration of this compilation unitshorthand for addImport(String, boolean, boolean) with name,false,false |
CompilationUnit |
CompilationUnit.addImport(String name,
boolean isStatic,
boolean isAsterisk)
Add an import to the list of
ImportDeclaration of this compilation unitThis method check if no import with the same name is already in the list |
CompilationUnit |
CompilationUnit.addType(TypeDeclaration<?> type) |
CompilationUnit |
CompilationUnit.clone() |
CompilationUnit |
CompilationUnit.removeModule() |
CompilationUnit |
CompilationUnit.removePackageDeclaration() |
CompilationUnit |
CompilationUnit.setImport(int i,
ImportDeclaration imports) |
CompilationUnit |
CompilationUnit.setImports(NodeList<ImportDeclaration> imports)
Sets the list of imports of this compilation unit.
|
CompilationUnit |
CompilationUnit.setModule(ModuleDeclaration module) |
CompilationUnit |
CompilationUnit.setPackageDeclaration(PackageDeclaration packageDeclaration)
Sets or clear the package declarations of this compilation unit.
|
CompilationUnit |
CompilationUnit.setPackageDeclaration(String name)
sets the package declaration of this compilation unit
|
CompilationUnit |
CompilationUnit.setType(int i,
TypeDeclaration<?> type) |
CompilationUnit |
CompilationUnit.setTypes(NodeList<TypeDeclaration<?>> types)
Sets the list of types declared in this compilation unit.
|
Modifier and Type | Method and Description |
---|---|
R |
GenericVisitor.visit(CompilationUnit n,
A arg) |
Visitable |
ModifierVisitor.visit(CompilationUnit n,
A arg) |
void |
VoidVisitor.visit(CompilationUnit n,
A arg) |
void |
VoidVisitorAdapter.visit(CompilationUnit n,
A arg) |
R |
GenericVisitorAdapter.visit(CompilationUnit n,
A arg) |
List<R> |
GenericListVisitorAdapter.visit(CompilationUnit n,
A arg) |
Visitable |
CloneVisitor.visit(CompilationUnit n,
Object arg) |
Boolean |
EqualsVisitor.visit(CompilationUnit n,
Visitable arg) |
Integer |
HashCodeVisitor.visit(CompilationUnit n,
Void arg) |
Modifier and Type | Method and Description |
---|---|
void |
PrettyPrintVisitor.visit(CompilationUnit n,
Void arg) |
Modifier and Type | Method and Description |
---|---|
CompilationUnit |
SourceRoot.parse(String packag,
String filename)
Try to parse a single Java file and return it.
|
Modifier and Type | Method and Description |
---|---|
List<CompilationUnit> |
SourceRoot.getCompilationUnits()
The CompilationUnits of the Java files that have been parsed succesfully by this source root object,
or have been added manually.
|
Map<Path,ParseResult<CompilationUnit>> |
SourceRoot.getContent()
The Java files that have been parsed by this source root object,
or have been added manually.
|
Map<Path,ParseResult<CompilationUnit>> |
SourceRoot.tryToParse()
Parse every .java file in this source root.
|
Map<Path,ParseResult<CompilationUnit>> |
SourceRoot.tryToParse(String startPackage)
Parses all .java files in a package recursively, caches them, and returns all files ever parsed with this source
root.
|
ParseResult<CompilationUnit> |
SourceRoot.tryToParse(String packag,
String filename)
Try to parse a single Java file and return the result of parsing.
|
Modifier and Type | Method and Description |
---|---|
void |
SourceRoot.add(String pkg,
String filename,
CompilationUnit compilationUnit)
Add a newly created Java file to this source root.
|
Modifier and Type | Method and Description |
---|---|
SourceRoot.Callback.Result |
SourceRoot.Callback.process(Path localPath,
Path absolutePath,
ParseResult<CompilationUnit> result) |
Copyright © 2007–2017. All rights reserved.