Format
The Format trait defines a blueprint for handling various formatting operations such as indentation, flattening, delimiters, sequencing, and line breaks. It is designed as a flexible interface to be implemented by specific formatting strategies.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Members list
Value members
Abstract methods
Transforms the current format into a flat format, eliminating any structural nesting or additional indentation rules. This is useful for scenarios where a compact, single-line layout is required, disregarding hierarchical formatting.
Transforms the current format into a flat format, eliminating any structural nesting or additional indentation rules. This is useful for scenarios where a compact, single-line layout is required, disregarding hierarchical formatting.
Attributes
- Returns
-
A new
Formatinstance that represents the flat version of the current format.
Formats the name based on the given options and state of rendering.
Formats the name based on the given options and state of rendering.
Type parameters
- T
-
The type parameter with an implicit
ClassTag, typically used to provide runtime type information.
Value parameters
- open
-
An optional Boolean value that specifies whether the formatting should consider an open state. A
Some(true)might indicate open,Some(false)a closed state, andNonean undefined state. - stateR
-
The current rendering state, represented as a
StateRinstance, containing details such as the name, attributes, and level of rendering invocation.
Attributes
- Returns
-
A
Stringrepresenting the formatted name based on the input parameters.
Adjusts the formatting of the content by applying an additional level of indentation. This method increases the hierarchical structure or nesting level used during output formatting.
Adjusts the formatting of the content by applying an additional level of indentation. This method increases the hierarchical structure or nesting level used during output formatting.
Attributes
- Returns
-
A new
Formatinstance with the updated indentation level applied.
Retrieves the newline character or sequence used by the current format. This is typically used to control line breaks in formatted output.
Retrieves the newline character or sequence used by the current format. This is typically used to control line breaks in formatted output.
Attributes
- Returns
-
A
Stringrepresenting the newline character or sequence.
Determines the sequence format based on the provided open state.
Determines the sequence format based on the provided open state.
Value parameters
- open
-
An optional Boolean value that specifies whether the sequence should consider an open state.
Some(true)might indicate open,Some(false)a closed state, andNonean undefined state.
Attributes
- Returns
-
A String representing the sequence format based on the input state.
Concrete methods
Retrieves the default delimiter used for separating elements in formatted content.
Retrieves the default delimiter used for separating elements in formatted content.
Attributes
- Returns
-
A
Stringrepresenting the default delimiter, typically a comma followed by a space (", ").
Abstract fields
Represents the number of indentation levels used in the current formatting context. This value determines the hierarchical structure applied during the formatting process.
Represents the number of indentation levels used in the current formatting context. This value determines the hierarchical structure applied during the formatting process.