Class OutputSettings
java.lang.Object
org.libxmq.OutputSettings
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancompact()Returns the previously set compact setting.intReturns the previously set indentation amount.setCompact(boolean c) Set if printing compact XMQ or not.setIndentAmount(int amount) Sets the number of spaces to use for each level of indentation when pretty printing XMQ output.
-
Constructor Details
-
OutputSettings
public OutputSettings()Create default output settings.
-
-
Method Details
-
setCompact
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
OutputSettingsinstance, for method chaining
-
compact
public boolean compact()Returns the previously set compact setting.- Returns:
- the compact setting
-
setIndentAmount
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
OutputSettingsinstance, for method chaining
-
indentAmount
public int indentAmount()Returns the previously set indentation amount.- Returns:
- the indentation amount
-