public Object jsonObject ( ) { if ( json == null ) { return null ; } if ( cached == null ) { Object tmp = null ; if ( json [ 0 ] == ' ' ) { tmp = new LazyJsonObject < String , Object > ( json ) ; } else if ( json [ 0 ] == ' ' ) { tmp = new LazyJsonArray < Object > ( json ) ; } else { try { // NOTE: This if-else condition is for Jackson 2.5.0 // json variable is byte[] which is from Cursor.getBlob(). // And json byte array is ended with '\0'. // '\0' causes parsing problem with Jackson 2.5.0 that we upgraded Feb 24, 2015. // We did not observe this problem with Jackson 1.9.2 that we used before. if ( json . length > 0 && json [ json . length - 1 ] == 0 ) { tmp = Manager . getObjectMapper ( ) . readValue ( json , 0 , json . length - 1 , Object . class ) ; } else { tmp = Manager . getObjectMapper ( ) . readValue ( json , Object . class ) ; } } catch ( Exception e ) { //cached will remain null Log . w ( Database . TAG , "Exception parsing json" , e ) ; } } cached = tmp ; } return cached ; }
values are requested