protected static List < String > parseMandatoryStringValues ( JSONObject json , String key ) throws JSONException { List < String > list = null ; JSONArray array = json . getJSONArray ( key ) ; list = new ArrayList < String > ( array . length ( ) ) ; for ( int i = 0 ; i < array . length ( ) ; i ++ ) { try { String entry = array . getString ( i ) ; list . add ( entry ) ; } catch ( JSONException e ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_OPTIONAL_STRING_ENTRY_UNPARSABLE_1 , key ) , e ) ; } } return list ; }
Helper for reading a mandatory String value list - throwing an Exception if parsing fails .