Class TypeTable

java.lang.Object
org.openrewrite.java.internal.parser.TypeTable
All Implemented Interfaces:
org.openrewrite.java.internal.parser.JavaParserClasspathLoader

@Incubating(since="8.44.0") public class TypeTable extends Object implements org.openrewrite.java.internal.parser.JavaParserClasspathLoader
Type tables are written as a TSV file with the following columns:
  • groupId
  • artifactId
  • version
  • classAccess
  • className
  • classSignature
  • classSuperclassSignature
  • classSuperinterfaceSignatures[]
  • access
  • memberName
  • descriptor
  • signature
  • parameterNames
  • exceptions[]
  • elementAnnotations
  • parameterAnnotations[]
  • typeAnnotations[]
  • constantValue

Descriptor and signature are in JVMS 4.3 format. Because these type tables could get fairly large, the format is optimized for fast record access. TSV was chosen over CSV for its simplicity and for the reasons cited here.

There is of course a lot of duplication in the class and GAV columns, but compression cuts down on the disk impact of that and the value is an overall single table representation.

To read a compressed type table file (which is compressed with gzip), the following command can be used: gzcat types.tsv.gz.

  • Field Details

    • VERIFY_CLASS_WRITING

      public static final String VERIFY_CLASS_WRITING
      Verifies that the bytecodes written out for the types represented in a type table will not be invalid and therefore rejected by the JVM verifier when used in a compilation step.
      See Also:
    • DEFAULT_RESOURCE_PATH

      public static final String DEFAULT_RESOURCE_PATH
      See Also:
  • Method Details

    • fromClasspath

      public static @Nullable TypeTable fromClasspath(org.openrewrite.ExecutionContext ctx, Collection<String> artifactNames)
    • newWriter

      public static TypeTable.Writer newWriter(OutputStream out)
    • load

      public @Nullable Path load(String artifactName)
      Specified by:
      load in interface org.openrewrite.java.internal.parser.JavaParserClasspathLoader