private String extractString(String key,CSVRecord record,String defaultValue) throws FormatException {
  String toReturn=defaultValue;
  if (record.isMapped(key)) {
    toReturn=record.get(key);
  }
 else {
    if (defaultValue == null) {
      throw new FormatException("Field not used but expected: " + key);
    }
  }
  return toReturn;
}

private String extractString ( String key , CSVRecord record , String defaultValue ) throws FormatException { String toReturn = defaultValue ; if ( record . isMapped ( key ) ) { toReturn = record . get ( key ) ; } else { if ( defaultValue == null ) { throw new FormatException ( "Field not used but expected: " + key ) ; } } return toReturn ; }
extract a string from the items array . the index into the array is determined by looking up the index in the fields map using the " key " as the key . if no such key exists , defaultvalue is returned if it is not null . otherwise , a formatexception is thrown .
