javamodel

package
v0.0.0-...-c671013 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package javamodel holds the Java class shapes used by the pure-Go contract resolver. It is types only: callers that need to reason about a Class use internal/core/contract or internal/javatype.

Field names and zero-value semantics are kept explicit so these shapes can be materialised from any contract source (source scan, serialised cache, reflection, ...) without leaking source-specific behavior into the resolver.

Index

Constants

View Source
const (
	KindClass     = "class"
	KindInterface = "interface"
	KindEnum      = "enum"
)

Kind constants stay as string literals so they are easy to inspect in tests and any external contract materialisation.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	FQN        string `json:"fqn"`
	SimpleName string `json:"simpleName"`
	// BinaryName is the JVM binary name: nested classes join their
	// enclosing chain with '$' (Outer$Inner) instead of the FQN's '.'.
	// Empty means unknown — consumers must fall back to FQN.
	BinaryName    string      `json:"binaryName,omitempty"`
	File          string      `json:"file,omitempty"`
	Kind          string      `json:"kind"`
	TypeParams    []TypeParam `json:"typeParams,omitempty"`
	Superclass    string      `json:"superclass,omitempty"`
	Interfaces    []string    `json:"interfaces,omitempty"`
	Fields        []Field     `json:"fields,omitempty"`
	EnumConstants []string    `json:"enumConstants,omitempty"`
	Methods       []Method    `json:"methods,omitempty"`
}

Class is one top-level Java type. Kind distinguishes class/interface/enum so downstream code can skip enums during method resolution and walk enumConstants for describe-time rendering.

type Field

type Field struct {
	Name         string `json:"name"`
	JavaType     string `json:"javaType"`
	TypeTemplate string `json:"typeTemplate,omitempty"`
	Required     bool   `json:"required,omitempty"`
}

Field is one declared member. Required is purely advisory here.

type Method

type Method struct {
	Name       string   `json:"name"`
	ParamTypes []string `json:"paramTypes,omitempty"`
	// DeclaredParamTypes keeps the declaring method types before inheritance substitutes type arguments.
	DeclaredParamTypes []string `json:"-"`
	ParamTypeTemplates []string `json:"paramTypeTemplates,omitempty"`
	ReturnType         string   `json:"returnType,omitempty"`
	ReturnTypeTemplate string   `json:"returnTypeTemplate,omitempty"`
}

Method is one declared method. Overloads share a Name — the resolver disambiguates by ParamTypes length + exact match when the agent supplies types, and errors with MethodAmbiguous otherwise.

type TypeParam

type TypeParam struct {
	Name  string `json:"name"`
	Bound string `json:"bound,omitempty"`
}

TypeParam is one formal generic parameter declared by a class or interface. Bound is resolved to the same canonical Java type language used elsewhere.

Jump to

Keyboard shortcuts

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