Renderers

com.phasmidsoftware.xmldoc.render.Renderers
See theRenderers companion trait
object Renderers

Object containing various Renderer instances and utility methods for rendering objects into string representations with optional attributes and specific formatting rules.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Renderers.type

Members list

Value members

Concrete methods

Provides a Renderer instance for rendering enum-like attributes. This renderer converts the input type T into a string representation and processes it as an attribute using the rendering state information.

Provides a Renderer instance for rendering enum-like attributes. This renderer converts the input type T into a string representation and processes it as an attribute using the rendering state information.

Type parameters

T

the type parameter for the object being rendered, representing an enum-like type.

Attributes

Returns

a Renderer[T] instance for rendering enum attributes.

Provides a Renderer instance for rendering objects of type T. This method converts the input object into a string representation using its toString method.

Provides a Renderer instance for rendering objects of type T. This method converts the input object into a string representation using its toString method.

Type parameters

T

the type of the object to render.

Attributes

Returns

a Renderer[T] that processes the object and renders its string representation.

def renderAny(t: Any, maybeName: Option[String]): Try[String]

Renders any given object into a string representation, optionally incorporating a name as part of the rendering. The rendering is performed using the renderAttribute method, which formats the output as either name="value" or simply value if no name is provided.

Renders any given object into a string representation, optionally incorporating a name as part of the rendering. The rendering is performed using the renderAttribute method, which formats the output as either name="value" or simply value if no name is provided.

Value parameters

maybeName

an optional string representing the name to be prefixed in the rendered output

t

the object to be rendered, converted to its string representation using toString

Attributes

Returns

a Try[String] containing the rendered representation or an exception if rendering fails

Concrete fields

val logger: Logger

Implicits

Implicits

implicit val booleanRenderer: Renderer[Boolean]
implicit val byteRenderer: Renderer[Byte]
implicit val charSequenceRenderer: Renderer[CharSequence]

Implicit Renderer instance for the CharSequence type.

Implicit Renderer instance for the CharSequence type.

This renderer is responsible for converting a CharSequence into its string representation, based on the given format and rendering state. It handles two specific cases:

  1. If the input CharSequence is of type CDATA and the format is _XML, it invokes toXML to generate the appropriate XML representation.
  2. For all other CharSequence inputs, it uses the scrub method to sanitize the input and then calls renderAttribute to produce the final string representation.

Note: Additional handling may be needed to convert all other CharSequence inputs into CDATA if required.

Attributes

implicit val doubleRenderer: Renderer[Double]
implicit val intRenderer: Renderer[Int]
implicit val longRenderer: Renderer[Long]
implicit val rendererOptionBoolean: Renderer[Option[Boolean]]
implicit val rendererOptionDouble: Renderer[Option[Double]]
implicit val rendererOptionInt: Renderer[Option[Int]]
implicit val rendererOptionString: Renderer[Option[String]]
implicit val rendererOptionText: Renderer[Option[Text]]
implicit val rendererSequenceString: Renderer[Seq[String]]
implicit val rendererText: Renderer[Text]
implicit val stringRenderer: Renderer[String]
implicit val uriRenderer: Renderer[URI]

Implicit Renderer instance for java.net.URI, the counterpart to Extractor.uriExtractor.

Implicit Renderer instance for java.net.URI, the counterpart to Extractor.uriExtractor.

Attributes