Skip to content

class OutputFormatterCanWriteContext

cangjie
public open class OutputFormatterCanWriteContext

功能:表示输出格式化器写出检查上下文。

成员概览

成员功能
init(Any, HttpContext)创建输出格式化器写出检查上下文。
let result表示待写出的结果对象。
let resultType表示待写出结果的类型信息。
let httpContext表示当前请求的 HTTP 上下文。
var contentType表示当前协商得到的内容类型。
var contentTypeIsServerDefined表示当前内容类型是否由服务端预先指定。

init(Any, HttpContext)

cangjie
public init(result: Any, httpContext: HttpContext)

功能:创建输出格式化器写出检查上下文。

参数:

  • result: Any - 待写出的结果对象。
  • httpContext: HttpContext - 当前请求的 HTTP 上下文。

let result

cangjie
public let result: Any

功能:表示待写出的结果对象。

类型:Any

let resultType

cangjie
public let resultType: TypeInfo

功能:表示待写出结果的类型信息。

类型:TypeInfo

let httpContext

cangjie
public let httpContext: HttpContext

功能:表示当前请求的 HTTP 上下文。

类型:HttpContext

var contentType

cangjie
public var contentType = String.empty

功能:表示当前协商得到的内容类型。

var contentTypeIsServerDefined

cangjie
public var contentTypeIsServerDefined = false

功能:表示当前内容类型是否由服务端预先指定。