public JsonParser constructParser(int features, ObjectCodec codec, BytesToNameCanonicalizer rootByteSymbols, CharsToNameCanonicalizer rootCharSymbols) throws IOException, JsonParseException { JsonEncoding enc = detectEncoding(); // As per [JACKSON-259], may want to fully disable canonicalization: boolean canonicalize = JsonParser.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(features); boolean intern = JsonParser.Feature.INTERN_FIELD_NAMES.enabledIn(features); if (enc == JsonEncoding.UTF8) { /* and without canonicalization, byte-based approach is not performance; just use std UTF-8 reader * (which is ok for larger input; not so hot for smaller; but this is not a common case) */ if (canonicalize) { BytesToNameCanonicalizer can = rootByteSymbols.makeChild(canonicalize, intern); return new Utf8StreamParser(_context, features, _in, codec, can, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable); } } return new ReaderBasedParser(_context, features, constructReader(), codec, rootCharSymbols.makeChild(canonicalize, intern)); }
public Utf8StreamParser(IOContext paramIOContext, int paramInt1, InputStream paramInputStream, ObjectCodec paramObjectCodec, BytesToNameCanonicalizer paramBytesToNameCanonicalizer, byte[] paramArrayOfByte, int paramInt2, int paramInt3, boolean paramBoolean) { super(paramIOContext, paramInt1, paramInputStream, paramArrayOfByte, paramInt2, paramInt3, paramBoolean); this._objectCodec = paramObjectCodec; this._symbols = paramBytesToNameCanonicalizer; if (!JsonParser.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(paramInt1)) _throwInternal(); }
protected Name slowParseFieldName() throws IOException, JsonParseException { if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOF(": was expecting closing '\"' for name"); byte[] arrayOfByte = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); int j = 0xFF & arrayOfByte[i]; if (j == 34) return BytesToNameCanonicalizer.getEmptyName(); return parseEscapedFieldName(this._quadBuffer, 0, 0, j, 0); }
public JsonParser constructParser(int paramInt, ObjectCodec paramObjectCodec, BytesToNameCanonicalizer paramBytesToNameCanonicalizer, CharsToNameCanonicalizer paramCharsToNameCanonicalizer) throws IOException, JsonParseException { JsonEncoding localJsonEncoding = detectEncoding(); boolean bool1 = JsonParser.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(paramInt); boolean bool2 = JsonParser.Feature.INTERN_FIELD_NAMES.enabledIn(paramInt); if ((localJsonEncoding == JsonEncoding.UTF8) && (bool1)) { BytesToNameCanonicalizer localBytesToNameCanonicalizer = paramBytesToNameCanonicalizer.makeChild(bool1, bool2); return new Utf8StreamParser(this._context, paramInt, this._in, paramObjectCodec, localBytesToNameCanonicalizer, this._inputBuffer, this._inputPtr, this._inputEnd, this._bufferRecyclable); } return new ReaderBasedParser(this._context, paramInt, constructReader(), paramObjectCodec, paramCharsToNameCanonicalizer.makeChild(bool1, bool2)); }
public Utf8StreamParser(IOContext paramIOContext, int paramInt1, InputStream paramInputStream, ObjectCodec paramObjectCodec, BytesToNameCanonicalizer paramBytesToNameCanonicalizer, byte[] paramArrayOfByte, int paramInt2, int paramInt3, boolean paramBoolean) { super(paramIOContext, paramInt1); this._inputStream = paramInputStream; this._objectCodec = paramObjectCodec; this._symbols = paramBytesToNameCanonicalizer; this._inputBuffer = paramArrayOfByte; this._inputPtr = paramInt2; this._inputEnd = paramInt3; this._bufferRecyclable = paramBoolean; if (!JsonParser.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(paramInt1)) _throwInternal(); }
protected final Name slowParseFieldName() { if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOF(": was expecting closing '\"' for name"); byte[] arrayOfByte = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); int j = 0xFF & arrayOfByte[i]; if (j == 34) return BytesToNameCanonicalizer.getEmptyName(); return parseEscapedFieldName(this._quadBuffer, 0, 0, j, 0); }
public final JsonParser constructParser(int paramInt, ObjectCodec paramObjectCodec, BytesToNameCanonicalizer paramBytesToNameCanonicalizer, CharsToNameCanonicalizer paramCharsToNameCanonicalizer) { JsonEncoding localJsonEncoding = detectEncoding(); boolean bool1 = JsonParser.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(paramInt); boolean bool2 = JsonParser.Feature.INTERN_FIELD_NAMES.enabledIn(paramInt); if ((localJsonEncoding == JsonEncoding.UTF8) && (bool1)) { BytesToNameCanonicalizer localBytesToNameCanonicalizer = paramBytesToNameCanonicalizer.makeChild(bool1, bool2); return new Utf8StreamParser(this._context, paramInt, this._in, paramObjectCodec, localBytesToNameCanonicalizer, this._inputBuffer, this._inputPtr, this._inputEnd, this._bufferRecyclable); } return new ReaderBasedParser(this._context, paramInt, constructReader(), paramObjectCodec, paramCharsToNameCanonicalizer.makeChild(bool1, bool2)); }
protected final Name _parseFieldName(int paramInt) throws IOException, JsonParseException { if (paramInt != 34) return _handleUnusualFieldName(paramInt); if (9 + this._inputPtr > this._inputEnd) return slowParseFieldName(); byte[] arrayOfByte = this._inputBuffer; int[] arrayOfInt = sInputCodesLatin1; int i = this._inputPtr; this._inputPtr = (i + 1); int j = 0xFF & arrayOfByte[i]; if (arrayOfInt[j] == 0) { int k = this._inputPtr; this._inputPtr = (k + 1); int m = 0xFF & arrayOfByte[k]; if (arrayOfInt[m] == 0) { int n = m | j << 8; int i1 = this._inputPtr; this._inputPtr = (i1 + 1); int i2 = 0xFF & arrayOfByte[i1]; if (arrayOfInt[i2] == 0) { int i3 = i2 | n << 8; int i4 = this._inputPtr; this._inputPtr = (i4 + 1); int i5 = 0xFF & arrayOfByte[i4]; if (arrayOfInt[i5] == 0) { int i6 = i5 | i3 << 8; int i7 = this._inputPtr; this._inputPtr = (i7 + 1); int i8 = 0xFF & arrayOfByte[i7]; if (arrayOfInt[i8] == 0) { this._quad1 = i6; return parseMediumFieldName(i8, arrayOfInt); } if (i8 == 34) return findName(i6, 4); return parseFieldName(i6, i8, 4); } if (i5 == 34) return findName(i3, 3); return parseFieldName(i3, i5, 3); } if (i2 == 34) return findName(n, 2); return parseFieldName(n, i2, 2); } if (m == 34) return findName(j, 1); return parseFieldName(j, m, 1); } if (j == 34) return BytesToNameCanonicalizer.getEmptyName(); return parseFieldName(0, j, 0); }
protected final Name _parseFieldName(int paramInt) { if (paramInt != 34) return _handleUnusualFieldName(paramInt); if (9 + this._inputPtr > this._inputEnd) return slowParseFieldName(); byte[] arrayOfByte = this._inputBuffer; int[] arrayOfInt = sInputCodesLatin1; int i = this._inputPtr; this._inputPtr = (i + 1); int j = 0xFF & arrayOfByte[i]; if (arrayOfInt[j] == 0) { int k = this._inputPtr; this._inputPtr = (k + 1); int m = 0xFF & arrayOfByte[k]; if (arrayOfInt[m] == 0) { int n = m | j << 8; int i1 = this._inputPtr; this._inputPtr = (i1 + 1); int i2 = 0xFF & arrayOfByte[i1]; if (arrayOfInt[i2] == 0) { int i3 = i2 | n << 8; int i4 = this._inputPtr; this._inputPtr = (i4 + 1); int i5 = 0xFF & arrayOfByte[i4]; if (arrayOfInt[i5] == 0) { int i6 = i5 | i3 << 8; int i7 = this._inputPtr; this._inputPtr = (i7 + 1); int i8 = 0xFF & arrayOfByte[i7]; if (arrayOfInt[i8] == 0) { this._quad1 = i6; return parseMediumFieldName(i8, arrayOfInt); } if (i8 == 34) return findName(i6, 4); return parseFieldName(i6, i8, 4); } if (i5 == 34) return findName(i3, 3); return parseFieldName(i3, i5, 3); } if (i2 == 34) return findName(n, 2); return parseFieldName(n, i2, 2); } if (m == 34) return findName(j, 1); return parseFieldName(j, m, 1); } if (j == 34) return BytesToNameCanonicalizer.getEmptyName(); return parseFieldName(0, j, 0); }