/** * Adds a catch clause that handles an exception thrown in the * body. The catch clause must end with a return or throw statement. * * @param src the source code representing the catch clause. * It must be a single statement or block. * @param exceptionType the type of the exception handled by the * catch clause. */ public void addCatch(String src, CtClass exceptionType) throws CannotCompileException { addCatch(src, exceptionType, "$e"); }
/** * Adds a catch clause that handles an exception thrown in the * body. The catch clause must end with a return or throw statement. * * @param src the source code representing the catch clause. * It must be a single statement or block. * @param exceptionType the type of the exception handled by the * catch clause. */ public void addCatch(String src, CtClass exceptionType) throws CannotCompileException { addCatch(src, exceptionType, "$e"); }
/** * Adds a catch clause that handles an exception thrown in the * body. The catch clause must end with a return or throw statement. * * @param src the source code representing the catch clause. * It must be a single statement or block. * @param exceptionType the type of the exception handled by the * catch clause. */ public void addCatch(String src, CtClass exceptionType) throws CannotCompileException { addCatch(src, exceptionType, "$e"); }
/** * Adds a catch clause that handles an exception thrown in the * body. The catch clause must end with a return or throw statement. * * @param src the source code representing the catch clause. * It must be a single statement or block. * @param exceptionType the type of the exception handled by the * catch clause. */ public void addCatch(String src, CtClass exceptionType) throws CannotCompileException { addCatch(src, exceptionType, "$e"); }
/** * Adds a catch clause that handles an exception thrown in the * body. The catch clause must end with a return or throw statement. * * @param src the source code representing the catch clause. * It must be a single statement or block. * @param exceptionType the type of the exception handled by the * catch clause. */ public void addCatch(String src, CtClass exceptionType) throws CannotCompileException { addCatch(src, exceptionType, "$e"); }
/** * Adds a catch clause that handles an exception thrown in the * body. The catch clause must end with a return or throw statement. * * @param src the source code representing the catch clause. * It must be a single statement or block. * @param exceptionType the type of the exception handled by the * catch clause. */ public void addCatch(String src, CtClass exceptionType) throws CannotCompileException { addCatch(src, exceptionType, "$e"); }
/** * Adds a catch clause that handles an exception thrown in the * body. The catch clause must end with a return or throw statement. * * @param src the source code representing the catch clause. * It must be a single statement or block. * @param exceptionType the type of the exception handled by the * catch clause. */ public void addCatch(String src, CtClass exceptionType) throws CannotCompileException { addCatch(src, exceptionType, "$e"); }
public void addCatch(Class exceptionClass, String catchBody) { CtClass ctException = _source.getCtClass(exceptionClass); try { _method.addCatch(catchBody, ctException); } catch (Exception ex) { throw new ApplicationRuntimeException(ServiceMessages.unableToAddCatch( exceptionClass, _method, ex), ex); } _descriptionBody.append("\ncatch("); _descriptionBody.append(exceptionClass.getName()); _descriptionBody.append(" $e)\n"); _descriptionBody.append(catchBody); }
public void addCatch(final String fullClass, final String methodSig, final String exceptionClassName, final String src) { try { final CtBehavior method = getBehavior(fullClass, methodSig); method.addCatch(src, getClass(exceptionClassName), "$e"); } catch (final Throwable e) { maybeThrow(new IllegalArgumentException( "Cannot add catch for exception of type'" + exceptionClassName + " in " + fullClass + "'s " + methodSig, e)); } }
public void addCatch(final String fullClass, final String methodSig, final String exceptionClassName, final String src) { try { final CtBehavior method = getBehavior(fullClass, methodSig); method.addCatch(src, getClass(exceptionClassName), "$e"); } catch (final Throwable e) { maybeThrow(new IllegalArgumentException( "Cannot add catch for exception of type'" + exceptionClassName + " in " + fullClass + "'s " + methodSig, e)); } }