원클릭으로
java-conventions
// Code style, naming conventions, license headers, and patterns for Xeres Java project. Covers Allman braces, utility classes, package structure, and field injection rules.
// Code style, naming conventions, license headers, and patterns for Xeres Java project. Covers Allman braces, utility classes, package structure, and field injection rules.
ArchUnit architecture rules enforced in Xeres including common module rules (logging, utility classes), app module rules (no field injection, RsService naming), and UI module rules (WindowController naming).
Cryptography patterns for Xeres including PGP operations, key generation, and hash functions with best practices.
DTO and mapper patterns for Xeres using Java records, canonical constructors with validation, and static mapper utility classes.
Flyway SQL migration patterns for Xeres including naming conventions, H2 database patterns, enum types, foreign keys, and best practices.
Gradle build configuration for Xeres including build commands, version management, module structure, and key plugins.
JavaFX patterns for Xeres including controller structure with FXML views, WindowController lifecycle, WindowManager usage, and JavaFX-Spring integration.
| name | java-conventions |
| description | Code style, naming conventions, license headers, and patterns for Xeres Java project. Covers Allman braces, utility classes, package structure, and field injection rules. |
Every source file must include the GPL v3 header:
/*
* Copyright (c) [year-range] by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
* Xeres is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation...
*/
The version of Java used in Java 25.
final classUnsupportedOperationExceptionpublic final class FooUtils
{
private ProfileMapper()
{
throw new UnsupportedOperationException("Utility class");
}
public static void doSomething(int count)
{ ...}
}
| Type | Pattern |
|---|---|
| Services | *Service.java |
| Controllers | *Controller.java or *WindowController.java |
| REST Controllers | *Controller.java in api/controller/ |
| Client classes | *Client.java |
| Utility classes | *Utils.java |
| Fakes/Test fixtures | *Fakes.java |
| Mappers | *Mapper.java (static utility class) |
io.xeres.<module>.<feature>
| Module | Packages |
|---|---|
| app | api, application, configuration, crypto, database, job, net, service, xrs |
| ui | client, controller, custom, event, model, support |
| common | dto, events, id, message, rest, protocol |
java.util.logging)private static final Logger log = LoggerFactory.getLogger(ClassName.class);debug facilityField injection is prohibited. Use constructor injection instead:
// Bad
@Autowired
private ProfileService profileService;
// Good
private final ProfileService profileService;
public ContactService(ProfileService profileService)
{
this.profileService = profileService;
}