Class OutputSettings

java.lang.Object
org.libxmq.OutputSettings

public class OutputSettings extends Object
The OutputSettings class is used to configure the output behavior when printing XMQ. It provides options for controlling pretty printing, indentation, and other formatting settings that affect how XMQ content is presented as plain text, ansi-colored text, HTML or TeX.

Typical usage involves enabling or disabling pretty printing, setting the indentation width, and adjusting other output-related preferences to produce human-readable or compact XMQ output.

Example:


 OutputSettings settings = new OutputSettings()
     .setPrettyPrint(true)
     .setIndentAmount(4);
 
  • Constructor Details

    • OutputSettings

      public OutputSettings()
      Create default output settings.
  • Method Details

    • setCompact

      public OutputSettings setCompact(boolean c)
      Set if printing compact XMQ or not. Compact XMQ uses no newlines for the entire document.
      Parameters:
      c - If true, then print XMQ on a single line, ie no newlines.
      Returns:
      this OutputSettings instance, for method chaining
    • compact

      public boolean compact()
      Returns the previously set compact setting.
      Returns:
      the compact setting
    • setIndentAmount

      public OutputSettings setIndentAmount(int amount)
      Sets the number of spaces to use for each level of indentation when pretty printing XMQ output.

      This setting is only applied when pretty printing is enabled. Increasing the indent amount makes the output more readable, while setting a smaller value produces more compact output.

      Parameters:
      amount - the number of spaces to use per indentation level; must be zero or a positive integer, negative values are interpreted as zero.
      Returns:
      this OutputSettings instance, for method chaining
    • indentAmount

      public int indentAmount()
      Returns the previously set indentation amount.
      Returns:
      the indentation amount