Class ParseExceptionAnalysis

java.lang.Object
org.openrewrite.DataTable<ParseExceptionAnalysis.Row>
org.openrewrite.javascript.table.ParseExceptionAnalysis

@Incubating(since="0.0") public class ParseExceptionAnalysis extends org.openrewrite.DataTable<ParseExceptionAnalysis.Row>
WIP data table analysis to accelerate implementing language parsing. The analysis is likely generalizable to other languages, and might be moved to a common module after testing.
  • Constructor Details

    • ParseExceptionAnalysis

      public ParseExceptionAnalysis(org.openrewrite.Recipe recipe)
  • Method Details

    • getAnalysisMessage

      public static String getAnalysisMessage(String nodeType)
      Generate a parsing exception message from a given node type for analysis.
      Parameters:
      nodeType - A unique name that represents the node type that caused the parsing exception.
      Returns:
      analysis message.
    • getAnalysisMessage

      public static String getAnalysisMessage(String nodeType, @Nullable @Nullable String sourceSnippet)
      Generate a parsing exception message from a given node type for analysis.
      Parameters:
      nodeType - A unique name that represents the node type that caused the parsing exception.
      sourceSnippet - Optional source snippet to identify where the exception occurred.
      Returns:
      analysis message.
    • getNodeType

      public static String getNodeType(String message)
    • getSourceSnippet

      public static String getSourceSnippet(String message)