Package com.github.javaparser.utils
Class SourceZip
java.lang.Object
com.github.javaparser.utils.SourceZip
A collection of Java source files and its sub-directories located in a ZIP or JAR file on the file system.
Files can be parsed with a callback.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
An interface to define a callback for each file that's parsed. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new ZIP parser.SourceZip(Path zipPath, ParserConfiguration configuration)
Create a new ZIP parser. -
Method Summary
Modifier and TypeMethodDescriptionGet the path of the ZIP file to be parsed.parse()
Tries to parse all '.java' files in the ZIP located at this SourceZip's path and returns the parse results in a list.parse(SourceZip.Callback callback)
Tries to parse all '.java' files in the ZIP located at this SourceZip's path and returns the parse results in a list.setParserConfiguration(ParserConfiguration parserConfiguration)
-
Constructor Details
-
SourceZip
Create a new ZIP parser. An instance ofJavaParser
with the defaultParserConfiguration
will be used to parse the ZIP.- Parameters:
zipPath
- The absolute path of ZIP file to parse.
-
SourceZip
Create a new ZIP parser. An instance ofJavaParser
with the given configuration will be used to parse the ZIP.- Parameters:
zipPath
- The absolute path of ZIP file to parse.configuration
- The configuration to initiate the default parser with.
-
-
Method Details
-
parse
Tries to parse all '.java' files in the ZIP located at this SourceZip's path and returns the parse results in a list.- Returns:
- A list of path-compilation unit pairs.
- Throws:
IOException
- If an error occurs while trying to parse the given source.
-
parse
Tries to parse all '.java' files in the ZIP located at this SourceZip's path and returns the parse results in a list.- Returns:
- A list of path-compilation unit pairs.
- Throws:
IOException
- If an error occurs while trying to parse the given source.
-
getZipPath
Get the path of the ZIP file to be parsed.- Returns:
- The absolute path of this ZIP file.
-
getParserConfiguration
-
setParserConfiguration
-