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
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()
Assembly: Azos.dll
Syntax
public class JSONWritingOptions : IConfigurable
Constructors
JSONWritingOptions()
Declaration
public JSONWritingOptions()
JSONWritingOptions(JSONWritingOptions)
Declaration
public JSONWritingOptions(JSONWritingOptions other)
Parameters
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
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 |
|
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
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
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
PrettyPrint
Writes JSON suitable for printing/screen display
Declaration
public static JSONWritingOptions PrettyPrint { get; }
Property Value
PrettyPrintASCII
Writes JSON suitable for printing/screen display
with codes above 127 suitable for ASCII transmission
Declaration
public static JSONWritingOptions PrettyPrintASCII { get; }
Property Value
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
Methods
Declaration
public void Configure(IConfigSectionNode node)
Parameters
Implements
Extension Methods