Enum Class Mode

java.lang.Object
java.lang.Enum<Mode>
com.robinloom.jweaver.Mode
All Implemented Interfaces:
Serializable, Comparable<Mode>, Constable

public enum Mode extends Enum<Mode>
Defines the available output modes for JWeaver.

A Mode represents a concrete, preconfigured output style. Each mode selects an appropriate Weaver implementation and determines the overall structure and level of detail of the generated string representation.

Modes are intentionally explicit and non-combinable. They are designed to be simple, descriptive presets rather than a configurable matrix of options.

  • Enum Constant Details

    • INLINE

      public static final Mode INLINE
      Compact, single-line representation.

      Suitable for logging and quick debugging output.

    • MULTILINE

      public static final Mode MULTILINE
      Flat, multi-line representation with improved readability.
    • MULTILINE_VERBOSE

      public static final Mode MULTILINE_VERBOSE
      Multi-line representation with increased level of detail.

      Typically includes deeper object traversal or additional metadata.

    • TREE

      public static final Mode TREE
      Hierarchical tree-style representation.

      Emphasizes object structure and relationships.

    • BULLET

      public static final Mode BULLET
      Bullet-point style representation.

      Focuses on concise field listing.

    • CARD

      public static final Mode CARD
      Card-style representation.

      Presents objects in a structured, sectioned layout.

  • Method Details

    • values

      public static Mode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Mode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isMultiline

      public boolean isMultiline()
      Indicates whether this mode produces multi-line output.
      Returns:
      true if the mode uses a multi-line layout, false otherwise
    • getWeaverForMode

      public static Weaver getWeaverForMode(Mode mode)
      Returns a new Weaver instance suitable for the given mode.

      The returned weaver is stateless and may be instantiated per call.

      Parameters:
      mode - the mode to resolve a weaver for
      Returns:
      a corresponding Weaver implementation