/** * Tests if the given exception was caused by this handler. * * @param exception an exception * @return <code>true</code> if the exception was thrown by this handler, * <code>false</code> otherwise */ public boolean isCauseOf(SAXException exception) { if (exception instanceof TaggedSAXException) { TaggedSAXException tagged = (TaggedSAXException) exception; return this == tagged.getTag(); } else { return false; } }
/** * Re-throws the original exception thrown by this handler. This method * first checks whether the given exception is a {@link TaggedSAXException} * wrapper created by this decorator, and then unwraps and throws the * original wrapped exception. Returns normally if the exception was * not thrown by this handler. * * @param exception an exception * @throws SAXException original exception, if any, thrown by this handler */ public void throwIfCauseOf(Exception exception) throws SAXException { if (exception instanceof TaggedSAXException) { TaggedSAXException tagged = (TaggedSAXException) exception; if (this == tagged.getTag()) { throw tagged.getCause(); } } }
/** * Tests if the given exception was caused by this handler. * * @param exception an exception * @return <code>true</code> if the exception was thrown by this handler, * <code>false</code> otherwise */ public boolean isCauseOf(SAXException exception) { if (exception instanceof TaggedSAXException) { TaggedSAXException tagged = (TaggedSAXException) exception; return this == tagged.getTag(); } else { return false; } }
/** * Tests if the given exception was caused by this handler. * * @param exception an exception * @return <code>true</code> if the exception was thrown by this handler, * <code>false</code> otherwise */ public boolean isCauseOf(SAXException exception) { if (exception instanceof TaggedSAXException) { TaggedSAXException tagged = (TaggedSAXException) exception; return this == tagged.getTag(); } else { return false; } }
/** * Re-throws the original exception thrown by this handler. This method * first checks whether the given exception is a {@link TaggedSAXException} * wrapper created by this decorator, and then unwraps and throws the * original wrapped exception. Returns normally if the exception was * not thrown by this handler. * * @param exception an exception * @throws SAXException original exception, if any, thrown by this handler */ public void throwIfCauseOf(Exception exception) throws SAXException { if (exception instanceof TaggedSAXException) { TaggedSAXException tagged = (TaggedSAXException) exception; if (this == tagged.getTag()) { throw tagged.getCause(); } } }
/** * Re-throws the original exception thrown by this handler. This method * first checks whether the given exception is a {@link TaggedSAXException} * wrapper created by this decorator, and then unwraps and throws the * original wrapped exception. Returns normally if the exception was * not thrown by this handler. * * @param exception an exception * @throws SAXException original exception, if any, thrown by this handler */ public void throwIfCauseOf(Exception exception) throws SAXException { if (exception instanceof TaggedSAXException) { TaggedSAXException tagged = (TaggedSAXException) exception; if (this == tagged.getTag()) { throw tagged.getCause(); } } }