FormatXML

com.phasmidsoftware.xmldoc.render.FormatXML
See theFormatXML companion object
case class FormatXML(indents: Int, flat: Boolean = ...) extends BaseFormat

The FormatXML case class provides a specialized implementation for formatting content in XML-like structures. It inherits from BaseFormat and offers additional functionality for handling XML-specific formatting operations, including indentation, flattening, delimiters, and opening/closing tag formatting.

Value parameters

flat

A boolean flag indicating whether the format should be flattened, eliminating structural indentation.

indents

The number of indentation levels to be applied in formatting.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class BaseFormat
trait Format
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def delimiter: String

Provides the delimiter string used for formatting in the FormatXML case class. The delimiter defines the space between elements in the formatted XML output.

Provides the delimiter string used for formatting in the FormatXML case class. The delimiter defines the space between elements in the formatted XML output.

Attributes

Returns

A string representing the delimiter, which is a single space.

Definition Classes
override def flatten: Format

Transforms the current FormatXML instance into a flat format by setting the flat flag to true. This eliminates hierarchical indentation, resulting in a single-line layout.

Transforms the current FormatXML instance into a flat format by setting the flat flag to true. This eliminates hierarchical indentation, resulting in a single-line layout.

Attributes

Returns

A new Format instance with the flat property set to true.

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

Formats the name based on the given rendering state and the optional opening or closing tag context.

Formats the name based on the given rendering state and the optional opening or closing tag context.

Type parameters

T

The type whose class name may be retrieved if no name is provided in the rendering state.

Value parameters

open

An optional Boolean indicating the context of formatting: Some(true) for an opening tag, Some(false) for a closing tag, or None for an inline separator.

stateR

The rendering state that may include an optional name or other formatting context.

Attributes

Returns

A formatted string representing the name or tag, appropriately formatted based on the given state and context.

def indent: Format

Increases the indentation level by 1, creating a new Format instance with the updated indentation level.

Increases the indentation level by 1, creating a new Format instance with the updated indentation level.

Attributes

Returns

A new Format instance with the indents value incremented by 1.

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

Determines the appropriate string separator based on the provided optional boolean value.

Determines the appropriate string separator based on the provided optional boolean value.

Value parameters

open

An optional Boolean value: Some(true) or Some(false) returns an empty string, None returns a newline character ("\n").

Attributes

Returns

A string representing the separator for formatting, either "" or "\n".

Inherited methods

def newline: String

Generates a newline character followed by a string of spaces based on the current indent level. The indentation is determined by the number of indents multiplied by a predefined tab unit.

Generates a newline character followed by a string of spaces based on the current indent level. The indentation is determined by the number of indents multiplied by a predefined tab unit.

Attributes

Returns

A formatted string consisting of a newline character followed by the appropriate level of indentation.

Inherited from:
BaseFormat
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product

Concrete fields

val name: String

Represents the name of the format associated with this case class. This value is used to identify the formatting type, specifically "FormatXML".

Represents the name of the format associated with this case class. This value is used to identify the formatting type, specifically "FormatXML".

Attributes