org.jwalk
Class LoaderException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.jwalk.JWalkException
              extended by org.jwalk.LoaderException
All Implemented Interfaces:
java.io.Serializable

public class LoaderException
extends JWalkException

LoaderException signals when a test class or generator could not be loaded. This exception may be raised by the JWalker Settings API, if the wrong path name is specified for the test class, or if the wrong path name is specified for any custom generator. LoaderException is raised instead of the lower-level exceptions ClassNotFoundException and NoClassDefFoundException, which are trapped and converted into a LoaderException. The exception may be queried before it is handled, to support giving different feedback. If classNotFound() is true, the class was simply not found. If classNotQualified() is true, a class was found, but not loaded using its proper package-qualified name.

Version:
1.1
Author:
Anthony Simons
See Also:
Serialized Form

Constructor Summary
LoaderException(java.lang.String name)
          Creates a LoaderException for a class that could not be found.
LoaderException(java.lang.String name, boolean qualify)
          Creates a LoaderException for a class that was accessed without using its package-qualified name.
 
Method Summary
 boolean classNotFound()
          Reports if the class was not found.
 boolean classNotQualified()
          Reports if the class was not package-qualified.
 java.lang.String getClassName()
          Returns the name of the class that was not loaded.
 
Methods inherited from class org.jwalk.JWalkException
getError
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoaderException

public LoaderException(java.lang.String name)
Creates a LoaderException for a class that could not be found.

Parameters:
name - the name of the class.

LoaderException

public LoaderException(java.lang.String name,
                       boolean qualify)
Creates a LoaderException for a class that was accessed without using its package-qualified name.

Parameters:
name - the name of the test class.
qualify - a flag indicating the need to qualify.
Method Detail

getClassName

public java.lang.String getClassName()
Returns the name of the class that was not loaded.

Returns:
the name of the class that was not loaded.

classNotFound

public boolean classNotFound()
Reports if the class was not found.

Returns:
true if the class was not found.

classNotQualified

public boolean classNotQualified()
Reports if the class was not package-qualified.

Returns:
true if the class was not package-qualified.