Documentation
¶
Overview ¶
Package java provides a documentation source adapter that reads Java source code from a local clone of a GitHub repository. It parses raw Java source via tree-sitter to extract classes, interfaces, enums, records, annotations, methods, fields, and JavaDoc without making any network calls during parsing.
Index ¶
- func NewBladeFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewCommonsLangFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewDropwizardFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewGrailsFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewGuavaFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewHelidonFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewHibernateFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewJUnit5Factory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewJacksonFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewJavalinFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewJoobyFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewKafkaFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewLogbackFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewMicronautFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewMockitoFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewNettyFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewOpenJDKFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewPlayFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewQuarkusFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewRatpackFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewSparkFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewSpringBootFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewSpringFrameworkFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewStrutsFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewVertxFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- type Config
- type Option
- type Source
- func (s *Source) DetectWrapper(method *source.Method) (bool, string, string)
- func (s *Source) DiscoverEntities(ctx context.Context, fetch source.FetchFunc) ([]string, error)
- func (s *Source) ID() string
- func (s *Source) Meta() source.LibraryMeta
- func (s *Source) ParseEntity(ctx context.Context, entityID string, content []byte) (*source.Entity, []string, error)
- func (s *Source) ParseMethod(ctx context.Context, methodID string, content []byte) (*source.Method, error)
- func (s *Source) ParseSourceCode(entityID string, content []byte) (string, error)
- func (s *Source) ResolveWrapperURL(targetName, targetKind, entitySlug string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBladeFactory ¶
NewBladeFactory creates a Source for the Blade lightweight MVC framework.
func NewCommonsLangFactory ¶
NewCommonsLangFactory creates a Source for Apache Commons Lang.
func NewDropwizardFactory ¶
NewDropwizardFactory creates a Source for the Dropwizard framework.
func NewGrailsFactory ¶
NewGrailsFactory creates a Source for the Grails framework.
func NewGuavaFactory ¶
NewGuavaFactory creates a Source for Google Guava.
func NewHelidonFactory ¶
NewHelidonFactory creates a Source for the Helidon cloud-native framework.
func NewHibernateFactory ¶
NewHibernateFactory creates a Source for Hibernate ORM.
func NewJUnit5Factory ¶
NewJUnit5Factory creates a Source for JUnit 5.
func NewJacksonFactory ¶
NewJacksonFactory creates a Source for the Jackson JSON library.
func NewJavalinFactory ¶
NewJavalinFactory creates a Source for the Javalin framework.
func NewJoobyFactory ¶
NewJoobyFactory creates a Source for the Jooby web framework. Replaces Ktor, which is written in Kotlin and cannot be indexed by the Java adapter.
func NewKafkaFactory ¶
NewKafkaFactory creates a Source for Apache Kafka.
func NewLogbackFactory ¶
NewLogbackFactory creates a Source for Logback.
func NewMicronautFactory ¶
NewMicronautFactory creates a Source for the Micronaut framework.
func NewMockitoFactory ¶
NewMockitoFactory creates a Source for Mockito.
func NewNettyFactory ¶
NewNettyFactory creates a Source for Netty.
func NewOpenJDKFactory ¶
NewOpenJDKFactory creates a Source for the OpenJDK standard library.
func NewPlayFactory ¶
NewPlayFactory creates a Source for the Play Framework.
func NewQuarkusFactory ¶
NewQuarkusFactory creates a Source for the Quarkus framework.
func NewRatpackFactory ¶
NewRatpackFactory creates a Source for the Ratpack framework.
func NewSparkFactory ¶
NewSparkFactory creates a Source for the Spark Java framework.
func NewSpringBootFactory ¶
NewSpringBootFactory creates a Source for Spring Boot.
func NewSpringFrameworkFactory ¶
func NewSpringFrameworkFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
NewSpringFrameworkFactory creates a Source for the Spring Framework.
func NewStrutsFactory ¶
NewStrutsFactory creates a Source for the Apache Struts framework.
func NewVertxFactory ¶
NewVertxFactory creates a Source for the Vert.x toolkit.
Types ¶
type Config ¶
type Config struct {
// Owner is the GitHub repository owner (e.g., "spring-projects").
Owner string
// Repo is the GitHub repository name (e.g., "spring-framework").
Repo string
// LibraryID is the canonical library ID (e.g., "java/spring-framework").
LibraryID string
// Name is the display name (e.g., "Spring Framework").
Name string
// Description is a short description of the library.
Description string
// SourceURL is the GitHub URL of the project.
SourceURL string
// SourceRoots are the root directories to walk for Java source files,
// relative to the repository root. If empty, defaults to ["src/main/java"].
SourceRoots []string
// ExcludePatterns are glob patterns (relative to repo root) to exclude
// from discovery. Common: ["**/test/**", "**/internal/**"].
ExcludePatterns []string
// TagFilter filters valid tags during version resolution.
TagFilter func(string) bool
}
Config holds the configuration for a Java source adapter. Each Java library (Spring, Hibernate, JUnit, etc.) uses its own Config.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a documentation source adapter for Java libraries.
func (*Source) DetectWrapper ¶
DetectWrapper analyzes a method's source code for delegation patterns.
func (*Source) DiscoverEntities ¶
DiscoverEntities walks the local repository and returns a sorted list of entity identifiers. Each identifier is of the form filepath#ClassName (or filepath#Outer.Inner for inner classes).
func (*Source) Meta ¶
func (s *Source) Meta() source.LibraryMeta
Meta returns metadata for the library record.
func (*Source) ParseEntity ¶
func (s *Source) ParseEntity(ctx context.Context, entityID string, content []byte) (*source.Entity, []string, error)
ParseEntity parses a single entity from file content, identified by entityID.
func (*Source) ParseMethod ¶
func (s *Source) ParseMethod(ctx context.Context, methodID string, content []byte) (*source.Method, error)
ParseMethod parses a single method/function from file content. The methodID has the form: filepath#ClassName::methodName(paramTypes)
func (*Source) ParseSourceCode ¶
ParseSourceCode extracts the source code for a specific entity or method.
func (*Source) ResolveWrapperURL ¶
ResolveWrapperURL constructs the identifier to fetch the wrapped target's source.