Class SerializeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.commons.BasicRuntimeException
org.apache.juneau.marshall.BasicRuntimeException
org.apache.juneau.marshall.serializer.SerializeException
- All Implemented Interfaces:
Serializable
General exception thrown whenever an error occurs during serialization.
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSerializeException(String message, Object... args) Constructor.SerializeException(Throwable causedBy) Constructor.SerializeException(SerializerSession session, Exception causedBy) Constructor.SerializeException(SerializerSession session, String message, Object... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic SerializeExceptionCreator method.Returns the highest-levelSerializeException in the stack trace.Sets the inner cause for this exception.setMessage(String message, Object... args) Sets the detail message on this exception.Methods inherited from class org.apache.juneau.commons.BasicRuntimeException
getMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SerializeException
Constructor.- Parameters:
session- The serializer session to extract information from. Can benull (the message is not augmented with location info).causedBy- The inner exception. Must not benull .
-
SerializeException
Constructor.- Parameters:
session- The serializer session to extract information from. Can benull (the message is not augmented with location info).message- The exception message containingString.format-style (%s ) arguments.args- OptionalString.format-style arguments.
-
SerializeException
Constructor.- Parameters:
message- The exception message containingString.format-style (%s ) arguments.args- OptionalString.format-style arguments.
-
SerializeException
Constructor.- Parameters:
causedBy- The inner exception. Must not benull .
-
-
Method Details
-
create
Creator method.If the throwable is already a
SerializeException, we simply return that exception as-is. If the throwable is anInvocationTargetException, we unwrap the thrown exception. Otherwise we create a newSerializeException.- Parameters:
e- The exception being wrapped or unwrapped. Must not benull .- Returns:
- The specified throwable wrapped or unwrapped as a
SerializeException(may be the same instance if it already was one).
-
getRootCause
Returns the highest-levelSerializeException in the stack trace. Useful for JUnit testing of error conditions.- Returns:
- The root serialize exception, or this exception if there isn't one.
-
initCause
Sets the inner cause for this exception. -
setMessage
Description copied from class:BasicRuntimeExceptionSets the detail message on this exception.- Overrides:
setMessagein classBasicRuntimeException- Parameters:
message- The message.args- The message args.- Returns:
- This object.
-