Class LinearWeaver

java.lang.Object
com.robinloom.jweaver.linear.LinearWeaver
All Implemented Interfaces:
Weaver

public class LinearWeaver extends Object implements Weaver
LinearWeaver generates a string representation for a given object by combining the object information (class name, field names, values) with a set of separator strings. The set of separator strings is dynamically configurable.

Example:

Person[name=John Doe, birthday=1990-01-01]
  • Field Details

  • Constructor Details

    • LinearWeaver

      public LinearWeaver()
  • 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. 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