1 Star 0 Fork 47

Jianf / asmsupport

forked from Small Warm / asmsupport 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README_EN.md 3.99 KB
一键复制 编辑 原始数据 按行查看 历史

asmsupport

Build Status Coverage Status Maven central openhub Codacy Badge License (LGPL version 3.0)

中文README

Class byte code manipulate library

The asmsupport is a java class byte code manipulate library, it make easier to write or modify a class at runtime. This framework is base on asm framework, but different from asm that avoid use original jvm instruction and avoid maintain stack and local variables.

Modules

Module Description
asmsupport-thrid This modules is a set of third open source code, the benefit is to avoid third library confilict when you use asmsupport.
asmsupport-standard This module is a standard apid definition of asmsupport, you can implement a new framework of asmsupport will be following this standard api.
asmsupport-core This module is the core implement of asmsupport-standard.
asmsupport-client This module is the wrapper of asmsupport-core, and it's also implement the asmsupport-standard api
asmsupport-grammar This module is support to java grammar.
asmsupport-issues This module is all of the test code for each issue test, the benefit of this modules is make the issue never reproduce again when you run 'mvn test'
asmsupport-sample Some simple sample use asmsupport, such as dynamic proxy, json serialize and so on.
asmsupport-lesson This module contains some asmsupport tutorials codes.

Maven Dependency

<dependency>
    <groupId>cn.wensiqun</groupId>
    <artifactId>asmsupport-client</artifactId>
    <version>x.x.x</version>
</dependency>

Features

Different

ASM

BECL

javassist

First Case

The source will using ASMSupport to generate the following code.

public class FirstCase {
    
    public static void main(String[] args) {
        System.out.println("Hello ASMSupport.");
    }
    
}

Class Generate Flow Diagram

Class Generate Flow Diagram

Advanced Sample

Json serialization base on byte code

The JSON sample under the package cn.wensiqun.asmsupport.sample.client.json, run the "cn.wensiqun.asmsupport.sample.client.json.demo.Runner" main method, and you can get the generated class in folder "target/asmsupport-test-generated".

Dynamic Proxy base on byte code

The Proxy sample under the package cn.wensiqun.asmsupport.sample.client.proxy, run the cn.wensiqun.asmsupport.sample.client.proxy.demo.Runner main method, and you can get the generated class in folder "target/asmsupport-test-generated".

License

Asmsupport is licensed under the GNU Lesser General Public License (LGPL)

Java
1
https://gitee.com/fengjf/asmsupport.git
git@gitee.com:fengjf/asmsupport.git
fengjf
asmsupport
asmsupport
master

搜索帮助