/*
 * Copyright (C) 2004-2005  exedio GmbH (www.exedio.com)
 *
 * 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 com.exedio.cope;

/**
 * Signals, that an attempt to find an item by it's ID has been failed,
 * because there is no item with such an ID.
 *
 * This exception will be thrown by {@link Model#findByID(String) Model.findByID},
 * if there is no item with the given ID.
 * 
 * @author Ralf Wiebicke
 */
public class NoSuchIDException extends Exception
{
	private final boolean notAnID;
	
	NoSuchIDException(final String id, final boolean notAnID, final String detail)
	{
		super("no such id <"+id+">, "+detail);
		this.notAnID = notAnID;
	}

	NoSuchIDException(final String id, final NumberFormatException cause, final String numberString)
	{
		super("no such id <"+id+">, wrong number format <"+numberString+">");
		this.notAnID = true;
	}

	NoSuchIDException(final long id, final String detail)
	{
		super("no such id number <"+id+">, "+detail);
		this.notAnID = true;
	}

	/**
	 * Returns, whether the id is invalid on principle
	 * within the currently deployed model,
	 * this means, the will never be and has never been an
	 * item for this id.
	 */
	public final boolean notAnID()
	{
		return notAnID;
	}
}

@@ -1112,16 +1112,22 @@
 %0Apublic 
+final 
 class No
@@ -1162,16 +1162,42 @@
 ption%0A%7B%0A
+%09private final String id;%0A
 %09private
@@ -1220,16 +1220,46 @@
 otAnID;%0A
+%09private final String detail;%0A
 %09%0A%09NoSuc
@@ -1368,32 +1368,48 @@
 +%22%3E, %22+detail);%0A
+%09%09this.id = id;%0A
 %09%09this.notAnID =
@@ -1418,16 +1418,40 @@
 otAnID;%0A
+%09%09this.detail = detail;%0A
 %09%7D%0A%0A%09NoS
@@ -1553,36 +1553,24 @@
 %7B%0A%09%09
-super(%22no such id %3C%22+id+%22%3E
+this(id, true
 , 
+%22
 wron
@@ -1612,81 +1612,26 @@
 );%0A%09
-%09this.notAnID = true;%0A%09%7D%0A%0A%09NoSuchIDException(final long id, final
+%7D%0A%0A%09public
  String 
 deta
@@ -1630,88 +1630,69 @@
 ing 
-detail)%0A%09%7B%0A%09%09super(%22no such id number %3C%22+id+
+getMessage()%0A%09%7B%0A%09%09return %22no such id %3C%22 + id + 
 %22%3E, %22
-+
+ + 
 detail
-);%0A%09%09this.notAnID = true
 ;%0A%09%7D
@@ -1882,22 +1882,16 @@
 %09public 
-final 
 boolean 

compute message in #getMessage()