Help us shape the future of Go! Take the 2026 Go Developer Survey

java

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package java provides Java extraction for knowledge graphs.

Index

Constants

View Source
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 New

func New() *Extractor

New creates a new Java extractor.

func (*Extractor) CanExtract

func (e *Extractor) CanExtract(path string) bool

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

func (e *Extractor) Extensions() []string

Extensions returns Java file extensions.

func (*Extractor) ExtractFile

func (e *Extractor) ExtractFile(path, baseDir string) ([]*graph.Node, []*graph.Edge, error)

ExtractFile extracts nodes and edges from a single Java file.

func (*Extractor) Language

func (e *Extractor) Language() string

Language returns "java".

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.

Jump to

Keyboard shortcuts

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