public Integer getInt ( Integer defaultValue ) { if ( value instanceof Number ) { return ( ( Number ) value ) . intValue ( ) ; } if ( value instanceof String ) { String s = ( String ) value ; return Integer . parseInt ( s ) ; } if ( value == null ) { return defaultValue ; } throw createException ( "Expected integer:" ) ; }
Return an integer for current JSON value parsing string values as required .