private static String extractTopItem(String searchString,String schema,int startIdx){
  String extracted=null;
  int propIdx=schema.indexOf("\"properties\"",startIdx);
  if (propIdx == -1) {
    propIdx=Integer.MAX_VALUE;
  }
  int idIdx=schema.indexOf("\"" + searchString + "\"",startIdx);
  int secondIdIdx=schema.indexOf("\"" + searchString + "\"",idIdx + 1);
  if (secondIdIdx != -1 && propIdx > secondIdIdx) {
    idIdx=secondIdIdx;
  }
  if (idIdx != -1 && propIdx > idIdx) {
    int valueStartIdx=schema.indexOf("\"",idIdx + (searchString.length() + 2));
    int valueEndIdx=schema.indexOf("\"",valueStartIdx + 1);
    extracted=schema.substring(valueStartIdx + 1,valueEndIdx);
  }
  return extracted;
}

private static String extractTopItem ( String searchString , String schema , int startIdx ) { String extracted = null ; int propIdx = schema . indexOf ( "\"properties\"" , startIdx ) ; if ( propIdx == - 1 ) { propIdx = Integer . MAX_VALUE ; } int idIdx = schema . indexOf ( "\"" + searchString + "\"" , startIdx ) ; int secondIdIdx = schema . indexOf ( "\"" + searchString + "\"" , idIdx + 1 ) ; if ( secondIdIdx != - 1 && propIdx > secondIdIdx ) { idIdx = secondIdIdx ; } if ( idIdx != - 1 && propIdx > idIdx ) { int valueStartIdx = schema . indexOf ( "\"" , idIdx + ( searchString . length ( ) + 2 ) ) ; int valueEndIdx = schema . indexOf ( "\"" , valueStartIdx + 1 ) ; extracted = schema . substring ( valueStartIdx + 1 , valueEndIdx ) ; } return extracted ; }
extracts the value of a specified parameter in a schema
