Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1456 - development/main/util/exception/src/main/net/dpml/exception

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1456 - development/main/util/exception/src/main/net/dpml/exception
  • Date: Tue, 11 Jan 2005 05:24:37 +0100

Author: niclas
Date: Tue Jan 11 05:24:37 2005
New Revision: 1456

Added:

development/main/util/exception/src/main/net/dpml/exception/NullArgumentException.java
(contents, props changed)
Log:
Adding NullArgumentException

Added:
development/main/util/exception/src/main/net/dpml/exception/NullArgumentException.java
==============================================================================
--- (empty file)
+++
development/main/util/exception/src/main/net/dpml/exception/NullArgumentException.java
Tue Jan 11 05:24:37 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005 Niclas Hedhman.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.exception;
+
+
+/** Exception thrown when the argument to a method or constructor is
+ * <i>null</i> and not handled by the method/constructor/class.
+ *
+ * The argument in the only constructor of this exception should only
+ * take the name of the declared argument that is null, for instance;
+ * <code><pre>
+ * public Person( String name, int age )
+ * {
+ * if( name == null )
+ * throw new NullArgumentException( "name" );
+ * if( age > 120 )
+ * throw new IllegalArgumentException( "age > 120" );
+ * if( age < 0 )
+ * throw new IllegalArgumentException( "age < 0" );
+ * }
+ * </pre></code>
+ */
+public class NullArgumentException extends IllegalArgumentException
+{
+ /** Constructor taking the name of the argument that was null.
+ */
+ public NullArgumentException( String argumentName )
+ {
+ super( argumentName );
+ }
+}
\ No newline at end of file



  • svn commit: r1456 - development/main/util/exception/src/main/net/dpml/exception, niclas, 01/10/2005

Archive powered by MHonArc 2.6.24.

Top of Page