/** * Method called when input comes as a {@link java.io.Reader}, and buffer allocation * can be done using default mechanism. */ public ReaderBasedJsonParser(IOContext ctxt, int features, Reader r, ObjectCodec codec, CharsToNameCanonicalizer st) { super(ctxt, features); _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _inputPtr = 0; _inputEnd = 0; _objectCodec = codec; _symbols = st; _hashSeed = st.hashSeed(); _bufferRecyclable = true; }
/** * Method called when input comes as a {@link java.io.Reader}, and buffer allocation * can be done using default mechanism. */ public ReaderBasedJsonParser(ObjectReadContext readCtxt, IOContext ctxt, int stdFeatures, int formatFeatures, Reader r, CharsToNameCanonicalizer st) { super(readCtxt, ctxt, stdFeatures, formatFeatures); _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _inputPtr = 0; _inputEnd = 0; _symbols = st; _hashSeed = st.hashSeed(); _bufferRecyclable = true; }
/** * Method for constructing parser for parsing * contents of given String. * * @since 2.1 */ public JsonParser createParser(String content) throws IOException, JsonParseException { final int strLen = content.length(); // Actually, let's use this for medium-sized content, up to 64kB chunk (32kb char) if ((_inputDecorator != null) || (strLen > 0x8000) || !canUseCharArrays()) { // easier to just wrap in a Reader than extend InputDecorator; or, if content // is too long for us to copy it over return createParser(new StringReader(content)); } IOContext ctxt = _createContext(content, true); char[] buf = ctxt.allocTokenBuffer(strLen); content.getChars(0, strLen, buf, 0); return _createParser(buf, 0, strLen, ctxt, true); }
@Override public JsonParser createParser(ObjectReadContext readCtxt, String content) throws IOException { final int strLen = content.length(); // Actually, let's use this for medium-sized content, up to 64kB chunk (32kb char) if ((_inputDecorator != null) || (strLen > 0x8000) || !canUseCharArrays()) { // easier to just wrap in a Reader than extend InputDecorator; or, if content // is too long for us to copy it over return createParser(readCtxt, new StringReader(content)); } IOContext ioCtxt = _createContext(content, true); char[] buf = ioCtxt.allocTokenBuffer(strLen); content.getChars(0, strLen, buf, 0); return _createParser(readCtxt, ioCtxt, buf, 0, strLen, true); }
public RisonParser(IOContext ctxt, int jsonFeatures, int risonFeatures, Reader r, ObjectCodec codec, CharsToNameCanonicalizer st) { super(ctxt, jsonFeatures); _reader = r; _risonFeatures = risonFeatures; _inputBuffer = ctxt.allocTokenBuffer(); _objectCodec = codec; _symbols = st; }
public ReaderBasedJsonParser(IOContext ctxt, int features, Reader r, ObjectCodec codec, CharsToNameCanonicalizer st) { super(ctxt, features); _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _objectCodec = codec; _symbols = st; }
public ReaderBasedJsonParser(IOContext ctxt, int features, Reader r, ObjectCodec codec, CharsToNameCanonicalizer st) { super(ctxt, features); _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _objectCodec = codec; _symbols = st; _hashSeed = st.hashSeed(); }
public CsvReader(CsvParser owner, IOContext ctxt, Reader r, CsvSchema schema, TextBuffer textBuffer, boolean autoCloseInput, boolean trimSpaces) { _owner = owner; _ioContext = ctxt; _inputSource = r; _textBuffer = textBuffer; _autoCloseInput = autoCloseInput; _trimSpaces = trimSpaces; _inputBuffer = ctxt.allocTokenBuffer(); _bufferRecyclable = true; // since we allocated it _inputSource = r; _tokenInputRow = -1; _tokenInputCol = -1; setSchema(schema); }
/** * Method called when input comes as a {@link java.io.Reader}, and buffer allocation * can be done using default mechanism. */ public ReaderBasedJsonParser(IOContext ctxt, int features, Reader r, ObjectCodec codec, CharsToNameCanonicalizer st) { super(ctxt, features); _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _inputPtr = 0; _inputEnd = 0; _objectCodec = codec; _symbols = st; _hashSeed = st.hashSeed(); _bufferRecyclable = true; }
/** * Method called when input comes as a {@link java.io.Reader}, and buffer allocation * can be done using default mechanism. */ public ReaderBasedJsonParser(IOContext ctxt, int features, Reader r, ObjectCodec codec, CharsToNameCanonicalizer st) { super(ctxt, features); _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _inputPtr = 0; _inputEnd = 0; _objectCodec = codec; _symbols = st; _hashSeed = st.hashSeed(); _bufferRecyclable = true; }
/** * Method called when input comes as a {@link java.io.Reader}, and buffer allocation * can be done using default mechanism. */ public ReaderBasedJsonParser(IOContext ctxt, int features, Reader r, ObjectCodec codec, CharsToNameCanonicalizer st) { super(ctxt, features); _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _inputPtr = 0; _inputEnd = 0; _objectCodec = codec; _symbols = st; _hashSeed = st.hashSeed(); _bufferRecyclable = true; }
/** * Method called when input comes as a {@link java.io.Reader}, and buffer allocation * can be done using default mechanism. */ public ReaderBasedJsonParser(IOContext ctxt, int features, Reader r, ObjectCodec codec, CharsToNameCanonicalizer st) { super(ctxt, features); _reader = r; _inputBuffer = ctxt.allocTokenBuffer(); _inputPtr = 0; _inputEnd = 0; _objectCodec = codec; _symbols = st; _hashSeed = st.hashSeed(); _bufferRecyclable = true; }
/** * Method for constructing parser for parsing * contents of given String. * * @since 2.1 */ public JsonParser createParser(String content) throws IOException, JsonParseException { final int strLen = content.length(); // Actually, let's use this for medium-sized content, up to 64kB chunk (32kb char) if ((_inputDecorator != null) || (strLen > 0x8000) || !canUseCharArrays()) { // easier to just wrap in a Reader than extend InputDecorator; or, if content // is too long for us to copy it over return createParser(new StringReader(content)); } IOContext ctxt = _createContext(content, true); char[] buf = ctxt.allocTokenBuffer(strLen); content.getChars(0, strLen, buf, 0); return _createParser(buf, 0, strLen, ctxt, true); }
/** * Method for constructing parser for parsing * contents of given String. * * @since 2.1 */ public JsonParser createParser(String content) throws IOException, JsonParseException { final int strLen = content.length(); // Actually, let's use this for medium-sized content, up to 64kB chunk (32kb char) if (_inputDecorator != null || strLen > 0x8000 || !canUseCharArrays()) { // easier to just wrap in a Reader than extend InputDecorator; or, if content // is too long for us to copy it over return createParser(new StringReader(content)); } IOContext ctxt = _createContext(content, true); char[] buf = ctxt.allocTokenBuffer(strLen); content.getChars(0, strLen, buf, 0); return _createParser(buf, 0, strLen, ctxt, true); }
/** * Method for constructing parser for parsing * contents of given String. * * @since 2.1 */ public JsonParser createParser(String content) throws IOException, JsonParseException { final int strLen = content.length(); // Actually, let's use this for medium-sized content, up to 64kB chunk (32kb char) if (_inputDecorator != null || strLen > 0x8000 || !canUseCharArrays()) { // easier to just wrap in a Reader than extend InputDecorator; or, if content // is too long for us to copy it over return createParser(new StringReader(content)); } IOContext ctxt = _createContext(content, true); char[] buf = ctxt.allocTokenBuffer(strLen); content.getChars(0, strLen, buf, 0); return _createParser(buf, 0, strLen, ctxt, true); }
/** * Method for constructing parser for parsing * contents of given String. * * @since 2.1 */ public JsonParser createParser(String content) throws IOException, JsonParseException { final int strLen = content.length(); // Actually, let's use this for medium-sized content, up to 64kB chunk (32kb char) if ((_inputDecorator != null) || (strLen > 0x8000) || !canUseCharArrays()) { // easier to just wrap in a Reader than extend InputDecorator; or, if content // is too long for us to copy it over return createParser(new StringReader(content)); } IOContext ctxt = _createContext(content, true); char[] buf = ctxt.allocTokenBuffer(strLen); content.getChars(0, strLen, buf, 0); return _createParser(buf, 0, strLen, ctxt, true); }
public CsvDecoder(IOContext ctxt, CsvParser owner, Reader r, CsvSchema schema, TextBuffer textBuffer, int stdFeatures, int csvFeatures) { _owner = owner; _ioContext = ctxt; _inputSource = r; _textBuffer = textBuffer; _autoCloseInput = StreamReadFeature.AUTO_CLOSE_SOURCE.enabledIn(stdFeatures); _allowComments = CsvParser.Feature.ALLOW_COMMENTS.enabledIn(csvFeatures); _trimSpaces = CsvParser.Feature.TRIM_SPACES.enabledIn(csvFeatures); _inputBuffer = ctxt.allocTokenBuffer(); _bufferRecyclable = true; // since we allocated it _inputSource = r; _tokenInputRow = -1; _tokenInputCol = -1; setSchema(schema); }
public CsvDecoder(CsvParser owner, IOContext ctxt, Reader r, CsvSchema schema, TextBuffer textBuffer, int stdFeatures, int csvFeatures) // boolean autoCloseInput, boolean trimSpaces) { _owner = owner; _ioContext = ctxt; _inputSource = r; _textBuffer = textBuffer; _autoCloseInput = JsonParser.Feature.AUTO_CLOSE_SOURCE.enabledIn(stdFeatures); _allowComments = JsonParser.Feature.ALLOW_YAML_COMMENTS.enabledIn(stdFeatures); _trimSpaces = CsvParser.Feature.TRIM_SPACES.enabledIn(csvFeatures); _inputBuffer = ctxt.allocTokenBuffer(); _bufferRecyclable = true; // since we allocated it _inputSource = r; _tokenInputRow = -1; _tokenInputCol = -1; setSchema(schema); }