/*********************************************************************
*
*      Copyright (C) 2009 Andrew Khan
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/

package jxl.biff;

import jxl.JXLException;

/**
 * A properly typed exception in case consumers of the API specifically
 * wish to handle the case when the workbook is password protected
 */
public class DataValidationParseException extends JXLException
{
  private int col1;
  private int col2;
  private int row1;
  private int row2;
  /**
   * Constructor
   */
  public DataValidationParseException(String msg, 
                                      int c1, int r1,
                                      int c2, int r2)
  {
    super(msg);
    col1 = c1;
    col2 = c2;
    row1 = r1;
    row2 = r2;
  }

  public String getMessage()
  {
    return super.getMessage() + " for cells " + 
      CellReferenceHelper.getCellReference(col1, row2)+ "-" + 
      CellReferenceHelper.getCellReference(col2, row2);
  }
}
