本文整理汇总了Java中com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer类的典型用法代码示例。如果您正苦于以下问题:Java BytesToNameCanonicalizer类的具体用法?Java BytesToNameCanonicalizer怎么用?Java BytesToNameCanonicalizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BytesToNameCanonicalizer类属于com.fasterxml.jackson.core.sym包,在下文中一共展示了BytesToNameCanonicalizer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SmileParser
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
public SmileParser(IOContext ctxt, int parserFeatures, int smileFeatures,
ObjectCodec codec,
BytesToNameCanonicalizer sym,
InputStream in, byte[] inputBuffer, int start, int end,
boolean bufferRecyclable)
{
super(ctxt, parserFeatures);
_objectCodec = codec;
_symbols = sym;
_inputStream = in;
_inputBuffer = inputBuffer;
_inputPtr = start;
_inputEnd = end;
_bufferRecyclable = bufferRecyclable;
_tokenInputRow = -1;
_tokenInputCol = -1;
_smileBufferRecycler = _smileBufferRecycler();
}
示例2: NonBlockingParserImpl
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
public NonBlockingParserImpl(IOContext ctxt, int parserFeatures, int smileFeatures,
ObjectCodec codec, BytesToNameCanonicalizer sym)
{
super(ctxt, parserFeatures);
_objectCodec = codec;
_symbols = sym;
_tokenInputRow = -1;
_tokenInputCol = -1;
_smileBufferRecycler = _smileBufferRecycler();
_currToken = JsonToken.NOT_AVAILABLE;
_state = STATE_INITIAL;
_tokenIncomplete = true;
_cfgRequireHeader = (smileFeatures & SmileParser.Feature.REQUIRE_HEADER.getMask()) != 0;
}
示例3: constructParser
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
public JsonParser constructParser(int parserFeatures, ObjectCodec codec,
BytesToNameCanonicalizer rootByteSymbols, CharsToNameCanonicalizer rootCharSymbols,
boolean canonicalize, boolean intern)
throws IOException
{
JsonEncoding enc = detectEncoding();
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 UTF8StreamJsonParser(_context, parserFeatures, _in, codec, can, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
}
}
return new ReaderBasedJsonParser(_context, parserFeatures, constructReader(), codec,
rootCharSymbols.makeChild(canonicalize, intern));
}
示例4: constructParser
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
public JsonParser constructParser(int parserFeatures, ObjectCodec codec,
BytesToNameCanonicalizer rootByteSymbols, CharsToNameCanonicalizer rootCharSymbols,
boolean canonicalize, boolean intern)
throws IOException, JsonParseException
{
JsonEncoding enc = detectEncoding();
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 UTF8StreamJsonParser(_context, parserFeatures, _in, codec, can, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
}
}
return new ReaderBasedJsonParser(_context, parserFeatures, constructReader(), codec,
rootCharSymbols.makeChild(canonicalize, intern));
}
示例5: UTF8StreamJsonParser
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
public UTF8StreamJsonParser(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;
}
示例6: slowParseFieldName
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
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);
}
示例7: constructParser
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
public final JsonParser constructParser(int paramInt, ObjectCodec paramObjectCodec, BytesToNameCanonicalizer paramBytesToNameCanonicalizer, CharsToNameCanonicalizer paramCharsToNameCanonicalizer, boolean paramBoolean1, boolean paramBoolean2)
{
if ((detectEncoding() == JsonEncoding.UTF8) && (paramBoolean1))
{
BytesToNameCanonicalizer localBytesToNameCanonicalizer = paramBytesToNameCanonicalizer.makeChild(paramBoolean1, paramBoolean2);
return new UTF8StreamJsonParser(this._context, paramInt, this._in, paramObjectCodec, localBytesToNameCanonicalizer, this._inputBuffer, this._inputPtr, this._inputEnd, this._bufferRecyclable);
}
return new ReaderBasedJsonParser(this._context, paramInt, constructReader(), paramObjectCodec, paramCharsToNameCanonicalizer.makeChild(paramBoolean1, paramBoolean2));
}
示例8: _parseFieldName
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
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);
}
示例9: constructParser
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
public SmileParser constructParser(int generalParserFeatures, int smileFeatures,
boolean internNames,
ObjectCodec codec, BytesToNameCanonicalizer rootByteSymbols)
throws IOException, JsonParseException
{
BytesToNameCanonicalizer can = rootByteSymbols.makeChild(true, internNames);
// We just need a single byte, really, to know if it starts with header
ensureLoaded(1);
SmileParser p = new SmileParser(_context, generalParserFeatures, smileFeatures,
codec, can,
_in, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
boolean hadSig = false;
if (_inputPtr < _inputEnd) { // only false for empty doc
if (_inputBuffer[_inputPtr] == SmileConstants.HEADER_BYTE_1) {
// need to ensure it gets properly handled so caller won't see the signature
hadSig = p.handleSignature(true, true);
}
} else {
/* 11-Oct-2012, tatu: Actually, let's allow empty documents even if
* header signature would otherwise be needed. This is useful for
* JAX-RS provider, empty PUT/POST payloads.
*/
return p;
}
if (!hadSig && (smileFeatures & SmileParser.Feature.REQUIRE_HEADER.getMask()) != 0) {
// Ok, first, let's see if it looks like plain JSON...
String msg;
byte firstByte = (_inputPtr < _inputEnd) ? _inputBuffer[_inputPtr] : 0;
if (firstByte == '{' || firstByte == '[') {
msg = "Input does not start with Smile format header (first byte = 0x"
+Integer.toHexString(firstByte & 0xFF)+") -- rather, it starts with '"+((char) firstByte)
+"' (plain JSON input?) -- can not parse";
} else {
msg = "Input does not start with Smile format header (first byte = 0x"
+Integer.toHexString(firstByte & 0xFF)+") and parser has REQUIRE_HEADER enabled: can not parse";
}
throw new JsonParseException(msg, JsonLocation.NA);
}
return p;
}
示例10: getRootByteSymbols
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
/**
* Needed by jackson's internal utf8 stream parser.
*/
public BytesToNameCanonicalizer getRootByteSymbols()
{
return _rootByteSymbols;
}
示例11: getRootByteSymbols
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
/**
* Needed by jackson's internal utf8 strema parser.
*/
public BytesToNameCanonicalizer getRootByteSymbols()
{
return _rootByteSymbols;
}