当前位置: 首页>>代码示例>>Java>>正文


Java BytesToNameCanonicalizer类代码示例

本文整理汇总了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();
}
 
开发者ID:BFergerson,项目名称:Beam,代码行数:21,代码来源:SmileParser.java

示例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;
}
 
开发者ID:BFergerson,项目名称:Beam,代码行数:18,代码来源:NonBlockingParserImpl.java

示例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));
}
 
开发者ID:BFergerson,项目名称:Beam,代码行数:20,代码来源:ByteSourceJsonBootstrapper.java

示例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));
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:20,代码来源:ByteSourceJsonBootstrapper.java

示例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;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:12,代码来源:UTF8StreamJsonParser.java

示例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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:13,代码来源:UTF8StreamJsonParser.java

示例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));
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:10,代码来源:ByteSourceJsonBootstrapper.java

示例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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:60,代码来源:UTF8StreamJsonParser.java

示例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;
}
 
开发者ID:BFergerson,项目名称:Beam,代码行数:42,代码来源:SmileParserBootstrapper.java

示例10: getRootByteSymbols

import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
/**
 * Needed by jackson's internal utf8 stream parser.
 */
public BytesToNameCanonicalizer getRootByteSymbols()
{
    return _rootByteSymbols;
}
 
开发者ID:BFergerson,项目名称:Beam,代码行数:8,代码来源:SmileIOUtil.java

示例11: getRootByteSymbols

import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; //导入依赖的package包/类
/**
 * Needed by jackson's internal utf8 strema parser.
 */
public BytesToNameCanonicalizer getRootByteSymbols()
{
    return _rootByteSymbols;
}
 
开发者ID:BFergerson,项目名称:Beam,代码行数:8,代码来源:JsonIOUtil.java


注:本文中的com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。