Esempio n. 1
0
        public FhirJsonInputFormatter(FhirJsonParser parser, ArrayPool <char> charPool)
        {
            EnsureArg.IsNotNull(parser, nameof(parser));
            EnsureArg.IsNotNull(charPool, nameof(charPool));

            _parser   = parser;
            _charPool = new JsonArrayPool <char>(charPool);

            SupportedEncodings.Add(UTF8EncodingWithoutBOM);
            SupportedEncodings.Add(UTF16EncodingLittleEndian);
            SupportedMediaTypes.Add(KnownContentTypes.JsonContentType);
            SupportedMediaTypes.Add(KnownMediaTypeHeaderValues.ApplicationJson);
            SupportedMediaTypes.Add(KnownMediaTypeHeaderValues.TextJson);
            SupportedMediaTypes.Add(KnownMediaTypeHeaderValues.ApplicationAnyJsonSyntax);
        }
        public HtmlOutputFormatter(
            FhirJsonSerializer fhirJsonSerializer,
            ILogger <HtmlOutputFormatter> logger,
            INarrativeHtmlSanitizer htmlSanitizer,
            ArrayPool <char> charPool)
        {
            EnsureArg.IsNotNull(fhirJsonSerializer, nameof(fhirJsonSerializer));
            EnsureArg.IsNotNull(logger, nameof(logger));
            EnsureArg.IsNotNull(htmlSanitizer, nameof(htmlSanitizer));
            EnsureArg.IsNotNull(charPool, nameof(charPool));

            _fhirJsonSerializer = fhirJsonSerializer;
            _logger             = logger;
            _htmlSanitizer      = htmlSanitizer;
            _charPool           = new JsonArrayPool <char>(charPool);

            SupportedEncodings.Add(Encoding.UTF8);
            SupportedMediaTypes.Add("text/html");
            SupportedMediaTypes.Add("application/xhtml+xml");
        }
        public FhirJsonOutputFormatter(
            FhirJsonSerializer fhirJsonSerializer,
            ILogger <FhirJsonOutputFormatter> logger,
            ArrayPool <char> charPool)
        {
            EnsureArg.IsNotNull(fhirJsonSerializer, nameof(fhirJsonSerializer));
            EnsureArg.IsNotNull(logger, nameof(logger));
            EnsureArg.IsNotNull(charPool, nameof(charPool));

            _fhirJsonSerializer = fhirJsonSerializer;
            _logger             = logger;
            _charPool           = new JsonArrayPool <char>(charPool);

            SupportedEncodings.Add(Encoding.UTF8);
            SupportedEncodings.Add(Encoding.Unicode);
            SupportedMediaTypes.Add(KnownContentTypes.JsonContentType);
            SupportedMediaTypes.Add(KnownMediaTypeHeaderValues.ApplicationJson);
            SupportedMediaTypes.Add(KnownMediaTypeHeaderValues.TextJson);
            SupportedMediaTypes.Add(KnownMediaTypeHeaderValues.ApplicationAnyJsonSyntax);
        }