Package com.nfbsoftware.exception
Class NfbCheckedException.Code
java.lang.Object
com.nfbsoftware.exception.NfbCheckedException.Code
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
XmlDocumentCheckedException.Code
- Enclosing class:
NfbCheckedException
Represents a
checkedException code. This class is used to
enforce the practice of using a code defined for an exception class.
Instances of the exception cannot be constructed without providing a valid
code. Subclasses of this class must implement a subclass of this protected
class. Typically, subclass constructors will take this Code
subclass in an internal Codes interface.- Author:
- Brendan Clemenzi
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCode(String code, NfbCheckedException.Code mappedCode, String message, int severity) The protected constructor ensures that no instances of this class are constructed outside of the exception class or its children. -
Method Summary
-
Constructor Details
-
Code
The protected constructor ensures that no instances of this class are constructed outside of the exception class or its children.- Parameters:
code- the codemappedCode- the top-level code that this code should map tomessage- the default messageseverity- the severity
-
-
Method Details
-
getCode
Returns the code's value- Returns:
- the code's value
-
getMappedCode
Returns the code's mapped code- Returns:
- the code's mapped code value
-
getMessage
Returns the code's default message.- Returns:
- the code's default message
-
getSeverity
public int getSeverity()Returns the code's severity- Returns:
- the code's severity
-
toString
Returns the Code's value as a String.
-