/** * Optional factory method, expected to be overridden * * @since 2.8 */ protected JsonParser _createParser(DataInput input, IOContext ctxt) throws IOException { // 13-May-2016, tatu: Need to take care not to accidentally create JSON parser for // non-JSON input. _requireJSONFactory("InputData source not (yet?) support for this format (%s)"); // Also: while we can't do full bootstrapping (due to read-ahead limitations), should // at least handle possible UTF-8 BOM int firstByte = ByteSourceJsonBootstrapper.skipUTF8BOM(input); ByteQuadsCanonicalizer can = _byteSymbolCanonicalizer.makeChild(_factoryFeatures); return new UTF8DataInputJsonParser(ctxt, _parserFeatures, input, _objectCodec, can, firstByte); }
@Override protected JsonParser _createParser(ObjectReadContext readCtxt, IOContext ioCtxt, DataInput input) throws IOException { // Also: while we can't do full bootstrapping (due to read-ahead limitations), should // at least handle possible UTF-8 BOM int firstByte = ByteSourceJsonBootstrapper.skipUTF8BOM(input); ByteQuadsCanonicalizer can = _byteSymbolCanonicalizer.makeChild(_factoryFeatures); return new UTF8DataInputJsonParser(readCtxt, ioCtxt, readCtxt.getStreamReadFeatures(_streamReadFeatures), readCtxt.getFormatReadFeatures(_formatReadFeatures), input, can, firstByte); }
/** * @since 2.8 */ protected JsonParser _createParser(DataInput input, IOContext ctxt) throws IOException { // 13-May-2016, tatu: Need to take care not to accidentally create JSON parser for // non-JSON input. So, bit unclean but... String format = getFormatName(); if (format != FORMAT_NAME_JSON) { // NOTE: only ensure override; full equality NOT needed throw new UnsupportedOperationException(String.format( "InputData source not (yet?) support for this format (%s)", format)); } // Also: while we can't do full bootstrapping (due to read-ahead limitations), should // at least handle possible UTF-8 BOM int firstByte = ByteSourceJsonBootstrapper.skipUTF8BOM(input); ByteQuadsCanonicalizer can = _byteSymbolCanonicalizer.makeChild(_factoryFeatures); return new UTF8DataInputJsonParser(ctxt, _parserFeatures, input, _objectCodec, can, firstByte); }
/** * Optional factory method, expected to be overridden * * @since 2.8 */ protected JsonParser _createParser(DataInput input, IOContext ctxt) throws IOException { // 13-May-2016, tatu: Need to take care not to accidentally create JSON parser for // non-JSON input. _requireJSONFactory("InputData source not (yet?) support for this format (%s)"); // Also: while we can't do full bootstrapping (due to read-ahead limitations), should // at least handle possible UTF-8 BOM int firstByte = ByteSourceJsonBootstrapper.skipUTF8BOM(input); ByteQuadsCanonicalizer can = _byteSymbolCanonicalizer.makeChild(_factoryFeatures); return new UTF8DataInputJsonParser(ctxt, _parserFeatures, input, _objectCodec, can, firstByte); }