public class JavaDiagnosticReader extends Object implements Iterator<TestDiagnosticLine>
JavaDiagnosticReader
with the JAVA_COMMENT_CODEC
JavaDiagnosticReader
with a
DIAGNOSTIC_FILE_CODEC
Modifier and Type | Class and Description |
---|---|
static interface |
JavaDiagnosticReader.DiagnosticCodec
Instances of DiagnosticCodec represent the various formats diagnostic strings can take
|
Modifier and Type | Field and Description |
---|---|
JavaDiagnosticReader.DiagnosticCodec |
codec |
static JavaDiagnosticReader.DiagnosticCodec |
DIAGNOSTIC_FILE_CODEC
Interprets a string that was written as a line in a Diagnostic File
|
static JavaDiagnosticReader.DiagnosticCodec |
JAVA_COMMENT_CODEC
Interprets a string that was written as a comment in a Java file
|
String |
nextLine |
int |
nextLineNumber |
File |
toRead |
JavaFileObject |
toReadFileObject |
Constructor and Description |
---|
JavaDiagnosticReader(File toRead,
JavaDiagnosticReader.DiagnosticCodec codec) |
JavaDiagnosticReader(JavaFileObject toRead,
JavaDiagnosticReader.DiagnosticCodec codec) |
Modifier and Type | Method and Description |
---|---|
protected void |
advance() |
void |
close() |
boolean |
hasNext() |
TestDiagnosticLine |
next() |
static List<TestDiagnosticLine> |
readDiagnosticFile(File toRead,
boolean omitEmptyDiagnostics)
Reads diagnostic lines line-by-line from the input Diagnostic file.
|
static List<TestDiagnosticLine> |
readDiagnosticFileLines(Iterable<? extends File> toRead,
boolean omitEmptyDiagnostics)
Reads diagnostic lines line-by-line from the input Diagnostic files.
|
static List<TestDiagnostic> |
readDiagnosticFiles(Iterable<? extends File> toRead,
boolean omitEmptyDiagnostics)
Reads diagnostics line-by-line from the input Diagnostic files.
|
static List<TestDiagnosticLine> |
readDiagnosticLines(Iterable<File> toRead,
boolean omitEmptyDiagnostics)
Reads diagnostic lines from the comments of a set of Java file.
|
static List<TestDiagnosticLine> |
readDiagnostics(File toRead,
boolean omitEmptyDiagnostics)
Reads diagnostic lines from the comments of the input Java file.
|
static List<TestDiagnosticLine> |
readDiagnostics(File toRead,
JavaDiagnosticReader.DiagnosticCodec codec,
boolean omitEmptyDiagnostics)
Reads the entire input file using the given codec and returns the resulting line.
|
static List<TestDiagnostic> |
readDiagnostics(Iterable<File> toRead,
boolean omitEmptyDiagnostics)
Reads diagnostics from the comments of a set of Java file.
|
static List<TestDiagnosticLine> |
readDiagnosticsJfo(JavaFileObject toRead,
boolean omitEmptyDiagnostics)
Reads diagnostic lines from the comments of a set of Java file.
|
static List<TestDiagnosticLine> |
readExpectedDiagnosticLinesJfo(Iterable<? extends JavaFileObject> toRead,
boolean omitEmptyDiagnostics)
Reads diagnostic lines from the comments of a set of Java file.
|
static List<TestDiagnostic> |
readExpectedDiagnosticsJfo(Iterable<? extends JavaFileObject> toRead,
boolean omitEmptyDiagnostics)
Reads diagnostics from the comments of a set of Java file.
|
void |
remove() |
public static JavaDiagnosticReader.DiagnosticCodec JAVA_COMMENT_CODEC
public static JavaDiagnosticReader.DiagnosticCodec DIAGNOSTIC_FILE_CODEC
public final File toRead
public final JavaFileObject toReadFileObject
public final JavaDiagnosticReader.DiagnosticCodec codec
public String nextLine
public int nextLineNumber
public JavaDiagnosticReader(File toRead, JavaDiagnosticReader.DiagnosticCodec codec)
public JavaDiagnosticReader(JavaFileObject toRead, JavaDiagnosticReader.DiagnosticCodec codec)
public static List<TestDiagnosticLine> readDiagnostics(File toRead, JavaDiagnosticReader.DiagnosticCodec codec, boolean omitEmptyDiagnostics)
toRead
- the file (Java or Diagnostics format) to readcodec
- a codec corresponding to the file type being readomitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnosticLine> readDiagnostics(File toRead, boolean omitEmptyDiagnostics)
toRead
- a Java FileomitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnosticLine> readDiagnosticLines(Iterable<File> toRead, boolean omitEmptyDiagnostics)
toRead
- java files to read using the JAVA_COMMENT_CODEComitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnostic> readDiagnostics(Iterable<File> toRead, boolean omitEmptyDiagnostics)
toRead
- java files to read using the JAVA_COMMENT_CODEComitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnosticLine> readDiagnosticsJfo(JavaFileObject toRead, boolean omitEmptyDiagnostics)
toRead
- the Java files to read using the JAVA_COMMENT_CODEComitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnosticLine> readExpectedDiagnosticLinesJfo(Iterable<? extends JavaFileObject> toRead, boolean omitEmptyDiagnostics)
toRead
- the Java files to read using the JAVA_COMMENT_CODEComitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnostic> readExpectedDiagnosticsJfo(Iterable<? extends JavaFileObject> toRead, boolean omitEmptyDiagnostics)
toRead
- the Java files to read using the JAVA_COMMENT_CODEComitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnosticLine> readDiagnosticFile(File toRead, boolean omitEmptyDiagnostics)
toRead
- a Diagnostic FileomitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnosticLine> readDiagnosticFileLines(Iterable<? extends File> toRead, boolean omitEmptyDiagnostics)
toRead
- a set of Diagnostic FilesomitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic static List<TestDiagnostic> readDiagnosticFiles(Iterable<? extends File> toRead, boolean omitEmptyDiagnostics)
toRead
- a set of Diagnostic FilesomitEmptyDiagnostics
- whether or not lines that do not contain any diagnostics should
be reported as empty TestDiagnosticLinespublic boolean hasNext()
hasNext
in interface Iterator<TestDiagnosticLine>
public void remove()
remove
in interface Iterator<TestDiagnosticLine>
public TestDiagnosticLine next()
next
in interface Iterator<TestDiagnosticLine>
protected void advance() throws IOException
IOException
public void close()