Documentation
¶
Overview ¶
Package java provides Java extraction for knowledge graphs.
Index ¶
- Constants
- type Extractor
- type SpringDetector
- func (d *SpringDetector) DetectLayer(annotations []string) string
- func (d *SpringDetector) DetectRoute(annotations []string, node *sitter.Node, content []byte) string
- func (d *SpringDetector) DetectSpring(root *sitter.Node, content []byte) *provider.FrameworkInfo
- func (d *SpringDetector) IsInjection(annotations []string) bool
- func (d *SpringDetector) IsRouteAnnotation(annotation string) bool
Constants ¶
const ( // Language is the canonical name for Java. Language = "java" // NodePrefix is the prefix for all Java node IDs. NodePrefix = "java_" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor implements extract.LanguageExtractor for Java source code.
func (*Extractor) CanExtract ¶
CanExtract returns true for .java files.
func (*Extractor) DetectFramework ¶
func (e *Extractor) DetectFramework(path string) *provider.FrameworkInfo
DetectFramework returns Spring framework info if detected.
func (*Extractor) Extensions ¶
Extensions returns Java file extensions.
func (*Extractor) ExtractFile ¶
ExtractFile extracts nodes and edges from a single Java file.
type SpringDetector ¶
type SpringDetector struct {
// contains filtered or unexported fields
}
SpringDetector detects Spring framework annotations and patterns.
func NewSpringDetector ¶
func NewSpringDetector() *SpringDetector
NewSpringDetector creates a new Spring detector.
func (*SpringDetector) DetectLayer ¶
func (d *SpringDetector) DetectLayer(annotations []string) string
DetectLayer returns the architectural layer based on annotations.
func (*SpringDetector) DetectRoute ¶
func (d *SpringDetector) DetectRoute(annotations []string, node *sitter.Node, content []byte) string
DetectRoute extracts the HTTP route from request mapping annotations.
func (*SpringDetector) DetectSpring ¶
func (d *SpringDetector) DetectSpring(root *sitter.Node, content []byte) *provider.FrameworkInfo
DetectSpring checks if the file contains Spring annotations.
func (*SpringDetector) IsInjection ¶
func (d *SpringDetector) IsInjection(annotations []string) bool
IsInjection returns true if any annotation indicates dependency injection.
func (*SpringDetector) IsRouteAnnotation ¶
func (d *SpringDetector) IsRouteAnnotation(annotation string) bool
IsRouteAnnotation returns true if the annotation maps to an HTTP route.