java

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package java implements the Java language extractor.

Mirrors src/main/java/.../intelligence/extractor/java/JavaLanguageExtractor.java but uses the tree-sitter Java grammar (already wired in internal/parser) instead of JavaParser. Capabilities:

  • METHOD nodes: emit CALLS edges for method_invocation children of the matching method_declaration. Ambiguous-label callees (two distinct METHOD nodes share a label) are dropped — same false-positive guard as the Java side.
  • CLASS / ABSTRACT_CLASS / INTERFACE nodes: emit type-hint properties `extends_type` and `implements_types` from the matching class/interface_declaration.

Confidence: PARTIAL — the tree-sitter resolver isn't a full Java type checker, so we tag every emitted fact PARTIAL. The Edge.Confidence field (typed) stays LEXICAL; the "confidence":"PARTIAL" string lives in Properties for parity with the Java side's edge.properties map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct{}

Extractor is the Java LanguageExtractor implementation. Stateless and safe for concurrent calls.

func New

func New() *Extractor

New constructs a Java extractor.

func (*Extractor) Extract

func (e *Extractor) Extract(ctx extractor.Context, node *model.CodeNode) extractor.Result

Extract returns CALLS edges for METHOD nodes and type-hierarchy hints for CLASS / ABSTRACT_CLASS / INTERFACE nodes. Single-node convenience wrapper — parses once per call. Production paths use ExtractFromTree.

func (*Extractor) ExtractFromTree

func (e *Extractor) ExtractFromTree(ctx extractor.Context, tree *parser.Tree, nodes []*model.CodeNode) []extractor.Result

ExtractFromTree walks the pre-parsed tree once per input node and returns one Result per node in matching order. tree may be nil — all results are EmptyResult in that case.

func (*Extractor) Language

func (e *Extractor) Language() string

Language returns "java".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL