static Map < String , Object > parseMap ( AbstractContext context , JsonParser parser , Map < String , Object > map , boolean skipRead ) { try { String key ; Object value ; if ( ! skipRead ) { parser . nextToken ( ) ; } if ( parser . currentToken ( ) != JsonToken . START_OBJECT ) { throw ( new KriptonRuntimeException ( "Invalid input format" ) ) ; } skipRead = false ; do { if ( skipRead ) { key = parser . getCurrentName ( ) ; } else { key = parser . nextFieldName ( ) ; skipRead = true ; } JsonToken token = parser . nextToken ( ) ; switch ( token ) { case START_ARRAY : // parse array value = parseList ( context , parser , new ArrayList < Object > ( ) , true ) ; break ; case VALUE_EMBEDDED_OBJECT : // parse submap value = parseMap ( context , parser , new LinkedHashMap < String , Object > ( ) , true ) ; break ; default : // parser.nextValue(); value = parser . getValueAsString ( ) ; } // value = parser.getText(); map . put ( key , value ) ; } while ( parser . nextToken ( ) != JsonToken . END_OBJECT ) ; return map ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw ( new KriptonRuntimeException ( e ) ) ; } }
Parse map .