protected Object _createFromStringFallbacks(DeserializationContext ctxt, String value) throws IOException, JsonProcessingException { /* 28-Sep-2011, tatu: Ok this is not clean at all; but since there are legacy * systems that expect conversions in some cases, let's just add a minimal * patch (note: same could conceivably be used for numbers too). */ if (_fromBooleanCreator != null) { String str = value.trim(); if ("true".equals(str)) { return createFromBoolean(ctxt, true); } if ("false".equals(str)) { return createFromBoolean(ctxt, false); } } // and finally, empty Strings might be accepted as null Object... if (_cfgEmptyStringsAsObjects && value.length() == 0) { return null; } throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc() +" from JSON String; no single-String constructor/factory method"); }
protected Object _createFromStringFallbacks(DeserializationContext ctxt, String value) throws IOException, JsonProcessingException { /* 28-Sep-2011, tatu: Ok this is not clean at all; but since there are legacy * systems that expect conversions in some cases, let's just add a minimal * patch (note: same could conceivably be used for numbers too). */ if (_fromBooleanCreator != null) { String str = value.trim(); if ("true".equals(str)) { return createFromBoolean(ctxt, true); } if ("false".equals(str)) { return createFromBoolean(ctxt, false); } } // and finally, empty Strings might be accepted as null Object... if (_cfgEmptyStringsAsObjects && value.length() == 0) { return null; } throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc() +" from String value; no single-String constructor/factory method"); }