ClassGrep

来源:互联网 发布:小规模纳税人 知乎 编辑:程序博客网 时间:2024/05/04 01:44

1.简介

ClassGrep是一个java运行时查找工具。使用这个工具,可以查找出如下一些内容:
  • 给定一个注解,查找使用了该注解的类,字段,方法
  • 给定一个方法,查找哪些方法调用了给定的方法
  • 给定一个类,查找出该类的所有子类

2.原理

当使用classgrep的时候,它会搜索当前classpath下面的所有的class,如果是jar或者war包也会提取class,然后使用asm获取class的信息。

3.资源

        master :
http://git.oschina.net/wensiqun/classgrep
          实例:ClassGrep Sample (11 downloads)
源码jar

Maven坐标:

<dependency>    <groupId>com.googlecode.classgrep</groupId>    <artifactId>classgrep</artifactId>    <version>1.0</version></dependency>

1.Introduction

classgrep is small java tools, it can find some information as following:
  • find class/annotation/method/field which annotated be special annotation.
  • pass a java.lang.reflect.Method/java.lang.reflect.Constructor object, find all method that calling the passed method or constructor.
  • find all children class whit hierarchy structure according a special

2.Principle

ClassGrep will search all clases at runtime classpath, and also extract all clases from jar or war package. after the process, classgrep will parse each class by asm.

3.Resources

        trunk :
http://git.oschina.net/wensiqun/classgrep
        Sample:ClassGrep Sample (11 downloads)
source code jar package

Maven:

<dependency>    <groupId>com.googlecode.classgrep</groupId>    <artifactId>classgrep</artifactId>    <version>1.0</version></dependency>
原创粉丝点击