C# Class JsonFx.Json.JsonWriter

JSON serializer
Inheritance: ModelWriter
Exibir arquivo Open project: hiddenswitch/Meteor-Unity Class Usage Examples

Private Properties

Property Type Description
GetFlagList System.Enum[]
IsDefaultValue bool
IsIgnored bool
WriteObjectProperty void

Public Methods

Method Description
IDisposable ( ) : void
JsonWriter ( System.Stream output ) : System

Ctor

JsonWriter ( System.Stream output, JsonWriterSettings settings ) : System

Ctor

JsonWriter ( System.StringBuilder output ) : System

Ctor

JsonWriter ( System.StringBuilder output, JsonWriterSettings settings ) : System

Ctor

JsonWriter ( TextWriter output ) : System

Ctor

JsonWriter ( TextWriter output, JsonWriterSettings settings ) : System

Ctor

JsonWriter ( string outputFileName ) : System

Ctor

JsonWriter ( string outputFileName, JsonWriterSettings settings ) : System

Ctor

Serialize ( object value ) : string

A helper method for serializing an object to JSON

Write ( System.DateTime value ) : void
Write ( Enum value ) : void
Write ( System.Guid value ) : void
Write ( System.TimeSpan value ) : void
Write ( Uri value ) : void
Write ( System.Version value ) : void
Write ( bool value ) : void
Write ( byte value ) : void
Write ( char value ) : void
Write ( decimal value ) : void
Write ( double value ) : void
Write ( float value ) : void
Write ( int value ) : void
Write ( long value ) : void
Write ( object value ) : void
Write ( sbyte value ) : void
Write ( short value ) : void
Write ( string value ) : void
Write ( uint value ) : void
Write ( ulong value ) : void
Write ( ushort value ) : void
WriteBase64 ( byte value ) : void
WriteHexString ( byte value ) : void

Protected Methods

Method Description
InvalidIeee754 ( decimal value ) : bool

Determines if a numberic value cannot be represented as IEEE-754.

Write ( object value, bool isProperty ) : void
WriteArray ( IEnumerable value ) : void
WriteArrayItem ( object item ) : void
WriteArrayItemDelim ( ) : void
WriteDictionary ( IEnumerable value ) : void
WriteLine ( ) : void
WriteObject ( IDictionary value ) : void
WriteObject ( object value, Type type ) : void
WriteObjectPropertyDelim ( ) : void
WriteObjectPropertyName ( string name ) : void
WriteObjectPropertyValue ( object value ) : void

Private Methods

Method Description
GetFlagList ( Type enumType, object value ) : System.Enum[]

Splits a bitwise-OR'd set of enums into a list.

from PseudoCode.EnumHelper

IsDefaultValue ( MemberInfo member, object value ) : bool

Determines if the member value matches the DefaultValue attribute

IsIgnored ( Type objType, MemberInfo member, object obj ) : bool

Determines if the property or field should not be serialized.

Checks these in order, if any returns true then this is true: - is flagged with the JsonIgnoreAttribute property - has a JsonSpecifiedProperty which returns false

WriteObjectProperty ( string key, object value ) : void

Method Details

IDisposable() public method

public IDisposable ( ) : void
return void

InvalidIeee754() protected method

Determines if a numberic value cannot be represented as IEEE-754.
protected InvalidIeee754 ( decimal value ) : bool
value decimal
return bool

JsonWriter() public method

Ctor
public JsonWriter ( System.Stream output ) : System
output System.Stream Stream for writing
return System

JsonWriter() public method

Ctor
public JsonWriter ( System.Stream output, JsonWriterSettings settings ) : System
output System.Stream Stream for writing
settings JsonWriterSettings JsonWriterSettings
return System

JsonWriter() public method

Ctor
public JsonWriter ( System.StringBuilder output ) : System
output System.StringBuilder StringBuilder for appending
return System

JsonWriter() public method

Ctor
public JsonWriter ( System.StringBuilder output, JsonWriterSettings settings ) : System
output System.StringBuilder StringBuilder for appending
settings JsonWriterSettings JsonWriterSettings
return System

JsonWriter() public method

Ctor
public JsonWriter ( TextWriter output ) : System
output TextWriter TextWriter for writing
return System

JsonWriter() public method

Ctor
public JsonWriter ( TextWriter output, JsonWriterSettings settings ) : System
output TextWriter TextWriter for writing
settings JsonWriterSettings JsonWriterSettings
return System

JsonWriter() public method

Ctor
public JsonWriter ( string outputFileName ) : System
outputFileName string
return System

JsonWriter() public method

Ctor
public JsonWriter ( string outputFileName, JsonWriterSettings settings ) : System
outputFileName string
settings JsonWriterSettings JsonWriterSettings
return System

Serialize() public static method

A helper method for serializing an object to JSON
public static Serialize ( object value ) : string
value object
return string

Write() public method

public Write ( System.DateTime value ) : void
value System.DateTime
return void

Write() public method

public Write ( Enum value ) : void
value System.Enum
return void

Write() public method

public Write ( System.Guid value ) : void
value System.Guid
return void

Write() public method

public Write ( System.TimeSpan value ) : void
value System.TimeSpan
return void

Write() public method

public Write ( Uri value ) : void
value System.Uri
return void

Write() public method

public Write ( System.Version value ) : void
value System.Version
return void

Write() public method

public Write ( bool value ) : void
value bool
return void

Write() public method

public Write ( byte value ) : void
value byte
return void

Write() public method

public Write ( char value ) : void
value char
return void

Write() public method

public Write ( decimal value ) : void
value decimal
return void

Write() public method

public Write ( double value ) : void
value double
return void

Write() public method

public Write ( float value ) : void
value float
return void

Write() public method

public Write ( int value ) : void
value int
return void

Write() public method

public Write ( long value ) : void
value long
return void

Write() public method

public Write ( object value ) : void
value object
return void

Write() protected method

protected Write ( object value, bool isProperty ) : void
value object
isProperty bool
return void

Write() public method

public Write ( sbyte value ) : void
value sbyte
return void

Write() public method

public Write ( short value ) : void
value short
return void

Write() public method

public Write ( string value ) : void
value string
return void

Write() public method

public Write ( uint value ) : void
value uint
return void

Write() public method

public Write ( ulong value ) : void
value ulong
return void

Write() public method

public Write ( ushort value ) : void
value ushort
return void

WriteArray() protected method

protected WriteArray ( IEnumerable value ) : void
value IEnumerable
return void

WriteArrayItem() protected method

protected WriteArrayItem ( object item ) : void
item object
return void

WriteArrayItemDelim() protected method

protected WriteArrayItemDelim ( ) : void
return void

WriteBase64() public method

public WriteBase64 ( byte value ) : void
value byte
return void

WriteDictionary() protected method

protected WriteDictionary ( IEnumerable value ) : void
value IEnumerable
return void

WriteHexString() public method

public WriteHexString ( byte value ) : void
value byte
return void

WriteLine() protected method

protected WriteLine ( ) : void
return void

WriteObject() protected method

protected WriteObject ( IDictionary value ) : void
value IDictionary
return void

WriteObject() protected method

protected WriteObject ( object value, Type type ) : void
value object
type System.Type
return void

WriteObjectPropertyDelim() protected method

protected WriteObjectPropertyDelim ( ) : void
return void

WriteObjectPropertyName() protected method

protected WriteObjectPropertyName ( string name ) : void
name string
return void

WriteObjectPropertyValue() protected method

protected WriteObjectPropertyValue ( object value ) : void
value object
return void