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


Java JsonToken.VALUE_NUMBER_FLOAT属性代码示例

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


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

示例1: deserialize

public BigDecimal deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  JsonToken localJsonToken = paramJsonParser.getCurrentToken();
  if ((localJsonToken == JsonToken.VALUE_NUMBER_INT) || (localJsonToken == JsonToken.VALUE_NUMBER_FLOAT))
    return paramJsonParser.getDecimalValue();
  if (localJsonToken == JsonToken.VALUE_STRING)
  {
    String str = paramJsonParser.getText().trim();
    if (str.length() == 0)
      return null;
    try
    {
      BigDecimal localBigDecimal = new BigDecimal(str);
      return localBigDecimal;
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw paramDeserializationContext.weirdStringException(this._valueClass, "not a valid representation");
    }
  }
  throw paramDeserializationContext.mappingException(this._valueClass);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:23,代码来源:StdDeserializer.java

示例2: _parseLong

protected final Long _parseLong(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  JsonToken localJsonToken1 = paramJsonParser.getCurrentToken();
  Long localLong1;
  if ((localJsonToken1 == JsonToken.VALUE_NUMBER_INT) || (localJsonToken1 == JsonToken.VALUE_NUMBER_FLOAT))
    localLong1 = Long.valueOf(paramJsonParser.getLongValue());
  JsonToken localJsonToken2;
  do
  {
    while (true)
    {
      return localLong1;
      if (localJsonToken1 != JsonToken.VALUE_STRING)
        break;
      String str = paramJsonParser.getText().trim();
      int i = str.length();
      localLong1 = null;
      if (i == 0)
        continue;
      try
      {
        Long localLong2 = Long.valueOf(NumberInput.parseLong(str));
        return localLong2;
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        throw paramDeserializationContext.weirdStringException(this._valueClass, "not a valid Long value");
      }
    }
    localJsonToken2 = JsonToken.VALUE_NULL;
    localLong1 = null;
  }
  while (localJsonToken1 == localJsonToken2);
  throw paramDeserializationContext.mappingException(this._valueClass);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:36,代码来源:StdDeserializer.java

示例3: _parseLongPrimitive

protected final long _parseLongPrimitive(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  long l1 = 0L;
  JsonToken localJsonToken = paramJsonParser.getCurrentToken();
  if ((localJsonToken == JsonToken.VALUE_NUMBER_INT) || (localJsonToken == JsonToken.VALUE_NUMBER_FLOAT))
    l1 = paramJsonParser.getLongValue();
  do
    while (true)
    {
      return l1;
      if (localJsonToken != JsonToken.VALUE_STRING)
        break;
      String str = paramJsonParser.getText().trim();
      if (str.length() == 0)
        continue;
      try
      {
        long l2 = NumberInput.parseLong(str);
        return l2;
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        throw paramDeserializationContext.weirdStringException(this._valueClass, "not a valid long value");
      }
    }
  while (localJsonToken == JsonToken.VALUE_NULL);
  throw paramDeserializationContext.mappingException(this._valueClass);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:29,代码来源:StdDeserializer.java

示例4: _parseShort

protected final Short _parseShort(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  JsonToken localJsonToken = paramJsonParser.getCurrentToken();
  if (localJsonToken == JsonToken.VALUE_NULL)
    return null;
  if ((localJsonToken == JsonToken.VALUE_NUMBER_INT) || (localJsonToken == JsonToken.VALUE_NUMBER_FLOAT))
    return Short.valueOf(paramJsonParser.getShortValue());
  int i = _parseIntPrimitive(paramJsonParser, paramDeserializationContext);
  if ((i < -32768) || (i > 32767))
    throw paramDeserializationContext.weirdStringException(this._valueClass, "overflow, value can not be represented as 16-bit value");
  return Short.valueOf((short)i);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:13,代码来源:StdDeserializer.java

示例5: handleNonArray

private final byte[] handleNonArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (!paramDeserializationContext.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY))
    throw paramDeserializationContext.mappingException(this._valueClass);
  JsonToken localJsonToken = paramJsonParser.getCurrentToken();
  if ((localJsonToken == JsonToken.VALUE_NUMBER_INT) || (localJsonToken == JsonToken.VALUE_NUMBER_FLOAT));
  for (int i = paramJsonParser.getByteValue(); ; i = 0)
  {
    return new byte[] { i };
    if (localJsonToken == JsonToken.VALUE_NULL)
      continue;
    throw paramDeserializationContext.mappingException(this._valueClass.getComponentType());
  }
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:15,代码来源:ArrayDeserializers.java

示例6: resetAsNaN

protected final JsonToken resetAsNaN(String paramString, double paramDouble)
{
  this._textBuffer.resetWithString(paramString);
  this._numberDouble = paramDouble;
  this._numTypesValid = 8;
  return JsonToken.VALUE_NUMBER_FLOAT;
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:7,代码来源:JsonNumericParserBase.java

示例7: resetFloat

protected final JsonToken resetFloat(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3)
{
  this._numberNegative = paramBoolean;
  this._intLength = paramInt1;
  this._fractLength = paramInt2;
  this._expLength = paramInt3;
  this._numTypesValid = 0;
  return JsonToken.VALUE_NUMBER_FLOAT;
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:9,代码来源:JsonNumericParserBase.java

示例8: _parseDouble

protected final Double _parseDouble(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  JsonToken localJsonToken1 = paramJsonParser.getCurrentToken();
  Double localDouble1;
  if ((localJsonToken1 == JsonToken.VALUE_NUMBER_INT) || (localJsonToken1 == JsonToken.VALUE_NUMBER_FLOAT))
    localDouble1 = Double.valueOf(paramJsonParser.getDoubleValue());
  JsonToken localJsonToken2;
  do
  {
    while (true)
    {
      return localDouble1;
      if (localJsonToken1 != JsonToken.VALUE_STRING)
        break;
      String str = paramJsonParser.getText().trim();
      int i = str.length();
      localDouble1 = null;
      if (i == 0)
        continue;
      switch (str.charAt(0))
      {
      default:
      case 'I':
      case 'N':
      case '-':
      }
      try
      {
        do
        {
          do
          {
            do
            {
              Double localDouble2 = Double.valueOf(parseDouble(str));
              return localDouble2;
            }
            while ((!"Infinity".equals(str)) && (!"INF".equals(str)));
            return Double.valueOf((1.0D / 0.0D));
          }
          while (!"NaN".equals(str));
          return Double.valueOf((0.0D / 0.0D));
        }
        while ((!"-Infinity".equals(str)) && (!"-INF".equals(str)));
        return Double.valueOf((-1.0D / 0.0D));
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        throw paramDeserializationContext.weirdStringException(this._valueClass, "not a valid Double value");
      }
    }
    localJsonToken2 = JsonToken.VALUE_NULL;
    localDouble1 = null;
  }
  while (localJsonToken1 == localJsonToken2);
  throw paramDeserializationContext.mappingException(this._valueClass);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:58,代码来源:StdDeserializer.java

示例9: _parseDoublePrimitive

protected final double _parseDoublePrimitive(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  double d1 = 0.0D;
  JsonToken localJsonToken = paramJsonParser.getCurrentToken();
  if ((localJsonToken == JsonToken.VALUE_NUMBER_INT) || (localJsonToken == JsonToken.VALUE_NUMBER_FLOAT))
    d1 = paramJsonParser.getDoubleValue();
  do
    while (true)
    {
      return d1;
      if (localJsonToken != JsonToken.VALUE_STRING)
        break;
      String str = paramJsonParser.getText().trim();
      if (str.length() == 0)
        continue;
      switch (str.charAt(0))
      {
      default:
      case 'I':
      case 'N':
      case '-':
      }
      try
      {
        do
        {
          do
          {
            do
            {
              double d2 = parseDouble(str);
              return d2;
            }
            while ((!"Infinity".equals(str)) && (!"INF".equals(str)));
            return (1.0D / 0.0D);
          }
          while (!"NaN".equals(str));
          return (0.0D / 0.0D);
        }
        while ((!"-Infinity".equals(str)) && (!"-INF".equals(str)));
        return (-1.0D / 0.0D);
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        throw paramDeserializationContext.weirdStringException(this._valueClass, "not a valid double value");
      }
    }
  while (localJsonToken == JsonToken.VALUE_NULL);
  throw paramDeserializationContext.mappingException(this._valueClass);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:51,代码来源:StdDeserializer.java

示例10: _parseFloat

protected final Float _parseFloat(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  JsonToken localJsonToken1 = paramJsonParser.getCurrentToken();
  Float localFloat1;
  if ((localJsonToken1 == JsonToken.VALUE_NUMBER_INT) || (localJsonToken1 == JsonToken.VALUE_NUMBER_FLOAT))
    localFloat1 = Float.valueOf(paramJsonParser.getFloatValue());
  JsonToken localJsonToken2;
  do
  {
    while (true)
    {
      return localFloat1;
      if (localJsonToken1 != JsonToken.VALUE_STRING)
        break;
      String str = paramJsonParser.getText().trim();
      int i = str.length();
      localFloat1 = null;
      if (i == 0)
        continue;
      switch (str.charAt(0))
      {
      default:
      case 'I':
      case 'N':
      case '-':
      }
      try
      {
        do
        {
          do
          {
            do
            {
              Float localFloat2 = Float.valueOf(Float.parseFloat(str));
              return localFloat2;
            }
            while ((!"Infinity".equals(str)) && (!"INF".equals(str)));
            return Float.valueOf((1.0F / 1.0F));
          }
          while (!"NaN".equals(str));
          return Float.valueOf((0.0F / 0.0F));
        }
        while ((!"-Infinity".equals(str)) && (!"-INF".equals(str)));
        return Float.valueOf((1.0F / -1.0F));
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        throw paramDeserializationContext.weirdStringException(this._valueClass, "not a valid Float value");
      }
    }
    localJsonToken2 = JsonToken.VALUE_NULL;
    localFloat1 = null;
  }
  while (localJsonToken1 == localJsonToken2);
  throw paramDeserializationContext.mappingException(this._valueClass);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:58,代码来源:StdDeserializer.java

示例11: _parseFloatPrimitive

protected final float _parseFloatPrimitive(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  JsonToken localJsonToken1 = paramJsonParser.getCurrentToken();
  float f1;
  if ((localJsonToken1 == JsonToken.VALUE_NUMBER_INT) || (localJsonToken1 == JsonToken.VALUE_NUMBER_FLOAT))
    f1 = paramJsonParser.getFloatValue();
  JsonToken localJsonToken2;
  do
  {
    while (true)
    {
      return f1;
      if (localJsonToken1 != JsonToken.VALUE_STRING)
        break;
      String str = paramJsonParser.getText().trim();
      int i = str.length();
      f1 = 0.0F;
      if (i == 0)
        continue;
      switch (str.charAt(0))
      {
      default:
      case 'I':
      case 'N':
      case '-':
      }
      try
      {
        do
        {
          do
          {
            do
            {
              float f2 = Float.parseFloat(str);
              return f2;
            }
            while ((!"Infinity".equals(str)) && (!"INF".equals(str)));
            return (1.0F / 1.0F);
          }
          while (!"NaN".equals(str));
          return (0.0F / 0.0F);
        }
        while ((!"-Infinity".equals(str)) && (!"-INF".equals(str)));
        return (1.0F / -1.0F);
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        throw paramDeserializationContext.weirdStringException(this._valueClass, "not a valid float value");
      }
    }
    localJsonToken2 = JsonToken.VALUE_NULL;
    f1 = 0.0F;
  }
  while (localJsonToken1 == localJsonToken2);
  throw paramDeserializationContext.mappingException(this._valueClass);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:58,代码来源:StdDeserializer.java

示例12: deserialize

public byte[] deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  JsonToken localJsonToken1 = paramJsonParser.getCurrentToken();
  if (localJsonToken1 == JsonToken.VALUE_STRING)
    return paramJsonParser.getBinaryValue(paramDeserializationContext.getBase64Variant());
  if (localJsonToken1 == JsonToken.VALUE_EMBEDDED_OBJECT)
  {
    Object localObject = paramJsonParser.getEmbeddedObject();
    if (localObject == null)
      return null;
    if ((localObject instanceof byte[]))
      return (byte[])(byte[])localObject;
  }
  if (!paramJsonParser.isExpectedStartArrayToken())
    return handleNonArray(paramJsonParser, paramDeserializationContext);
  ArrayBuilders.ByteBuilder localByteBuilder = paramDeserializationContext.getArrayBuilders().getByteBuilder();
  byte[] arrayOfByte = (byte[])localByteBuilder.resetAndStart();
  int i = 0;
  JsonToken localJsonToken2 = paramJsonParser.nextToken();
  if (localJsonToken2 != JsonToken.END_ARRAY)
  {
    if ((localJsonToken2 == JsonToken.VALUE_NUMBER_INT) || (localJsonToken2 == JsonToken.VALUE_NUMBER_FLOAT));
    for (int j = paramJsonParser.getByteValue(); ; j = 0)
    {
      if (i >= arrayOfByte.length)
      {
        arrayOfByte = (byte[])localByteBuilder.appendCompletedChunk(arrayOfByte, i);
        i = 0;
      }
      int k = i + 1;
      arrayOfByte[i] = j;
      i = k;
      break;
      if (localJsonToken2 == JsonToken.VALUE_NULL)
        continue;
      throw paramDeserializationContext.mappingException(this._valueClass.getComponentType());
    }
  }
  return (byte[])localByteBuilder.completeAndClearBuffer(arrayOfByte, i);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:41,代码来源:ArrayDeserializers.java

示例13: _parseNumericValue

protected void _parseNumericValue(int paramInt)
  throws IOException, JsonParseException
{
  if (this._currToken == JsonToken.VALUE_NUMBER_INT)
  {
    char[] arrayOfChar = this._textBuffer.getTextBuffer();
    int i = this._textBuffer.getTextOffset();
    int j = this._intLength;
    if (this._numberNegative)
      i++;
    if (j <= 9)
    {
      int k = NumberInput.parseInt(arrayOfChar, i, j);
      if (this._numberNegative)
        k = -k;
      this._numberInt = k;
      this._numTypesValid = 1;
      return;
    }
    if (j <= 18)
    {
      long l = NumberInput.parseLong(arrayOfChar, i, j);
      if (this._numberNegative)
        l = -l;
      if (j == 10)
        if (this._numberNegative)
        {
          if (l >= -2147483648L)
          {
            this._numberInt = (int)l;
            this._numTypesValid = 1;
            return;
          }
        }
        else if (l <= 2147483647L)
        {
          this._numberInt = (int)l;
          this._numTypesValid = 1;
          return;
        }
      this._numberLong = l;
      this._numTypesValid = 2;
      return;
    }
    _parseSlowIntValue(paramInt, arrayOfChar, i, j);
    return;
  }
  if (this._currToken == JsonToken.VALUE_NUMBER_FLOAT)
  {
    _parseSlowFloatValue(paramInt);
    return;
  }
  _reportError("Current token (" + this._currToken + ") not numeric, can not use numeric value accessors");
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:54,代码来源:JsonNumericParserBase.java

示例14: asToken

public JsonToken asToken()
{
  return JsonToken.VALUE_NUMBER_FLOAT;
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:4,代码来源:DecimalNode.java


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