You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accessing numeric value from JsonParser can be done either using typed accessors (getLongValue()) or using generic Number JsonParser.getNumberValue(). But in both of these cases access forces decoding of the actual numeric value.
But there are cases where it would be nice to only get actual Number if it has already been decoded; otherwise return String representation of the number.
Although there is no super nice way in Java to support "either" type, I think in this case it is fine to simply indicate type as Object and let caller do type-casting: main initial user will be TokenBuffer class in jackson-databind; and it will further use integer-or-floating-point distinction (wrt JsonParser.currentToken()) to figure out possible types.
Base implementation in JsonParser, for backwards compatibility, should be to simple call getNumberValue(), return that: subtypes that support deferred parsing then need to override this.