public class SourceZip extends Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
SourceZip.Callback |
An interface to define a callback for each file that's parsed.
|
Constructor | Description |
---|---|
SourceZip(Path zipPath) |
Create a new ZIP parser.
|
SourceZip(Path zipPath,
ParserConfiguration configuration) |
Create a new ZIP parser.
|
Modifier and Type | Method | Description |
---|---|---|
JavaParser |
getJavaParser() |
Get the parser used for parsing.
|
Path |
getZipPath() |
Get the path of the ZIP file to be parsed.
|
List<Pair<Path,ParseResult<CompilationUnit>>> |
parse() |
Tries to parse all '.java' files in the ZIP located at this SourceZip's path and returns the parse
results in a list.
|
SourceZip |
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.
|
SourceZip |
setJavaParser(JavaParser javaParser) |
Set the parser that is used for parsing.
|
public SourceZip(Path zipPath)
JavaParser
with the default ParserConfiguration
will be
used to parse the ZIP.zipPath
- The absolute path of ZIP file to parse.public SourceZip(Path zipPath, ParserConfiguration configuration)
JavaParser
with the given configuration will be used to parse
the ZIP.zipPath
- The absolute path of ZIP file to parse.configuration
- The configuration to initiate the default parser with.public List<Pair<Path,ParseResult<CompilationUnit>>> parse() throws IOException
IOException
- If an error occurs while trying to parse the given source.public SourceZip parse(SourceZip.Callback callback) throws IOException
IOException
- If an error occurs while trying to parse the given source.public Path getZipPath()
public JavaParser getJavaParser()
public SourceZip setJavaParser(JavaParser javaParser)
javaParser
- The parser to use.Copyright © 2007–2019. All rights reserved.