/** * Invoke the custom exception handler (if present) * * @param ex * The exception that occurred. */ private static void _invokeCustomExceptionCallback (@Nonnull final Exception ex) { s_aExceptionCallbacks.forEach (x -> x.onException (ex)); }
m_aExceptionCallbacks.forEach (x -> x.onException (ex)); m_aExceptionCallbacks.forEach (x -> x.onException (ex)); else LOGGER.error ("Error executing action", ex);
@Nullable public JAXBTYPE read (@Nonnull final IJAXBUnmarshaller <JAXBTYPE> aHandler) { ValueEnforcer.notNull (aHandler, "Handler"); // as we don't have a node, we need to trust the implementation class final Schema aSchema = getSchema (); if (aSchema == null && isUseSchema ()) LOGGER.warn ("Don't know how to read JAXB document of type " + m_aImplClass.getName ()); JAXBTYPE ret = null; try { // Create unmarshaller final Unmarshaller aUnmarshaller = createUnmarshaller (); // Customize on demand if (m_aUnmarshallerCustomizer != null) m_aUnmarshallerCustomizer.accept (aUnmarshaller); // main unmarshalling final JAXBElement <JAXBTYPE> aElement = aHandler.doUnmarshal (aUnmarshaller, m_aImplClass); ret = aElement.getValue (); if (ret == null) throw new IllegalStateException ("Failed to read JAXB document of class " + m_aImplClass.getName () + " - without exception!"); } catch (final JAXBException ex) { exceptionCallbacks ().forEach (x -> x.onException (ex)); } return ret; }
@Nullable public final JAXBTYPE read (@Nonnull final IJAXBUnmarshaller <JAXBTYPE> aHandler) { ValueEnforcer.notNull (aHandler, "Handler"); try { final Unmarshaller aUnmarshaller = _createUnmarshaller (getClassLoader ()); customizeUnmarshaller (aUnmarshaller); return aHandler.doUnmarshal (aUnmarshaller, m_aType).getValue (); } catch (final JAXBException ex) { m_aReadExceptionCallbacks.forEach (x -> x.onException (ex)); } return null; }
exceptionCallbacks ().forEach (x -> x.onException (ex));
@Nonnull public final ESuccess write (@Nonnull final JAXBTYPE aObject, @Nonnull final IJAXBMarshaller <JAXBTYPE> aMarshallerFunc) { ValueEnforcer.notNull (aObject, "Object"); ValueEnforcer.notNull (aMarshallerFunc, "MarshallerFunc"); try { final Marshaller aMarshaller = _createMarshaller (); customizeMarshaller (aMarshaller); final JAXBElement <JAXBTYPE> aJAXBElement = m_aJAXBElementWrapper.apply (aObject); aMarshallerFunc.doMarshal (aMarshaller, aJAXBElement); return ESuccess.SUCCESS; } catch (final JAXBException ex) { m_aWriteExceptionCallbacks.forEach (x -> x.onException (ex)); } return ESuccess.FAILURE; }
aSettings.exceptionCallbacks ().forEach (x -> x.onException (ex)); s_aDomErrorCounterHdl.increment ();
aSettings.exceptionCallbacks ().forEach (x -> x.onException (ex)); aSettings.exceptionCallbacks ().forEach (x -> x.onException (ex));