public JSONArray getJSONMeasures ( String content ) { JSONArray ja = new JSONArray ( ) ; for ( Entry < String , String > measure : measureRegexps . entrySet ( ) ) { Pattern r = Pattern . compile ( measure . getValue ( ) ) ; Matcher m = r . matcher ( content ) ; if ( m . find ( ) ) { JSONObject jsonMeasure = new JSONObject ( ) ; jsonMeasure . put ( measure . getKey ( ) , m . group ( 1 ) ) ; ja . add ( jsonMeasure ) ; } } return ja ; }
Obtains a JSONArray with the measures extracted from a string passed by argument .