java-bindings-patterns
Instructions for java bindings patterns.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
priority: high
Java Bindings Patterns
Role: Java bindings for Rust core. Work on C FFI bridge and Java wrapper packages.
Scope: Java 25 Foreign Function & Memory API (FFM/Panama), Java-idiomatic API, JUnit 5 tests, Javadoc.
Architecture: Java FFM API → C FFI library → Rust core. No JNI, modern Foreign Function API.
Commands: cd packages/java && mvn clean compile test, mvn checkstyle:check, mvn spotless:apply.
E2E Tests: Auto-generated from fixtures via e2e-generator. Regenerate tests when fixtures change.
Critical: Core logic lives in Rust. Java only for FFI bindings/wrappers. If core logic needed, coordinate with Rust team.
Key files: Core.java (high-level API), CoreFFI.java (FFI bindings), config/* (builder pattern), Exception.java (exception hierarchy).
Code quality: Zero Checkstyle/PMD warnings, use mvn checkstyle:check and mvn spotless:apply.
Java 25 Standards & FFM API
- Java 25 exclusively; FFM API for native interop, sealed classes, records, pattern matching
- Build: Maven (pom.xml) or Gradle (build.gradle.kts); compiler release=25
- JUnit 5: @Nested classes, @ParameterizedTest, AssertJ fluent assertions, 80%+ coverage
- Checkstyle: 4-space indent, line <=120 chars, Javadoc on public APIs
- PMD: UnusedVariable, EmptyCatchBlock, AvoidDuplicateLiterals enabled
- FFM patterns: Arena for memory management, try-with-resources, bounds validation
- Naming: PascalCase (classes), camelCase (methods/fields), UPPER_SNAKE_CASE (constants)
- Best practices: final on classes/methods, immutable records, Optional<T> not null
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!