class

Noir::TreeSitterJavaDtoIndex

Inherits Reference < Object

Builds the DTO field index for a given source file by combining:

  1. in-file class/interface declarations,
  2. every .java in the same directory (same Java package), and
  3. files reachable through the import statements, resolved against a source root inferred from the current file's package ...; declaration.

Each file's extraction is memoised so the per-file loop in spring.cr doesn't re-read and re-parse DTOs over and over when many controllers share the same package.

Constants

MAX_INHERITANCE_RESOLUTIONS = 512

Backstop against pathological extends graphs — far above any real DTO hierarchy depth/fan-out.

Constructors

Class methods

clear_cache!
Source

Instance methods

build_for(path : String, content : String) : Index

Build the DTO index visible to the Spring controller at path. Callers pass content (already read once) to avoid a redundant disk read for the current file. Cross-file traversal is delegated to Noir::ImportGraph so this stays a thin language-specific cache.

Source
build_for_with_root(path : String, content : String, root : LibTreeSitter::TSNode) : Index

build_for_with_root(path, content, root) — same as build_for but uses a pre-parsed root for the current file's extractions (extract_package_name, extract_imports, the current file's extract_class_fields). Sibling files still parse independently — but sibling parses go through the process-wide cache so concurrent analyzers don't double-up.

Source

Nested types