public JSONObject extractWidgetsMetadata(String viewId,String device,Document viewSource,boolean xhmltInput){
  try {
    ViewParser viewParser=new ViewParser(viewId,device,true,mustIndent(),xhmltInput);
    String metadata=viewParser.extractCruxMetaData(viewSource);
    return new JSONObject(metadata);
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
    throw new RuntimeException(e);
  }
}

public JSONObject extractWidgetsMetadata ( String viewId , String device , Document viewSource , boolean xhmltInput ) { try { ViewParser viewParser = new ViewParser ( viewId , device , true , mustIndent ( ) , xhmltInput ) ; String metadata = viewParser . extractCruxMetaData ( viewSource ) ; return new JSONObject ( metadata ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; throw new RuntimeException ( e ) ; } }
extract the widgets metadata from the view page .
