Package org.apache.juneau
Class BasicRuntimeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.BasicRuntimeException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BasicHttpException
,BeanRuntimeException
,ClassMetaRuntimeException
,ConfigException
,ContextRuntimeException
,ExecutableException
,InvalidAnnotationException
,InvalidDataConversionException
,ObjectRestException
,ParseException
,PatternException
,RemoteMetadataException
,SerializeException
,VarResolverException
Subclass of runtime exceptions that take in a message and zero or more arguments.
See Also:
-
Constructor Summary
ConstructorDescriptionBasicRuntimeException
(String message, Object... args) Constructor.BasicRuntimeException
(Throwable cause) Constructor.BasicRuntimeException
(Throwable cause, String message, Object... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
Throws anUnsupportedOperationException
if the unmodifiable flag is set on this bean.<T extends Throwable>
TSame asThrowable.getCause()
but searches the throwable chain for an exception of the specified type.boolean
Returnstrue if this bean is unmodifiable.setMessage
(String message, Object... args) Sets the detail message on this exception.void
setStackTrace
(StackTraceElement[] stackTrace) protected BasicRuntimeException
Specifies whether this bean should be unmodifiable.unwrap()
Returns the caused-by exception if there is one.Methods inherited from class java.lang.Throwable
addSuppressed, getCause, getLocalizedMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, toString
-
Constructor Details
-
BasicRuntimeException
Constructor.- Parameters:
cause
- The cause of this exception.message
- TheMessageFormat
-style message.args
- OptionalMessageFormat
-style arguments.
-
BasicRuntimeException
Constructor.- Parameters:
message
- TheMessageFormat
-style message.args
- OptionalMessageFormat
-style arguments.
-
BasicRuntimeException
Constructor.- Parameters:
cause
- The cause of this exception.
-
-
Method Details
-
setUnmodifiable
Specifies whether this bean should be unmodifiable.When enabled, attempting to set any properties on this bean will cause an
UnsupportedOperationException
.- Returns:
- This object.
-
isUnmodifiable
Returnstrue if this bean is unmodifiable.- Returns:
true if this bean is unmodifiable.
-
assertModifiable
Throws anUnsupportedOperationException
if the unmodifiable flag is set on this bean. -
getCause
Same asThrowable.getCause()
but searches the throwable chain for an exception of the specified type.- Type Parameters:
T
- The throwable type to search for.- Parameters:
c
- The throwable type to search for.- Returns:
- The exception, or
null if not found.
-
setMessage
Sets the detail message on this exception.- Parameters:
message
- The message.args
- The message args.- Returns:
- This object.
-
getMessage
- Overrides:
getMessage
in classThrowable
-
fillInStackTrace
- Overrides:
fillInStackTrace
in classThrowable
-
initCause
-
setStackTrace
- Overrides:
setStackTrace
in classThrowable
-
unwrap
Returns the caused-by exception if there is one.- Returns:
- The caused-by exception if there is one, or this exception if there isn't.
-