Class FormulaRefExtractor

java.lang.Object
io.keikai.model.impl.sys.formula.FormulaRefExtractor

public final class FormulaRefExtractor extends Object
Extracts Ref precedents from a formula string by routing through the Rust formula parser via JNI (KeikaiNative.formulaExtractRefs).

kkmodel cannot have a Maven compile-time dependency on keikai-native (that direction is reserved for the JNI bridge), so the JNI entry point is resolved via MethodHandle reflection at class load — same pattern as RustFormatBridge.

Since:
7.0.0
  • Method Details

    • extract

      public static List<Ref> extract(String formula, String bookName, String sheetName, int sheetIndex)
      Extract precedent refs from the formula. Cell and area refs found by the Rust parser are reported relative to (bookName, sheetName).
      Parameters:
      formula - the formula string (with or without leading '=')
      bookName - book name to attach to each Ref
      sheetName - sheet name to attach to each Ref
      sheetIndex - current sheet index (passed to Rust for context)
      Returns:
      list of refs; empty if parsing fails or no refs found.