Class CardWeaver

java.lang.Object
com.robinloom.jweaver.card.CardWeaver
All Implemented Interfaces:
Weaver

public class CardWeaver extends Object implements Weaver
CardWeaver depicts a given object as a framed card with aligned key-value pairs inside a box. This representation focuses on clarity and aesthetics, making it well-suited for logs, debug output, or summaries.

Example:

╭ User ───────────────╮
│ name  : Alice       │
│ age   : 28          │
│ email : alice@a.com │
╰─────────────────────╯
  • Field Details

  • Constructor Details

    • CardWeaver

      public CardWeaver()
  • Method Details

    • weave

      public String weave(Object object)
      Specified by:
      weave in interface Weaver
    • weave

      public String weave(Object object, Mode mode)
      Generates a string representation of the given object via reflections. Prints the class name followed by every accessible field in an ordered structure resembling a business card. For JDK classes, a regular toString() result is returned. Detects reciprocal and circular object dependencies.
      Specified by:
      weave in interface Weaver
      Parameters:
      object - object to generate a string representation for
      Returns:
      a well-structured, human-readable representation of that object