Save This Page
Home » apache-openjpa-1.1.0-source » org.apache.openjpa » util » [javadoc | source]
org.apache.openjpa.util
public class: Exceptions [javadoc | source]
java.lang.Object
   org.apache.openjpa.util.Exceptions

Direct Known Subclasses:
    PersistenceExceptions

Utility methods for externalizing and handling exceptions.
Field Summary
public static final  Throwable[] EMPTY_THROWABLES     
static final  String SEP     
Method from org.apache.openjpa.util.Exceptions Summary:
printNestedThrowables,   printNestedThrowables,   replaceFailedObject,   replaceNestedThrowables,   toString,   toString,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.openjpa.util.Exceptions Detail:
 public static  void printNestedThrowables(ExceptionInfo e,
    PrintStream out) 
    Print the stack trace of the exception's nested throwables.
 public static  void printNestedThrowables(ExceptionInfo e,
    PrintWriter out) 
    Print the stack trace of the exception's nested throwables.
 public static Object replaceFailedObject(Object ob) 
    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
 public static Throwable[] replaceNestedThrowables(Throwable[] nested) 
    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.
 public static String toString(Object ob) 
    Safely stringify the given object.
 public static String toString(Collection failed) 
    Safely stringify the given objects.
 public static String toString(ExceptionInfo e) 
    Stringify the given exception.