net.sf.qualitytest.exception
Class IllegalNonFinalStaticException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.sf.qualitytest.exception.IllegalNonFinalStaticException
All Implemented Interfaces:
Serializable

public class IllegalNonFinalStaticException
extends RuntimeException

Thrown to indicate that a class contains a non-final static field.

Author:
André Rouél, Dominik Seichter
See Also:
Serialized Form

Field Summary
protected static String DEFAULT_MESSAGE
          Default message to indicate that the a given class must not contain non-final statics.
protected static String MESSAGE_WITH_NAME
          Message to indicate that the the given class contains a non-final static field.
 
Constructor Summary
IllegalNonFinalStaticException()
          Constructs an IllegalNonStaticFinalException with the default message DEFAULT_MESSAGE.
IllegalNonFinalStaticException(String className, String fieldName)
          Constructs an IllegalNonStaticFinalException with the message MESSAGE_WITH_NAME including the given name of the class as string representation.
IllegalNonFinalStaticException(String className, String fieldName, Throwable cause)
          Constructs a new exception with the message MESSAGE_WITH_NAME including the given name as string representation and cause.
IllegalNonFinalStaticException(Throwable cause)
          Constructs a new exception with the default message DEFAULT_MESSAGE.
 
Method Summary
 
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
 

Field Detail

DEFAULT_MESSAGE

protected static final String DEFAULT_MESSAGE
Default message to indicate that the a given class must not contain non-final statics.

See Also:
Constant Field Values

MESSAGE_WITH_NAME

protected static final String MESSAGE_WITH_NAME
Message to indicate that the the given class contains a non-final static field.

See Also:
Constant Field Values
Constructor Detail

IllegalNonFinalStaticException

public IllegalNonFinalStaticException()
Constructs an IllegalNonStaticFinalException with the default message DEFAULT_MESSAGE.


IllegalNonFinalStaticException

public IllegalNonFinalStaticException(@Nullable
                                      String className,
                                      @Nullable
                                      String fieldName)
Constructs an IllegalNonStaticFinalException with the message MESSAGE_WITH_NAME including the given name of the class as string representation.

Parameters:
className - the name of the passed class
fieldName - the name of the non-final static field

IllegalNonFinalStaticException

public IllegalNonFinalStaticException(@Nullable
                                      String className,
                                      @Nullable
                                      String fieldName,
                                      @Nullable
                                      Throwable cause)
Constructs a new exception with the message MESSAGE_WITH_NAME including the given name as string representation and cause.

Parameters:
className - the name of the passed class
fieldName - the name of the non-final static field
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

IllegalNonFinalStaticException

public IllegalNonFinalStaticException(@Nullable
                                      Throwable cause)
Constructs a new exception with the default message DEFAULT_MESSAGE.

Parameters:
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)


Copyright © 2012-2013. All Rights Reserved.