org.ocltf.utils
Class ExceptionUtils

java.lang.Object
  extended byorg.ocltf.utils.ExceptionUtils

public class ExceptionUtils
extends java.lang.Object

Contains Exception handling utilities.

Author:
Chad Brandon

Constructor Summary
ExceptionUtils()
           
 
Method Summary
static void checkAssignable(java.lang.String methodExecuteName, java.lang.Class assignableToClass, java.lang.String argumentName, java.lang.Class argumentClass)
          Checks if the argumentClass is assignable to assignableToClass, and if not throws an IllegalArgumentException, otherwise does nothing.
static void checkEmpty(java.lang.String methodExecuteName, java.lang.String argumentName, java.lang.String argument)
          Checks if the argument is null or an empty String throws an IllegalArgumentException if it is, does nothing if not
static void checkNull(java.lang.String methodExecuteName, java.lang.String argumentName, java.lang.Object argument)
          Checks if the argument is null, and if so, throws an IllegalArgumentException, does nothing if not.
static java.lang.Integer checkValidInteger(java.lang.String methodExecuteName, java.lang.String argumentName, java.lang.String argument)
          Checks if the passed in String argument is a valid Integer, if not throws an IllegalArgumentException, otherwise returns the converted argument to a converted Integer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionUtils

public ExceptionUtils()
Method Detail

checkNull

public static void checkNull(java.lang.String methodExecuteName,
                             java.lang.String argumentName,
                             java.lang.Object argument)
Checks if the argument is null, and if so, throws an IllegalArgumentException, does nothing if not.

Parameters:
methodExecuteName - the name of the method we are currently executing
argumentName - - the name of the argument we are checking for null
argument - - the argument we are checking

checkEmpty

public static void checkEmpty(java.lang.String methodExecuteName,
                              java.lang.String argumentName,
                              java.lang.String argument)
Checks if the argument is null or an empty String throws an IllegalArgumentException if it is, does nothing if not

Parameters:
methodExecuteName - the name of the method we are currently executing
argumentName - the name of the argument we are checking for null
argument - the argument we are checking

checkAssignable

public static void checkAssignable(java.lang.String methodExecuteName,
                                   java.lang.Class assignableToClass,
                                   java.lang.String argumentName,
                                   java.lang.Class argumentClass)
Checks if the argumentClass is assignable to assignableToClass, and if not throws an IllegalArgumentException, otherwise does nothing.

Parameters:
methodExecuteName - - the method name of the method, this method is being executed within
assignableToClass - - the Class that argumentClass must be assignable to
argumentClass - - the argumentClass we are checking
argumentName - - the name of the argument we are checking

checkValidInteger

public static java.lang.Integer checkValidInteger(java.lang.String methodExecuteName,
                                                  java.lang.String argumentName,
                                                  java.lang.String argument)
Checks if the passed in String argument is a valid Integer, if not throws an IllegalArgumentException, otherwise returns the converted argument to a converted Integer

Parameters:
methodExecuteName - - the method name of the method, this method is being executed within
argumentName - - the name of the argument we are checking
argument - - the actual argument we are checking to see if its a valid Integer
Returns:
Integer


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.