public void mapField(String oldFieldName, Integer pageNumber, String newFieldName) {
    
    // page number = set of old field names 
    
    Set<String> parametersOnPage = parameterPageMap.get(pageNumber);
    if (parametersOnPage == null) {
      parametersOnPage = new HashSet<String>();
      parameterPageMap.put(pageNumber, parametersOnPage);
    }
    parametersOnPage.add(oldFieldName);

    // old field name = corresponding QueryField 
    
    QueryPageDAO queryPageDAO = new QueryPageDAO();
    QueryPage queryPage = queryPageDAO.findByQueryAndPageNumber(targetQuery, pageNumber);
    if (queryPage == null) {
      throw new IllegalArgumentException("Unknown QueryPage by page number: " + pageNumber);
    }
    QueryFieldDAO queryFieldDAO = new QueryFieldDAO();
    QueryField queryField = queryFieldDAO.findByQueryPageAndName(queryPage, newFieldName);
    if (queryField == null) {
      throw new IllegalArgumentException("Incorrect QueryField mapping: " + oldFieldName + "=" + pageNumber + "." + newFieldName);
    }
    if (queryFieldMap.containsKey(oldFieldName)) {
      throw new IllegalArgumentException("Already mapped QueryField: " + oldFieldName);
    }
    queryFieldMap.put(oldFieldName, queryField);
  }
public void mapField ( String oldFieldName , Integer pageNumber , String newFieldName ) { Set < String > parametersOnPage = parameterPageMap . get ( pageNumber ) ; if ( parametersOnPage == null ) { parametersOnPage = new HashSet < String > ( ) ; parameterPageMap . put ( pageNumber , parametersOnPage ) ; } parametersOnPage . add ( oldFieldName ) ; QueryPageDAO queryPageDAO = new QueryPageDAO ( ) ; QueryPage queryPage = queryPageDAO . findByQueryAndPageNumber ( targetQuery , pageNumber ) ; if ( queryPage == null ) { throw new IllegalArgumentException ( "Unknown QueryPage by page number: " + pageNumber ) ; } QueryFieldDAO queryFieldDAO = new QueryFieldDAO ( ) ; QueryField queryField = queryFieldDAO . findByQueryPageAndName ( queryPage , newFieldName ) ; if ( queryField == null ) { throw new IllegalArgumentException ( "Incorrect QueryField mapping: " + oldFieldName + "=" + pageNumber + "." + newFieldName ) ; } if ( queryFieldMap . containsKey ( oldFieldName ) ) { throw new IllegalArgumentException ( "Already mapped QueryField: " + oldFieldName ) ; } queryFieldMap . put ( oldFieldName , queryField ) ; }
etc.