Class JWeaver

java.lang.Object
com.robinloom.jweaver.JWeaver

public final class JWeaver extends Object
Central entry point of the JWeaver API.

JWeaver provides a simple, zero-decision way to generate human-readable string representations of arbitrary Java objects using reflection. It is designed as a drop-in replacement for handwritten toString() implementations.

The default weave(Object) method uses the Mode.INLINE mode, which produces a compact, single-line representation suitable for logging and debugging. Alternative output styles can be selected explicitly via weave(Object, Mode).

Internally, JWeaver selects an appropriate Weaver implementation based on the chosen Mode. Circular object references are detected automatically to ensure safe output.

This class is intentionally non-instantiable and exposes only static convenience methods.

See Also:
  • Method Details

    • weave

      public static String weave(Object object)
      Generates a string representation of the given object using the default Mode.INLINE mode.
      Parameters:
      object - the object to generate a string representation for
      Returns:
      a human-readable string representation of the given object
    • weave

      public static String weave(Object object, Mode mode)
      Generates a string representation of the given object using the specified Mode.
      Parameters:
      object - the object to generate a string representation for
      mode - the output mode controlling structure and level of detail
      Returns:
      a human-readable string representation of the given object