// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.fasterxml.jackson.databind.deser.std; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.jsontype.TypeDeserializer; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; import java.util.HashSet; // Referenced classes of package com.fasterxml.jackson.databind.deser.std: // StdScalarDeserializer public class NumberDeserializers { public static class BigDecimalDeserializer extends StdScalarDeserializer { public static final BigDecimalDeserializer instance = new BigDecimalDeserializer(); public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } public BigDecimal deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { jsonparser.getCurrentTokenId(); JVM INSTR tableswitch 3 8: default 44 // 3 105 // 4 44 // 5 44 // 6 64 // 7 57 // 8 57; goto _L1 _L2 _L1 _L1 _L3 _L4 _L4 _L1: throw deserializationcontext.mappingException(_valueClass, jsonparser.getCurrentToken()); _L4: Object obj = jsonparser.getDecimalValue(); _L6: return ((BigDecimal) (obj)); _L3: jsonparser = jsonparser.getText().trim(); if (jsonparser.length() == 0) { return null; } try { obj = new BigDecimal(jsonparser); } // Misplaced declaration of an exception variable catch (Object obj) { throw deserializationcontext.weirdStringException(jsonparser, _valueClass, "not a valid representation"); } return ((BigDecimal) (obj)); _L2: if (!deserializationcontext.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) { continue; /* Loop/switch isn't completed */ } jsonparser.nextToken(); obj = deserialize(jsonparser, deserializationcontext); if (jsonparser.nextToken() != JsonToken.END_ARRAY) { throw deserializationcontext.wrongTokenException(jsonparser, JsonToken.END_ARRAY, "Attempted to unwrap single value array for single 'BigDecimal' value but there was more than a single value in the array"); } if (true) goto _L6; else goto _L5 _L5: if (true) goto _L1; else goto _L7 _L7: } public BigDecimalDeserializer() { super(java/math/BigDecimal); } } public static class BigIntegerDeserializer extends StdScalarDeserializer { public static final BigIntegerDeserializer instance = new BigIntegerDeserializer(); public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } public BigInteger deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { jsonparser.getCurrentTokenId(); JVM INSTR tableswitch 3 8: default 44 // 3 132 // 4 44 // 5 44 // 6 175 // 7 57 // 8 106; goto _L1 _L2 _L1 _L1 _L3 _L4 _L5 _L7: throw deserializationcontext.mappingException(_valueClass, jsonparser.getCurrentToken()); _L4: static class _cls1 { static final int $SwitchMap$com$fasterxml$jackson$core$JsonParser$NumberType[]; static { $SwitchMap$com$fasterxml$jackson$core$JsonParser$NumberType = new int[com.fasterxml.jackson.core.JsonParser.NumberType.values().length]; try { $SwitchMap$com$fasterxml$jackson$core$JsonParser$NumberType[com.fasterxml.jackson.core.JsonParser.NumberType.INT.ordinal()] = 1; } catch (NoSuchFieldError nosuchfielderror2) { } try { $SwitchMap$com$fasterxml$jackson$core$JsonParser$NumberType[com.fasterxml.jackson.core.JsonParser.NumberType.LONG.ordinal()] = 2; } catch (NoSuchFieldError nosuchfielderror1) { } try { $SwitchMap$com$fasterxml$jackson$core$JsonParser$NumberType[com.fasterxml.jackson.core.JsonParser.NumberType.BIG_INTEGER.ordinal()] = 3; } catch (NoSuchFieldError nosuchfielderror) { return; } } } BigInteger biginteger; switch (_cls1..SwitchMap.com.fasterxml.jackson.core.JsonParser.NumberType[jsonparser.getNumberType().ordinal()]) { default: break; case 1: // '\001' case 2: // '\002' case 3: // '\003' biginteger = jsonparser.getBigIntegerValue(); break; /* Loop/switch isn't completed */ } _L1: if (true) goto _L7; else goto _L6 _L6: return biginteger; _L5: if (!deserializationcontext.isEnabled(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) { _failDoubleToIntCoercion(jsonparser, deserializationcontext, "java.math.BigInteger"); } return jsonparser.getDecimalValue().toBigInteger(); _L2: if (!deserializationcontext.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) goto _L7; else goto _L8 _L8: jsonparser.nextToken(); biginteger = deserialize(jsonparser, deserializationcontext); if (jsonparser.nextToken() == JsonToken.END_ARRAY) goto _L6; else goto _L9 _L9: throw deserializationcontext.wrongTokenException(jsonparser, JsonToken.END_ARRAY, "Attempted to unwrap single value array for single 'BigInteger' value but there was more than a single value in the array"); _L3: jsonparser = jsonparser.getText().trim(); if (jsonparser.length() == 0) { return null; } BigInteger biginteger1; try { biginteger1 = new BigInteger(jsonparser); } catch (IllegalArgumentException illegalargumentexception) { throw deserializationcontext.weirdStringException(jsonparser, _valueClass, "not a valid representation"); } return biginteger1; } public BigIntegerDeserializer() { super(java/math/BigInteger); } } public static final class BooleanDeserializer extends PrimitiveOrWrapperDeserializer { static final BooleanDeserializer primitiveInstance; private static final long serialVersionUID = 1L; static final BooleanDeserializer wrapperInstance = new BooleanDeserializer(java/lang/Boolean, null); public Boolean deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { return _parseBoolean(jsonparser, deserializationcontext); } public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } public Boolean deserializeWithType(JsonParser jsonparser, DeserializationContext deserializationcontext, TypeDeserializer typedeserializer) throws IOException { return _parseBoolean(jsonparser, deserializationcontext); } public volatile Object deserializeWithType(JsonParser jsonparser, DeserializationContext deserializationcontext, TypeDeserializer typedeserializer) throws IOException { return deserializeWithType(jsonparser, deserializationcontext, typedeserializer); } static { primitiveInstance = new BooleanDeserializer(Boolean.TYPE, Boolean.FALSE); } public BooleanDeserializer(Class class1, Boolean boolean1) { super(class1, boolean1); } } public static class ByteDeserializer extends PrimitiveOrWrapperDeserializer { static final ByteDeserializer primitiveInstance; private static final long serialVersionUID = 1L; static final ByteDeserializer wrapperInstance = new ByteDeserializer(java/lang/Byte, null); public Byte deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { return _parseByte(jsonparser, deserializationcontext); } public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } static { primitiveInstance = new ByteDeserializer(Byte.TYPE, Byte.valueOf((byte)0)); } public ByteDeserializer(Class class1, Byte byte1) { super(class1, byte1); } } public static class CharacterDeserializer extends PrimitiveOrWrapperDeserializer { static final CharacterDeserializer primitiveInstance; private static final long serialVersionUID = 1L; static final CharacterDeserializer wrapperInstance = new CharacterDeserializer(java/lang/Character, null); public Character deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { jsonparser.getCurrentTokenId(); JVM INSTR tableswitch 3 7: default 40 // 3 116 // 4 40 // 5 40 // 6 78 // 7 53; goto _L1 _L2 _L1 _L1 _L3 _L4 _L1: int i; throw deserializationcontext.mappingException(_valueClass, jsonparser.getCurrentToken()); _L4: if ((i = jsonparser.getIntValue()) >= 0 && i <= 65535) { return Character.valueOf((char)i); } continue; /* Loop/switch isn't completed */ _L3: String s = jsonparser.getText(); if (s.length() == 1) { return Character.valueOf(s.charAt(0)); } if (s.length() == 0) { return (Character)getEmptyValue(deserializationcontext); } continue; /* Loop/switch isn't completed */ _L2: if (deserializationcontext.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) { jsonparser.nextToken(); Character character = deserialize(jsonparser, deserializationcontext); if (jsonparser.nextToken() != JsonToken.END_ARRAY) { throw deserializationcontext.wrongTokenException(jsonparser, JsonToken.END_ARRAY, (new StringBuilder()).append("Attempted to unwrap single value array for single '").append(_valueClass.getName()).append("' value but there was more than a single value in the array").toString()); } else { return character; } } if (true) goto _L1; else goto _L5 _L5: } public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } static { primitiveInstance = new CharacterDeserializer(Character.TYPE, Character.valueOf('\0')); } public CharacterDeserializer(Class class1, Character character) { super(class1, character); } } public static class DoubleDeserializer extends PrimitiveOrWrapperDeserializer { static final DoubleDeserializer primitiveInstance; private static final long serialVersionUID = 1L; static final DoubleDeserializer wrapperInstance = new DoubleDeserializer(java/lang/Double, null); public Double deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { return _parseDouble(jsonparser, deserializationcontext); } public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } public Double deserializeWithType(JsonParser jsonparser, DeserializationContext deserializationcontext, TypeDeserializer typedeserializer) throws IOException { return _parseDouble(jsonparser, deserializationcontext); } public volatile Object deserializeWithType(JsonParser jsonparser, DeserializationContext deserializationcontext, TypeDeserializer typedeserializer) throws IOException { return deserializeWithType(jsonparser, deserializationcontext, typedeserializer); } static { primitiveInstance = new DoubleDeserializer(Double.TYPE, Double.valueOf(0.0D)); } public DoubleDeserializer(Class class1, Double double1) { super(class1, double1); } } public static class FloatDeserializer extends PrimitiveOrWrapperDeserializer { static final FloatDeserializer primitiveInstance; private static final long serialVersionUID = 1L; static final FloatDeserializer wrapperInstance = new FloatDeserializer(java/lang/Float, null); public Float deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { return _parseFloat(jsonparser, deserializationcontext); } public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } static { primitiveInstance = new FloatDeserializer(Float.TYPE, Float.valueOf(0.0F)); } public FloatDeserializer(Class class1, Float float1) { super(class1, float1); } } public static final class IntegerDeserializer extends PrimitiveOrWrapperDeserializer { static final IntegerDeserializer primitiveInstance; private static final long serialVersionUID = 1L; static final IntegerDeserializer wrapperInstance = new IntegerDeserializer(java/lang/Integer, null); public Integer deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { if (jsonparser.hasToken(JsonToken.VALUE_NUMBER_INT)) { return Integer.valueOf(jsonparser.getIntValue()); } else { return _parseInteger(jsonparser, deserializationcontext); } } public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } public Integer deserializeWithType(JsonParser jsonparser, DeserializationContext deserializationcontext, TypeDeserializer typedeserializer) throws IOException { if (jsonparser.hasToken(JsonToken.VALUE_NUMBER_INT)) { return Integer.valueOf(jsonparser.getIntValue()); } else { return _parseInteger(jsonparser, deserializationcontext); } } public volatile Object deserializeWithType(JsonParser jsonparser, DeserializationContext deserializationcontext, TypeDeserializer typedeserializer) throws IOException { return deserializeWithType(jsonparser, deserializationcontext, typedeserializer); } public boolean isCachable() { return true; } static { primitiveInstance = new IntegerDeserializer(Integer.TYPE, Integer.valueOf(0)); } public IntegerDeserializer(Class class1, Integer integer) { super(class1, integer); } } public static final class LongDeserializer extends PrimitiveOrWrapperDeserializer { static final LongDeserializer primitiveInstance; private static final long serialVersionUID = 1L; static final LongDeserializer wrapperInstance = new LongDeserializer(java/lang/Long, null); public Long deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { if (jsonparser.hasToken(JsonToken.VALUE_NUMBER_INT)) { return Long.valueOf(jsonparser.getLongValue()); } else { return _parseLong(jsonparser, deserializationcontext); } } public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } public boolean isCachable() { return true; } static { primitiveInstance = new LongDeserializer(Long.TYPE, Long.valueOf(0L)); } public LongDeserializer(Class class1, Long long1) { super(class1, long1); } } public static class NumberDeserializer extends StdScalarDeserializer { public static final NumberDeserializer instance = new NumberDeserializer(); public Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException { jsonparser.getCurrentTokenId(); JVM INSTR tableswitch 3 8: default 44 // 3 301 // 4 44 // 5 44 // 6 104 // 7 57 // 8 81; goto _L1 _L2 _L1 _L1 _L3 _L4 _L5 _L1: throw deserializationcontext.mappingException(_valueClass, jsonparser.getCurrentToken()); _L4: if (!deserializationcontext.hasSomeOfFeatures(F_MASK_INT_COERCIONS)) goto _L7; else goto _L6 _L6: Object obj = _coerceIntegral(jsonparser, deserializationcontext); _L9: return obj; _L7: return jsonparser.getNumberValue(); _L5: if (deserializationcontext.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)) { return jsonparser.getDecimalValue(); } else { return Double.valueOf(jsonparser.getDoubleValue()); } _L3: jsonparser = jsonparser.getText().trim(); if (jsonparser.length() == 0) { return getEmptyValue(deserializationcontext); } if (_hasTextualNull(jsonparser)) { return getNullValue(deserializationcontext); } if (_isPosInf(jsonparser)) { return Double.valueOf((1.0D / 0.0D)); } if (_isNegInf(jsonparser)) { return Double.valueOf((-1.0D / 0.0D)); } if (_isNaN(jsonparser)) { return Double.valueOf((0.0D / 0.0D)); } if (_isIntNumber(jsonparser)) { break MISSING_BLOCK_LABEL_235; } if (!deserializationcontext.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)) { break MISSING_BLOCK_LABEL_226; } obj = new BigDecimal(jsonparser); return obj; return new Double(jsonparser); long l; if (deserializationcontext.isEnabled(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS)) { return new BigInteger(jsonparser); } l = Long.parseLong(jsonparser); if (!deserializationcontext.isEnabled(DeserializationFeature.USE_LONG_FOR_INTS) && l <= 0x7fffffffL && l >= 0xffffffff80000000L) { try { return Integer.valueOf((int)l); } // Misplaced declaration of an exception variable catch (Object obj) { throw deserializationcontext.weirdStringException(jsonparser, _valueClass, "not a valid number"); } } else { return Long.valueOf(l); } _L2: if (!deserializationcontext.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) { continue; /* Loop/switch isn't completed */ } jsonparser.nextToken(); obj = deserialize(jsonparser, deserializationcontext); if (jsonparser.nextToken() != JsonToken.END_ARRAY) { throw deserializationcontext.wrongTokenException(jsonparser, JsonToken.END_ARRAY, (new StringBuilder()).append("Attempted to unwrap single value array for single '").append(_valueClass.getName()).append("' value but there was more than a single value in the array").toString()); } if (true) goto _L9; else goto _L8 _L8: if (true) goto _L1; else goto _L10 _L10: } public Object deserializeWithType(JsonParser jsonparser, DeserializationContext deserializationcontext, TypeDeserializer typedeserializer) throws IOException { switch (jsonparser.getCurrentTokenId()) { default: return typedeserializer.deserializeTypedFromScalar(jsonparser, deserializationcontext); case 6: // '\006' case 7: // '\007' case 8: // '\b' return deserialize(jsonparser, deserializationcontext); } } public NumberDeserializer() { super(java/lang/Number); } } protected static abstract class PrimitiveOrWrapperDeserializer extends StdScalarDeserializer { private static final long serialVersionUID = 1L; protected final Object _nullValue; protected final boolean _primitive; public final Object getNullValue() { return _nullValue; } public final Object getNullValue(DeserializationContext deserializationcontext) throws JsonMappingException { if (_primitive && deserializationcontext.isEnabled(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)) { throw deserializationcontext.mappingException("Can not map JSON null into type %s (set DeserializationConfig.DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES to 'false' to allow)", new Object[] { handledType().toString() }); } else { return _nullValue; } } protected PrimitiveOrWrapperDeserializer(Class class1, Object obj) { super(class1); _nullValue = obj; _primitive = class1.isPrimitive(); } } public static class ShortDeserializer extends PrimitiveOrWrapperDeserializer { static final ShortDeserializer primitiveInstance; private static final long serialVersionUID = 1L; static final ShortDeserializer wrapperInstance = new ShortDeserializer(java/lang/Short, null); public volatile Object deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return deserialize(jsonparser, deserializationcontext); } public Short deserialize(JsonParser jsonparser, DeserializationContext deserializationcontext) throws IOException, JsonProcessingException { return _parseShort(jsonparser, deserializationcontext); } static { primitiveInstance = new ShortDeserializer(Short.TYPE, Short.valueOf((short)0)); } public ShortDeserializer(Class class1, Short short1) { super(class1, short1); } } private static final HashSet _classNames; public NumberDeserializers() { } public static JsonDeserializer find(Class class1, String s) { if (class1.isPrimitive()) { if (class1 == Integer.TYPE) { return IntegerDeserializer.primitiveInstance; } if (class1 == Boolean.TYPE) { return BooleanDeserializer.primitiveInstance; } if (class1 == Long.TYPE) { return LongDeserializer.primitiveInstance; } if (class1 == Double.TYPE) { return DoubleDeserializer.primitiveInstance; } if (class1 == Character.TYPE) { return CharacterDeserializer.primitiveInstance; } if (class1 == Byte.TYPE) { return ByteDeserializer.primitiveInstance; } if (class1 == Short.TYPE) { return ShortDeserializer.primitiveInstance; } if (class1 == Float.TYPE) { return FloatDeserializer.primitiveInstance; } } else if (_classNames.contains(s)) { if (class1 == java/lang/Integer) { return IntegerDeserializer.wrapperInstance; } if (class1 == java/lang/Boolean) { return BooleanDeserializer.wrapperInstance; } if (class1 == java/lang/Long) { return LongDeserializer.wrapperInstance; } if (class1 == java/lang/Double) { return DoubleDeserializer.wrapperInstance; } if (class1 == java/lang/Character) { return CharacterDeserializer.wrapperInstance; } if (class1 == java/lang/Byte) { return ByteDeserializer.wrapperInstance; } if (class1 == java/lang/Short) { return ShortDeserializer.wrapperInstance; } if (class1 == java/lang/Float) { return FloatDeserializer.wrapperInstance; } if (class1 == java/lang/Number) { return NumberDeserializer.instance; } if (class1 == java/math/BigDecimal) { return BigDecimalDeserializer.instance; } if (class1 == java/math/BigInteger) { return BigIntegerDeserializer.instance; } } else { return null; } throw new IllegalArgumentException((new StringBuilder()).append("Internal error: can't find deserializer for ").append(class1.getName()).toString()); } static { _classNames = new HashSet(); Class aclass[] = new Class[11]; aclass[0] = java/lang/Boolean; aclass[1] = java/lang/Byte; aclass[2] = java/lang/Short; aclass[3] = java/lang/Character; aclass[4] = java/lang/Integer; aclass[5] = java/lang/Long; aclass[6] = java/lang/Float; aclass[7] = java/lang/Double; aclass[8] = java/lang/Number; aclass[9] = java/math/BigDecimal; aclass[10] = java/math/BigInteger; int j = aclass.length; for (int i = 0; i < j; i++) { Class class1 = aclass[i]; _classNames.add(class1.getName()); } } }