Format

com.phasmidsoftware.xmldoc.render.Format
trait 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 Object
trait Matchable
class 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 Format instance that represents the flat version of the current format.

def formatName[T : ClassTag](open: Option[Boolean], stateR: StateR): String

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, and None an undefined state.

stateR

The current rendering state, represented as a StateR instance, containing details such as the name, attributes, and level of rendering invocation.

Attributes

Returns

A String representing the formatted name based on the input parameters.

def indent: Format

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 Format instance with the updated indentation level applied.

def newline: String

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 String representing the newline character or sequence.

def sequencer(open: Option[Boolean]): String

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, and None an undefined state.

Attributes

Returns

A String representing the sequence format based on the input state.

Concrete methods

def delimiter: String

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 String representing the default delimiter, typically a comma followed by a space (", ").

Abstract fields

val indents: Int

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.

Attributes