Class JavaDiagnosticReader
- java.lang.Object
-
- org.checkerframework.framework.test.diagnostics.JavaDiagnosticReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.util.Iterator<TestDiagnosticLine>
public class JavaDiagnosticReader extends java.lang.Object implements java.util.Iterator<TestDiagnosticLine>, java.io.Closeable
This class reads expected javac diagnostics from a single file. Its implementation is as an iterator overTestDiagnosticLine
. However, clients should call the static methods:readJavaSourceFiles(java.lang.Iterable<? extends java.lang.Object>)
reads diagnostics from multiple Java source files, andreadDiagnosticFiles(java.lang.Iterable<? extends java.io.File>)
reads diagnostics from multiple "diagnostic files".
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
advance()
void
close()
boolean
hasNext()
TestDiagnosticLine
next()
static java.util.List<TestDiagnostic>
readDiagnosticFiles(java.lang.Iterable<? extends java.io.File> files)
Reads diagnostics line-by-line from the input diagnostic files.static java.util.List<TestDiagnostic>
readJavaSourceFiles(java.lang.Iterable<? extends java.lang.Object> files)
Returns all the diagnostics in any of the Java source files.void
remove()
-
-
-
Method Detail
-
readJavaSourceFiles
public static java.util.List<TestDiagnostic> readJavaSourceFiles(java.lang.Iterable<? extends java.lang.Object> files)
Returns all the diagnostics in any of the Java source files.- Parameters:
files
- the Java files to read; each is a File or a JavaFileObject- Returns:
- the TestDiagnostics from the input file
-
readDiagnosticFiles
public static java.util.List<TestDiagnostic> readDiagnosticFiles(java.lang.Iterable<? extends java.io.File> files)
Reads diagnostics line-by-line from the input diagnostic files.- Parameters:
files
- a set of diagnostic files- Returns:
- the TestDiagnosticLines from the input files
-
hasNext
@Pure public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<TestDiagnosticLine>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<TestDiagnosticLine>
-
next
public TestDiagnosticLine next()
- Specified by:
next
in interfacejava.util.Iterator<TestDiagnosticLine>
-
advance
@RequiresNonNull("reader") protected void advance(@UnknownInitialization JavaDiagnosticReader this) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-