class
Noir::TreeSitterJavaDtoIndex
- Noir::TreeSitterJavaDtoIndex
- Reference
- Object
Overview
Builds the DTO field index for a given source file by combining:
- in-file class/interface declarations,
- every
.javain the same directory (same Java package), and - files reachable through the
importstatements, resolved against a source root inferred from the current file'spackage ...;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.
Defined in:
miniparsers/java_parameter_extractor_ts.crConstructors
Class Method Summary
Instance Method Summary
-
#build_for(path : String, content : String) : Index
Build the DTO index visible to the Spring controller at
path. -
#build_for_with_root(path : String, content : String, root : LibTreeSitter::TSNode) : Index
#build_for_with_root(path, content, root)— same as#build_forbut uses a pre-parsed root for the current file's extractions (extract_package_name,extract_imports, the current file'sextract_class_fields).
Constructor Detail
Class Method Detail
Instance Method Detail
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.
#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.