Class DataAccessor.ExceptionSafety

  • Enclosing class:
    DataAccessor

    public static class DataAccessor.ExceptionSafety
    extends java.lang.Object
    An Advice class to wrap generated methods in catch-all exception safety. Should any exception occur, such as a NullPointerException from unchecked method chaining, it will be silently suppressed, and the return value of the access method will be the default value for the return type i.e. 0 for primitive numbers, and null for reference types.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExceptionSafety()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void onMethodExit​(java.lang.Throwable thrown)
      Advice on method exit, to rewrite any thrown exception to be null, and therefore suppressed
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExceptionSafety

        public ExceptionSafety()
    • Method Detail

      • onMethodExit

        @OnMethodExit(onThrowable=java.lang.Throwable.class)
        public static void onMethodExit​(@Thrown(readOnly=false)
                                        java.lang.Throwable thrown)
        Advice on method exit, to rewrite any thrown exception to be null, and therefore suppressed
        Parameters:
        thrown - the exception which was thrown, which will be suppressed