private static void preMarshall ( Object bean ) { try { Method method = bean . getClass ( ) . getDeclaredMethod ( "encryptData" ) ; if ( method != null ) { method . invoke ( bean ) ; } } catch ( NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { } }
Called before marshalling the bean to a form that will be used for storage in the DB .