|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception edu.nrao.sss.util.IllegalTransitionException
public class IllegalTransitionException
Thrown to indicate that an attempt to change a property from one value to another failed.
This exception is similar, but not quite the same as, java's
IllegalArgumentException
. One of the most appropriate
places to use this exception is with status transitions of an
object, especially when those transitions are the result of
calling methods such as cancel() or execute(),
as opposed to methods such as setStatus(newStatus).
The text returned by getMessage()
will look like:
Property 'propertyName' may not be changed from 'currentValue' to 'illegalValue'.or
Property 'propertyName' may not be changed from 'currentValue' to 'illegalValue'. 'additionalInformation'
Version Info:
$Revision: 2184 $ |
$Date: 2009-04-10 15:00:07 -0600 (Fri, 10 Apr 2009) $ |
$Author: dharland $ (last person to modify) |
Constructor Summary | |
---|---|
IllegalTransitionException(String propertyName,
String currentValue,
String illegalValue)
Creates a new exception with the given properties. |
|
IllegalTransitionException(String propertyName,
String currentValue,
String illegalValue,
String additionalInformation)
Creates a new exception with the given properties. |
Method Summary | |
---|---|
String |
getAdditionalInformation()
Returns any additional information about this transition. |
String |
getCurrentValue()
Returns the value of the property prior to the attempt to change it. |
String |
getIllegalValue()
Returns the value to which something tried to change the property. |
String |
getMessage()
|
String |
getPropertyName()
Returns the name of the property for which an illegal transistion was attempted. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, 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 |
---|
public IllegalTransitionException(String propertyName, String currentValue, String illegalValue)
class comments
for a description of how the parameters are used to form
a message.
This is a convenience constructor that is equivalent to IllegalTransitionException(propertyName, currentValue, illegalValue, "") .
public IllegalTransitionException(String propertyName, String currentValue, String illegalValue, String additionalInformation)
class comments
for a description of how the parameters are used to form
a message.
Method Detail |
---|
public String getMessage()
getMessage
in class Throwable
public String getAdditionalInformation()
If this exception carries no additional information, the empty string ("") will be returned.
public String getCurrentValue()
public String getIllegalValue()
public String getPropertyName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |