Show / Hide Table of Contents

Class JSONWritingOptions

Specifies how JSON should be written as text. Use JSONWritingOptions.Compact or JSONWritingOptions.PrettyPrint static properties for typical options

Inheritance
System.Object
JSONWritingOptions
Implements
IConfigurable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.Serialization.JSON
Assembly: NFX.dll
Syntax
public class JSONWritingOptions : IConfigurable

Constructors

JSONWritingOptions()

Declaration
public JSONWritingOptions()

JSONWritingOptions(JSONWritingOptions)

Declaration
public JSONWritingOptions(JSONWritingOptions other)
Parameters
Type Name Description
JSONWritingOptions other

Fields

ASCIITarget

Specifies whether the target of serialization only deals with ASCII characeters, so any non-ASCII character with code above 127 must be escaped with unicode escape sequence

Declaration
[Config]
public bool ASCIITarget
Field Value
Type Description
System.Boolean

IndentWidth

Specifies character width of single indent level

Declaration
[Config]
public int IndentWidth
Field Value
Type Description
System.Int32

ISODates

Specifies whether DateTime must be encoded using ISO8601 format that look like "2011-03-18T14:25:00Z", otherwise dates are encoded using "new Date(milliseconds_since_unix_epoch)" which is technically not a valid JSON, however most JSON parsers understand it very well

Declaration
[Config]
public bool ISODates
Field Value
Type Description
System.Boolean

MapSkipNulls

If true, then does not write map keys which are null

Declaration
[Config]
public bool MapSkipNulls
Field Value
Type Description
System.Boolean

MaxNestingLevel

Sets a limit of object nesting, i.e. for recursive graph depth. Default is 0xff

Declaration
[Config]
public int MaxNestingLevel
Field Value
Type Description
System.Int32

MemberLineBreak

Specifies whether every object member must be placed on a separate line for better readability

Declaration
[Config]
public bool MemberLineBreak
Field Value
Type Description
System.Boolean

NLSMapLanguageISO

Specifies language ISO code (3 chars) that is used (when set) by the NLSMap class, so only entries for that particular language are included. When NLSMap contains entries for more than 1 language, but user needs only one entry received for his/her selected language, this option can be set, then NLSMap will only inline Name:Descr pair for that language. If a map does not contain an entry for the reequested lang then NLSMapLanguageISODefault will be tried

Declaration
[Config]
public string NLSMapLanguageISO
Field Value
Type Description
System.String

NLSMapLanguageISODefault

Specified language ISO default for NLSMap lookup, "eng" is used for default

Declaration
[Config]
public string NLSMapLanguageISODefault
Field Value
Type Description
System.String

ObjectLineBreak

Specifies whether objects need to be separated by line brakes for better readability

Declaration
[Config]
public bool ObjectLineBreak
Field Value
Type Description
System.Boolean

Purpose

Specifies the purpose of JSON serialization so the level of detail may be dynamically adjusted. Depending on this parameter IJSONWritable implementors may include additional details that are otherwise not needed

Declaration
[Config]
public JSONSerializationPurpose Purpose
Field Value
Type Description
JSONSerializationPurpose

RowMapTargetName

When set, specifies the target name for Row's fields when they are written as map

Declaration
[Config]
public string RowMapTargetName
Field Value
Type Description
System.String

RowsAsMap

When true, writes every row as a map {FieldName: FieldValue,...} instead of array of values

Declaration
[Config]
public bool RowsAsMap
Field Value
Type Description
System.Boolean

RowsetMetadata

When true, writes rowset metadata (i.e. schema, instance id etc.)

Declaration
[Config]
public bool RowsetMetadata
Field Value
Type Description
System.Boolean

SpaceSymbols

Indicates whether a space must be placed right after the symbol, such as coma in array declaration or colon in member declaration for better readability

Declaration
[Config]
public bool SpaceSymbols
Field Value
Type Description
System.Boolean

Properties

Compact

Writes JSON without line breaks between members and no indenting. Suitable for data transmission

Declaration
public static JSONWritingOptions Compact { get; }
Property Value
Type Description
JSONWritingOptions

CompactASCII

Writes JSON without line breaks between members and no indenting escaping any characters with codes above 127 suitable for ASCII transmission

Declaration
public static JSONWritingOptions CompactASCII { get; }
Property Value
Type Description
JSONWritingOptions

CompactRowsAsMap

Writes JSON without line breaks between members and no indenting writing rows as maps(key:values) instead of arrays. Suitable for data transmission

Declaration
public static JSONWritingOptions CompactRowsAsMap { get; }
Property Value
Type Description
JSONWritingOptions

PrettyPrint

Writes JSON suitable for printing/screen display

Declaration
public static JSONWritingOptions PrettyPrint { get; }
Property Value
Type Description
JSONWritingOptions

PrettyPrintASCII

Writes JSON suitable for printing/screen display with codes above 127 suitable for ASCII transmission

Declaration
public static JSONWritingOptions PrettyPrintASCII { get; }
Property Value
Type Description
JSONWritingOptions

PrettyPrintRowsAsMap

Writes JSON suitable for printing/screen display writing rows as maps(key:values) instead of arrays

Declaration
public static JSONWritingOptions PrettyPrintRowsAsMap { get; }
Property Value
Type Description
JSONWritingOptions

Methods

Configure(IConfigSectionNode)

Declaration
public void Configure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node

Implements

IConfigurable

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX