JWeaver is a zero-decision Java utility for generating
human-readable, structured string representations of objects.
It is designed as a drop-in alternative to handwritten toString() methods,
making objects easy to inspect in logs, debugging sessions, and tests.
Person person = new Person("John Doe", LocalDate.of(1990, 1, 1));
System.out.println(JWeaver.weave(person));Output (INLINE mode):
Person[name=John Doe, birthday=1990-01-01]
Output (TREE mode):
Person
├─ name: John Doe
└─ birthday: 1990-01-01
- Human-readable object rendering
- Multiple rendering modes (INLINE, TREE)
- Cycle detection (no infinite recursion)
- Depth limits
- Sensitive field redaction
- Annotation-based configuration
class User {
String username;
@WeaveRedact
String secret;
}Output:
User[username=john, secret=***]
- Logging processing results
- Debugging complex DTOs
- Inspecting nested object graphs
- CLI debugging tools
JWeaver follows a zero-decision approach:
- No configuration required
- Sensible defaults
- Consistent output
Just call JWeaver.weave(...) and get useful results.
Basic installation
<groupId>com.robinloom</groupId>
<artifactId>jweaver-api</artifactId>
<version>4.1</version>Apache License 2.0