Class JavaDiagnosticReader
java.lang.Object
org.checkerframework.framework.test.diagnostics.JavaDiagnosticReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<TestDiagnosticLine>
This class reads expected javac diagnostics from a single file. Its implementation is as an
iterator over
TestDiagnosticLine
. However, clients should call the static methods: readJavaSourceFiles(java.lang.Iterable<? extends java.lang.Object>)
reads diagnostics from multiple Java source files, and readDiagnosticFiles(java.lang.Iterable<? extends java.io.File>)
reads diagnostics from multiple "diagnostic files".-
Method Summary
Modifier and TypeMethodDescriptionprotected void
advance()
void
close()
boolean
hasNext()
next()
static List<TestDiagnostic>
readDiagnosticFiles
(Iterable<? extends File> files) Reads diagnostics line-by-line from the input diagnostic files.static List<TestDiagnostic>
readJavaSourceFiles
(Iterable<? extends Object> files) Returns all the diagnostics in any of the Java source files.void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
readJavaSourceFiles
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
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
- Specified by:
hasNext
in interfaceIterator<TestDiagnosticLine>
-
remove
public void remove()- Specified by:
remove
in interfaceIterator<TestDiagnosticLine>
-
next
- Specified by:
next
in interfaceIterator<TestDiagnosticLine>
-
advance
@RequiresNonNull("reader") protected void advance(@UnknownInitialization JavaDiagnosticReader this) throws IOException - Throws:
IOException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-