C# 클래스 Hypermedia.WebApi.Json.JsonMediaTypeFormatter

상속: HypermediaMediaTypeFormatter
파일 보기 프로젝트 열기: cosullivan/Hypermedia

공개 메소드들

메소드 설명
GetPerRequestFormatterInstance ( Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType ) : System.Net.Http.Formatting.MediaTypeFormatter

Returns a specialized instance of the T:System.Net.Http.Formatting.MediaTypeFormatter that can format a response for the given parameters.

JsonMediaTypeFormatter ( IContractResolver contractResolver ) : System

Constructor.

JsonMediaTypeFormatter ( IContractResolver contractResolver, bool prettify ) : System

Constructor.

ReadFromStreamAsync ( Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger ) : Task

Asynchronously deserializes an object of the specified type.

WriteToStreamAsync ( Type type, object value, Stream writeStream, HttpContent content, System.Net.TransportContext transportContext ) : System.Threading.Tasks.Task

Asynchronously writes an object of the specified type.

보호된 메소드들

메소드 설명
CanReadOrWrite ( Type type ) : bool

Returns a value indicating whether or not the dictionary has a metadata mapping for the given type.

CreatePatch ( Type type, IContractResolver contractResolver, JsonLite.Ast.JsonValue jsonValue ) : IPatch

Creates an instance of the patch object for the media type.

DeserializeValue ( Type type, JsonLite.Ast.JsonValue jsonValue ) : object

Deserialize an object.

JsonMediaTypeFormatter ( string name, string mediaTypeName, IContractResolver contractResolver, bool prettify ) : System

Constructor.

ReadFromJsonValue ( Type type, JsonLite.Ast.JsonValue jsonValue ) : object

Read an object from the given JSON value.

SerializeValue ( Type type, object value ) : JsonLite.Ast.JsonValue

Serialize the value into an JSON AST.

메소드 상세

CanReadOrWrite() 보호된 메소드

Returns a value indicating whether or not the dictionary has a metadata mapping for the given type.
protected CanReadOrWrite ( Type type ) : bool
type System.Type The element type to test for a mapping.
리턴 bool

CreatePatch() 보호된 메소드

Creates an instance of the patch object for the media type.
protected CreatePatch ( Type type, IContractResolver contractResolver, JsonLite.Ast.JsonValue jsonValue ) : IPatch
type System.Type The type of the inner instance that is being patched.
contractResolver IContractResolver The contract resolver.
jsonValue JsonLite.Ast.JsonValue The JSON value that represents the patch values.
리턴 IPatch

DeserializeValue() 보호된 메소드

Deserialize an object.
protected DeserializeValue ( Type type, JsonLite.Ast.JsonValue jsonValue ) : object
type System.Type The type of the object to deserialize.
jsonValue JsonLite.Ast.JsonValue The JSON value that represents the object to deserialize.
리턴 object

GetPerRequestFormatterInstance() 공개 메소드

Returns a specialized instance of the T:System.Net.Http.Formatting.MediaTypeFormatter that can format a response for the given parameters.
public GetPerRequestFormatterInstance ( Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType ) : System.Net.Http.Formatting.MediaTypeFormatter
type System.Type The type to format.
request System.Net.Http.HttpRequestMessage The request.
mediaType System.Net.Http.Headers.MediaTypeHeaderValue The media type.
리턴 System.Net.Http.Formatting.MediaTypeFormatter

JsonMediaTypeFormatter() 공개 메소드

Constructor.
public JsonMediaTypeFormatter ( IContractResolver contractResolver ) : System
contractResolver IContractResolver The resource contract resolver used to resolve the contracts at runtime.
리턴 System

JsonMediaTypeFormatter() 공개 메소드

Constructor.
public JsonMediaTypeFormatter ( IContractResolver contractResolver, bool prettify ) : System
contractResolver IContractResolver The resource contract resolver used to resolve the contracts at runtime.
prettify bool Indicates whether the output should formatted in a readable way.
리턴 System

JsonMediaTypeFormatter() 보호된 메소드

Constructor.
protected JsonMediaTypeFormatter ( string name, string mediaTypeName, IContractResolver contractResolver, bool prettify ) : System
name string The friendly name of the format.
mediaTypeName string The correct media type name for content negotiation.
contractResolver IContractResolver The resource contract resolver used to resolve the contracts at runtime.
prettify bool Indicates whether the output should formatted in a readable way.
리턴 System

ReadFromJsonValue() 보호된 메소드

Read an object from the given JSON value.
protected ReadFromJsonValue ( Type type, JsonLite.Ast.JsonValue jsonValue ) : object
type System.Type The type of the object to deserialize.
jsonValue JsonLite.Ast.JsonValue The JSON value to read.
리턴 object

ReadFromStreamAsync() 공개 메소드

Asynchronously deserializes an object of the specified type.
Derived types need to support reading.
public ReadFromStreamAsync ( Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger ) : Task
type System.Type The type of the object to deserialize.
readStream Stream The to read.
content System.Net.Http.HttpContent The , if available. It may be null.
formatterLogger IFormatterLogger The to log events to.
리턴 Task

SerializeValue() 보호된 메소드

Serialize the value into an JSON AST.
protected SerializeValue ( Type type, object value ) : JsonLite.Ast.JsonValue
type System.Type The type to serialize from.
value object The value to serialize.
리턴 JsonLite.Ast.JsonValue

WriteToStreamAsync() 공개 메소드

Asynchronously writes an object of the specified type.
Derived types need to support writing.
public WriteToStreamAsync ( Type type, object value, Stream writeStream, HttpContent content, System.Net.TransportContext transportContext ) : System.Threading.Tasks.Task
type System.Type The type of the object to write.
value object The object value to write. It may be null.
writeStream Stream The to which to write.
content System.Net.Http.HttpContent The if available. It may be null.
transportContext System.Net.TransportContext The if available. It may be null.
리턴 System.Threading.Tasks.Task