Java异常处理框架JEHA发布1.0版本

Jeha框架发行1.0版本。 Jeha主要思想是做容易的异常处理过程,使用简单的概念作为annotationsHandlers 您能注解(annotate)您的方法或类, 不需担心再处理细节。
仅几步就足够使其工作:


1)
创建handler:
public class MyHandler implements Handler { public Throwable handle(Throwable throwable, Object... params) { System.out.println("Handing..."); } }
2)
标注(Annotate):
public class Test { @ExceptionHandler(MyHandler.class) public void methodA() { // some code here } }
3)
使用 Jeha´s Maven 插件来做这一切:
<plugin> <groupId>org.codecompany</groupId> <artifactId>jeha-plugin</artifactId> <version>1.0</version> <executions> <execution> <phase>process-classes</phase> <goals> <goal>jeha</goal> </goals> </execution> </executions> </plugin>
这样就大功告成了!现在每一次抛出的一个例外是来自Test.methodA(),您的handler将捕捉它和执行MyHandler.handler()方法。

还有许多其他功能,使Jeha很容易学习和使用。看看快速启动指南,看看你掌握多少。

Jeha licensed是基于Apache License 2.0. 下载的框架包括一个快速启动指南,全部源代码和实例可从这里下载: http://sourceforge.net/projects/jeha/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值