Class TypeTable.Reader
java.lang.Object
org.openrewrite.java.internal.parser.TypeTable.Reader
- Enclosing class:
TypeTable
Reads a type table from the classpath, and writes per-artifact JARs to disk for matching artifact names.
JARs are preferred over classes-directories on the parser classpath because javac uses an in-memory
archive index (ArchiveContainer) for jars, whereas a classes-directory triggers an
openat per list() call from DirectoryContainer during template parsing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOptions for controlling how type tables are read.static interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidparseTsvAndProcess(InputStream is, TypeTable.Reader.Options options, org.openrewrite.java.internal.parser.TypeTable.Reader.ClassesProcessor processor) Common TSV parsing logic used by both read() methods.voidread(InputStream is, TypeTable.Reader.Options options) voidread(InputStream is, TypeTable.Reader.Options options, Supplier<org.objectweb.asm.ClassVisitor> visitorSupplier) Read a type table and process classes with custom ClassVisitors instead of writing to disk.voidread(InputStream is, TypeTable.Reader.Options options, Supplier<org.objectweb.asm.ClassVisitor> visitorSupplier, TypeTable.Reader.ResourceConsumer resourceConsumer) Read a type table and process classes with custom ClassVisitors, and route non-class resources (e.g.,.kotlin_modulefiles) to the given consumer.
-
Constructor Details
-
Reader
public Reader()
-
-
Method Details
-
read
- Throws:
IOException
-
read
public void read(InputStream is, TypeTable.Reader.Options options, Supplier<org.objectweb.asm.ClassVisitor> visitorSupplier) throws IOException Read a type table and process classes with custom ClassVisitors instead of writing to disk.- Parameters:
is- The input stream containing the TSV dataoptions- Options controlling how the type table is readvisitorSupplier- Supplier to create a ClassVisitor for each class- Throws:
IOException
-
read
public void read(InputStream is, TypeTable.Reader.Options options, Supplier<org.objectweb.asm.ClassVisitor> visitorSupplier, TypeTable.Reader.ResourceConsumer resourceConsumer) throws IOException Read a type table and process classes with custom ClassVisitors, and route non-class resources (e.g.,.kotlin_modulefiles) to the given consumer.- Throws:
IOException
-
parseTsvAndProcess
public void parseTsvAndProcess(InputStream is, TypeTable.Reader.Options options, org.openrewrite.java.internal.parser.TypeTable.Reader.ClassesProcessor processor) throws IOException Common TSV parsing logic used by both read() methods. Parses the TSV and calls the processor for each GAV's classes.- Throws:
IOException
-