Package org.apache.openjpa.util
Class Exceptions
java.lang.Object
org.apache.openjpa.util.Exceptions
- Direct Known Subclasses:
PersistenceExceptions
Utility methods for externalizing and handling exceptions.
- Since:
- 0.2.5
- Author:
- Marc Prud'hommeaux
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Print the stack trace of the exception's nested throwables.static void
Print the stack trace of the exception's nested throwables.static Object
Convert the specified failed object into a serializable object for when we are serializing an Exception.static Throwable[]
replaceNestedThrowables
(Throwable[] nested) Convert the specified throwables into a serialzable array.static String
toClassName
(Class<?> cls) static String
toClassNames
(Collection<? extends Class<?>> classes) static String
Safely stringify the given object.static String
toString
(Collection failed) Safely stringify the given objects.static String
Stringify the given exception.
-
Field Details
-
EMPTY_THROWABLES
-
-
Constructor Details
-
Exceptions
public Exceptions()
-
-
Method Details
-
toString
Safely stringify the given object. -
toString
Safely stringify the given objects. -
toString
Stringify the given exception. -
printNestedThrowables
Print the stack trace of the exception's nested throwables. -
printNestedThrowables
Print the stack trace of the exception's nested throwables. -
replaceFailedObject
Convert the specified failed object into a serializable object for when we are serializing an Exception. It will try the following:- if the object can be serialized, return the object itself
- if the object has a serializable oid, return the oid
- if the object has a non-serializable oid, return the oid's toString and the object class
- return the object's toString
- Parameters:
ob
- the object to convert- Returns:
- some serialized representation of the object
-
replaceNestedThrowables
Convert the specified throwables into a serialzable array. If any of the nested throwables cannot be serialized, they will be converted into a Exception with the original message. -
toClassName
-
toClassNames
-