ValueFormatter Class

Base class for formatters that format values based on media type.

public abstract class ValueFormatter

Constructors

NameDescription
ValueFormatter()

ValueFormatter()

protected ValueFormatter()

No documentation is available.

Methods

NameDescription
Format(HumanReadableTextWriter, string?, HumanReadableSerializerOptions)Formats the specified value and writes it to the writer.

Format(HumanReadableTextWriter, string?, HumanReadableSerializerOptions)

Formats the specified value and writes it to the writer.

public abstract void Format(HumanReadableTextWriter writer, string? value, HumanReadableSerializerOptions options)

Parameters

writer HumanReadableTextWriter
The writer to write to.
value string?
The value to format.
options HumanReadableSerializerOptions
The serialization options.

Constants

NameDescription
CssMediaTypeNameThe media type name for CSS.
HtmlMediaTypeNameThe media type name for HTML.
JavascriptMediaTypeNameThe media type name for JavaScript.
JsonMediaTypeNameThe media type name for JSON.
WwwFormUrlEncodedMediaTypeNameThe media type name for URL-encoded form data.
XmlMediaTypeNameThe media type name for XML.

CssMediaTypeName

The media type name for CSS.

public const string CssMediaTypeName = "text/css"

HtmlMediaTypeName

The media type name for HTML.

public const string HtmlMediaTypeName = "text/html"

JavascriptMediaTypeName

The media type name for JavaScript.

public const string JavascriptMediaTypeName = "text/javascript"

JsonMediaTypeName

The media type name for JSON.

public const string JsonMediaTypeName = "application/json"

WwwFormUrlEncodedMediaTypeName

The media type name for URL-encoded form data.

public const string WwwFormUrlEncodedMediaTypeName = "application/x-www-form-urlencoded"

XmlMediaTypeName

The media type name for XML.

public const string XmlMediaTypeName = "application/xml"