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


Java JsonEncoding.UTF8属性代码示例

本文整理汇总了Java中org.codehaus.jackson.JsonEncoding.UTF8属性的典型用法代码示例。如果您正苦于以下问题:Java JsonEncoding.UTF8属性的具体用法?Java JsonEncoding.UTF8怎么用?Java JsonEncoding.UTF8使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.codehaus.jackson.JsonEncoding的用法示例。


在下文中一共展示了JsonEncoding.UTF8属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getJsonEncoding

protected JsonEncoding getJsonEncoding(MediaType contentType) {
    if(contentType != null && contentType.getCharSet() != null) {
        Charset charset = contentType.getCharSet();
        JsonEncoding[] var3 = JsonEncoding.values();
        int var4 = var3.length;

        for(int var5 = 0; var5 < var4; ++var5) {
            JsonEncoding encoding = var3[var5];
            if(charset.name().equals(encoding.getJavaName())) {
                return encoding;
            }
        }
    }

    return JsonEncoding.UTF8;
}
 
开发者ID:autumnkuang,项目名称:nenlvse1.0,代码行数:16,代码来源:CustomMappingJacksonJsonpView.java

示例2: getJsonEncoding

/**
 * Determine the JSON encoding to use for the given content type.
 * @param contentType the media type as requested by the caller
 * @return the JSON encoding to use (never {@code null})
 */
protected JsonEncoding getJsonEncoding(MediaType contentType) {
	if (contentType != null && contentType.getCharSet() != null) {
		Charset charset = contentType.getCharSet();
		for (JsonEncoding encoding : JsonEncoding.values()) {
			if (charset.name().equals(encoding.getJavaName())) {
				return encoding;
			}
		}
	}
	return JsonEncoding.UTF8;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:MappingJacksonHttpMessageConverter.java

示例3: getJsonEncoding

/**
 * Determine the JSON encoding to use for the given content type.
 * @param contentType the media type as requested by the caller
 * @return the JSON encoding to use (never <code>null</code>)
 */
protected JsonEncoding getJsonEncoding(MediaType contentType) {
	if (contentType != null && contentType.getCharSet() != null) {
		Charset charset = contentType.getCharSet();
		for (JsonEncoding encoding : JsonEncoding.values()) {
			if (charset.name().equals(encoding.getJavaName())) {
				return encoding;
			}
		}
	}
	return JsonEncoding.UTF8;
}
 
开发者ID:bestarandyan,项目名称:ShoppingMall,代码行数:16,代码来源:MappingJacksonHttpMessageConverter.java

示例4: getEncoding

private JsonEncoding getEncoding(MediaType contentType) {
	if (contentType != null && contentType.getCharSet() != null) {
		Charset charset = contentType.getCharSet();
		for (JsonEncoding encoding : JsonEncoding.values()) {
			if (charset.name().equals(encoding.getJavaName())) {
				return encoding;
			}
		}
	}
	return JsonEncoding.UTF8;
}
 
开发者ID:Appverse,项目名称:appverse-server,代码行数:11,代码来源:CustomMappingJacksonHttpMessageConverter.java

示例5: getJsonEncoding

/**
 * <br>
 * 2013-10-25 下午12:29:58
 *
 * @param characterEncoding
 * @return
 */
private JsonEncoding getJsonEncoding(String characterEncoding) {
    for (JsonEncoding encoding : JsonEncoding.values()) {
        if (characterEncoding.equals(encoding.getJavaName())) {
            return encoding;
        }
    }
    return JsonEncoding.UTF8;
}
 
开发者ID:blademainer,项目名称:common_utils,代码行数:15,代码来源:Jackson1JavassistFilterPropertyHandler.java

示例6: constructParser

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));
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:13,代码来源:ByteSourceBootstrapper.java

示例7: getJsonEncoding

protected JsonEncoding getJsonEncoding(MediaType contentType)
{
  if ((contentType != null) && (contentType.getCharSet() != null)) {
    Charset charset = contentType.getCharSet();
    for (JsonEncoding encoding : JsonEncoding.values()) {
      if (charset.name().equals(encoding.getJavaName())) {
        return encoding;
      }
    }
  }
  return JsonEncoding.UTF8;
}
 
开发者ID:youngor,项目名称:openclouddb,代码行数:12,代码来源:MappingJacksonHttpMessageConverter.java

示例8: constructParser

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));
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:12,代码来源:ByteSourceBootstrapper.java

示例9: detectEncoding

public JsonEncoding detectEncoding()
  throws IOException, JsonParseException
{
  int j;
  int i;
  if (ensureLoaded(4))
  {
    j = this._inputBuffer[this._inputPtr] << 24 | (0xFF & this._inputBuffer[(1 + this._inputPtr)]) << 16 | (0xFF & this._inputBuffer[(2 + this._inputPtr)]) << 8 | 0xFF & this._inputBuffer[(3 + this._inputPtr)];
    if (handleBOM(j))
      i = 1;
  }
  JsonEncoding localJsonEncoding;
  while (i == 0)
  {
    localJsonEncoding = JsonEncoding.UTF8;
    this._context.setEncoding(localJsonEncoding);
    return localJsonEncoding;
    if (checkUTF32(j))
    {
      i = 1;
      continue;
    }
    boolean bool3 = checkUTF16(j >>> 16);
    i = 0;
    if (!bool3)
      continue;
    i = 1;
    continue;
    boolean bool1 = ensureLoaded(2);
    i = 0;
    if (!bool1)
      continue;
    boolean bool2 = checkUTF16((0xFF & this._inputBuffer[this._inputPtr]) << 8 | 0xFF & this._inputBuffer[(1 + this._inputPtr)]);
    i = 0;
    if (!bool2)
      continue;
    i = 1;
  }
  if (this._bytesPerChar == 2)
  {
    if (this._bigEndian);
    for (localJsonEncoding = JsonEncoding.UTF16_BE; ; localJsonEncoding = JsonEncoding.UTF16_LE)
      break;
  }
  if (this._bytesPerChar == 4)
  {
    if (this._bigEndian);
    for (localJsonEncoding = JsonEncoding.UTF32_BE; ; localJsonEncoding = JsonEncoding.UTF32_LE)
      break;
  }
  throw new RuntimeException("Internal error");
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:52,代码来源:ByteSourceBootstrapper.java

示例10: detectEncoding

public final JsonEncoding detectEncoding()
{
  int i = 1;
  int j;
  JsonEncoding localJsonEncoding;
  if (ensureLoaded(4))
  {
    j = this._inputBuffer[this._inputPtr] << 24 | (0xFF & this._inputBuffer[(1 + this._inputPtr)]) << 16 | (0xFF & this._inputBuffer[(2 + this._inputPtr)]) << 8 | 0xFF & this._inputBuffer[(3 + this._inputPtr)];
    if (handleBOM(j))
    {
      if (i != 0)
        break label177;
      localJsonEncoding = JsonEncoding.UTF8;
    }
  }
  while (true)
  {
    this._context.setEncoding(localJsonEncoding);
    return localJsonEncoding;
    if ((checkUTF32(j)) || (checkUTF16(j >>> 16)))
      break;
    do
    {
      i = 0;
      break;
    }
    while ((!ensureLoaded(2)) || (!checkUTF16((0xFF & this._inputBuffer[this._inputPtr]) << 8 | 0xFF & this._inputBuffer[(1 + this._inputPtr)])));
    break;
    label177: switch (this._bytesPerChar)
    {
    case 3:
    default:
      throw new RuntimeException("Internal error");
    case 1:
      localJsonEncoding = JsonEncoding.UTF8;
      break;
    case 2:
      if (this._bigEndian)
        localJsonEncoding = JsonEncoding.UTF16_BE;
      else
        localJsonEncoding = JsonEncoding.UTF16_LE;
      break;
    case 4:
      if (this._bigEndian)
        localJsonEncoding = JsonEncoding.UTF32_BE;
      else
        localJsonEncoding = JsonEncoding.UTF32_LE;
      break;
    }
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:51,代码来源:ByteSourceBootstrapper.java


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