private static Map < String , Object > parseAlData ( JSONArray dataArray ) throws JSONException { HashMap < String , Object > al = new HashMap < String , Object > ( ) ; for ( int i = 0 ; i < dataArray . length ( ) ; i ++ ) { JSONObject tag = dataArray . getJSONObject ( i ) ; String name = tag . getString ( "property" ) ; String [ ] nameComponents = name . split ( ":" ) ; if ( ! nameComponents [ 0 ] . equals ( META_TAG_PREFIX ) ) { continue ; } Map < String , Object > root = al ; for ( int j = 1 ; j < nameComponents . length ; j ++ ) { @ SuppressWarnings ( "unchecked" ) List < Map < String , Object > > children = ( List < Map < String , Object > > ) root . get ( nameComponents [ j ] ) ; if ( children == null ) { children = new ArrayList < Map < String , Object > > ( ) ; root . put ( nameComponents [ j ] , children ) ; } Map < String , Object > child = children . size ( ) > 0 ? children . get ( children . size ( ) - 1 ) : null ; if ( child == null || j == nameComponents . length - 1 ) { child = new HashMap < String , Object > ( ) ; children . add ( child ) ; } root = child ; } if ( tag . has ( "content" ) ) { if ( tag . isNull ( "content" ) ) { root . put ( KEY_AL_VALUE , null ) ; } else { root . put ( KEY_AL_VALUE , tag . getString ( "content" ) ) ; } } } return al ; }
Builds up a data structure filled with the app link data from the meta tags on a page . The structure of this object is a dictionary where each key holds an array of app link data dictionaries . Values are stored in a key called _value .