Uses of Class
com.github.javaparser.ast.CompilationUnit
Packages that use CompilationUnit
Package
Description
-
Uses of CompilationUnit in com.github.javaparser
Fields in com.github.javaparser with type parameters of type CompilationUnitMethods in com.github.javaparser that return CompilationUnitModifier and TypeMethodDescriptionstatic CompilationUnit
static CompilationUnit
Deprecated.static CompilationUnit
StaticJavaParser.parse(InputStream in)
static CompilationUnit
StaticJavaParser.parse(InputStream in, Charset encoding)
Deprecated.set the encoding in theParserConfiguration
static CompilationUnit
Parses Java code from a Reader and returns aCompilationUnit
that represents it.static CompilationUnit
Parses the Java code contained in code and returns aCompilationUnit
that represents it.static CompilationUnit
Parses the Java code contained in a file and returns aCompilationUnit
that represents it.static CompilationUnit
Deprecated.set the encoding in theParserConfiguration
static CompilationUnit
StaticJavaParser.parseResource(ClassLoader classLoader, String path, Charset encoding)
Deprecated.set the encoding in theParserConfiguration
static CompilationUnit
StaticJavaParser.parseResource(String path)
Parses the Java code contained in a resource and returns aCompilationUnit
that represents it.static CompilationUnit
StaticJavaParser.parseResource(String path, Charset encoding)
Deprecated.set the encoding in theParserConfiguration
Methods in com.github.javaparser that return types with arguments of type CompilationUnitModifier and TypeMethodDescriptionDeprecated.set the encoding in theParserConfiguration
JavaParser.parse(InputStream in)
JavaParser.parse(InputStream in, Charset encoding)
Parses the Java code contained in theInputStream
and returns aCompilationUnit
that represents it.Parses Java code from a Reader and returns aCompilationUnit
that represents it.Parses the Java code contained in code and returns aCompilationUnit
that represents it.Parses the Java code contained in a file and returns aCompilationUnit
that represents it.Deprecated.set the encoding in theParserConfiguration
JavaParser.parseResource(ClassLoader classLoader, String path, Charset encoding)
Deprecated.set the encoding in theParserConfiguration
JavaParser.parseResource(String path)
Parses the Java code contained in a resource and returns aCompilationUnit
that represents it.JavaParser.parseResource(String path, Charset encoding)
Deprecated.set the encoding in theParserConfiguration
-
Uses of CompilationUnit in com.github.javaparser.ast
Methods in com.github.javaparser.ast that return CompilationUnitModifier and TypeMethodDescriptionCompilationUnit.addImport(ImportDeclaration importDeclaration)
adds an import if not implicitly imported by java (i.e.Add an import to the list ofImportDeclaration
of this compilation unit
shorthand foraddImport(String)
with clazz.getName()Add an import to the list ofImportDeclaration
of this compilation unit
shorthand foraddImport(String, boolean, boolean)
with name,false,falseAdd an import to the list ofImportDeclaration
of this compilation unit
This method check if no import with the same name is already in the listCompilationUnit.addType(TypeDeclaration<?> type)
CompilationUnit.clone()
CompilationUnit.Storage.getCompilationUnit()
Declare a specific printerCompilationUnit.removeModule()
CompilationUnit.removePackageDeclaration()
CompilationUnit.setImport(int i, ImportDeclaration imports)
CompilationUnit.setImports(NodeList<ImportDeclaration> imports)
Sets the list of imports of this compilation unit.CompilationUnit.setModule(ModuleDeclaration module)
CompilationUnit.setPackageDeclaration(PackageDeclaration packageDeclaration)
Sets or clear the package declarations of this compilation unit.CompilationUnit.setPackageDeclaration(String name)
sets the package declaration of this compilation unitCompilationUnit.setStorage(Path path)
CompilationUnit.setStorage(Path path, Charset charset)
CompilationUnit.setType(int i, TypeDeclaration<?> type)
CompilationUnit.setTypes(NodeList<TypeDeclaration<?>> types)
Sets the list of types declared in this compilation unit.Methods in com.github.javaparser.ast that return types with arguments of type CompilationUnitModifier and TypeMethodDescriptionNode.findCompilationUnit()
CompilationUnit.Storage.reparse(JavaParser javaParser)
Method parameters in com.github.javaparser.ast with type arguments of type CompilationUnitModifier and TypeMethodDescriptionvoid
CompilationUnit.Storage.save(Function<CompilationUnit,String> makeOutput)
Saves a compilation unit to its original location with formatting according to the function passed as a parameter.void
CompilationUnit.Storage.save(Function<CompilationUnit,String> makeOutput, Charset encoding)
Saves a compilation unit to its original location with formatting and encoding according to the function and encoding passed as a parameter. -
Uses of CompilationUnit in com.github.javaparser.ast.visitor
Methods in com.github.javaparser.ast.visitor with parameters of type CompilationUnitModifier and TypeMethodDescriptionCloneVisitor.visit(CompilationUnit n, Object arg)
EqualsVisitor.visit(CompilationUnit n, Visitable arg)
GenericListVisitorAdapter.visit(CompilationUnit n, A arg)
GenericVisitor.visit(CompilationUnit n, A arg)
GenericVisitorAdapter.visit(CompilationUnit n, A arg)
GenericVisitorWithDefaults.visit(CompilationUnit n, A arg)
HashCodeVisitor.visit(CompilationUnit n, Void arg)
ModifierVisitor.visit(CompilationUnit n, A arg)
NoCommentEqualsVisitor.visit(CompilationUnit n, Visitable arg)
NoCommentHashCodeVisitor.visit(CompilationUnit n, Void arg)
ObjectIdentityEqualsVisitor.visit(CompilationUnit n, Visitable arg)
ObjectIdentityHashCodeVisitor.visit(CompilationUnit n, Void arg)
void
VoidVisitor.visit(CompilationUnit n, A arg)
void
VoidVisitorAdapter.visit(CompilationUnit n, A arg)
void
VoidVisitorWithDefaults.visit(CompilationUnit n, A arg)
-
Uses of CompilationUnit in com.github.javaparser.printer
Methods in com.github.javaparser.printer with parameters of type CompilationUnitModifier and TypeMethodDescriptionvoid
DefaultPrettyPrinterVisitor.visit(CompilationUnit n, Void arg)
void
PrettyPrintVisitor.visit(CompilationUnit n, Void arg)
Deprecated. -
Uses of CompilationUnit in com.github.javaparser.utils
Methods in com.github.javaparser.utils that return CompilationUnitModifier and TypeMethodDescriptionParses a .java files under the source root and returns its CompilationUnit.Methods in com.github.javaparser.utils that return types with arguments of type CompilationUnitModifier and TypeMethodDescriptionSourceRoot.getCache()
The Java files that have been parsed by this source root object, or have been added manually.SourceRoot.getCompilationUnits()
The CompilationUnits of the Java files that have been parsed succesfully by this source root object, or have been added manually.SourceRoot.getPrinter()
Get the printing function.SourceZip.parse()
Tries to parse all '.java' files in the ZIP located at this SourceZip's path and returns the parse results in a list.SourceRoot.tryToParse()
Tries to parse all .java files under the source root recursively, and returns all files ever parsed with this source root.SourceRoot.tryToParse(String startPackage)
Tries to parse all .java files in a package recursively, and returns all files ever parsed with this source root.SourceRoot.tryToParse(String startPackage, String filename)
Tries to parse a .java files under the source root and returns the ParseResult.SourceRoot.tryToParse(String startPackage, String filename, ParserConfiguration configuration)
Tries to parse a .java files under the source root and returns the ParseResult.SourceRoot.tryToParseParallelized()
Tries to parse all .java files under the source root recursively using multiple threads, and returns all files ever parsed with this source root.SourceRoot.tryToParseParallelized(String startPackage)
Tries to parse all .java files in a package recursively using multiple threads, and returns all files ever parsed with this source root.Methods in com.github.javaparser.utils with parameters of type CompilationUnitModifier and TypeMethodDescriptionSourceRoot.add(CompilationUnit compilationUnit)
Add a newly created Java file to the cache of this source root.SourceRoot.add(String startPackage, String filename, CompilationUnit compilationUnit)
Add a newly created Java file to the cache of this source root.Method parameters in com.github.javaparser.utils with type arguments of type CompilationUnitModifier and TypeMethodDescriptionSourceRoot.Callback.process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result)
void
SourceZip.Callback.process(Path relativeZipEntryPath, ParseResult<CompilationUnit> result)
Process the given parse result.SourceRoot.setPrinter(Function<CompilationUnit,String> printer)
Set the printing function that transforms compilation units into a string to save.
ParserConfiguration