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
ConstructorsConstructorDescriptionBasicRuntimeException(String message, Object... args) Constructor.BasicRuntimeException(Throwable cause) Constructor.BasicRuntimeException(Throwable cause, String message, Object... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidThrows anUnsupportedOperationExceptionif 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.booleanReturnstrue if this bean is unmodifiable.setMessage(String message, Object... args) Sets the detail message on this exception.voidsetStackTrace(StackTraceElement[] stackTrace) protected BasicRuntimeExceptionSpecifies 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 anUnsupportedOperationExceptionif 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:
getMessagein classThrowable
-
fillInStackTrace
- Overrides:
fillInStackTracein classThrowable
-
initCause
-
setStackTrace
- Overrides:
setStackTracein 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.
-