Xerath - 🔪 AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android🤖

Related tags

Spring Boot Xerath
Overview

简体中文 | English |

Xerath

Xerath 是一个通过 [自定义注解]+ASM + Gradle Transform API 实现的一套功能强大,方便开发,并且能够有效减少重复代码的Android Aop 框架。
旨在编译器进行全局性的修改,来完成一些诸如方法耗时统计,异常收集,拦截,动态代理等特殊需求。
核心思想基于AOP编程,AOP为Aspect Oriented Programming的缩写,意为:面向切面编程。
本项目为AOP思想在Android上的运用与实战,功能部分对标基于AspectJ的开源项目AopArms

引入方式

待上传到Maven,目前可以clone项目然后主动依赖

基本使用

1.统计方法耗时
在目标方法上增加@CalculateTime注解

    @CalculateTime
    public static void CalculateTimeMethod() {
        //do something
    }

2.限制方法频繁调用
在目标方法上增加@Xerath_LimitCall(time = 1000L)注解,其中time为频繁调用的时间阈值

    @Xerath_LimitCall(time = 1000L)
    public static void doubleClick() {
        //do something
    }

3.try-catch异常捕获
在目标方法上增加@TryCatch注解

    @TryCatch
    public static void tryCatchMethod() {
        int a = 1 / 0;
    }

4.方法入参和返回值统计
在目标方法上增加@Xerath_CollectParams

    @Xerath_CollectParams
    public static String testParams(boolean boolParam, byte byteParam, char charParam, short shortParam, int intParam, long longParam,
                                    float floatParam, double doubleParam, String stringParam, int[] intArrParam, JSONObject json) {
        String result = boolParam + " " + byteParam + " " + charParam + " " + shortParam + " " + intParam + " " +
                longParam + " " + floatParam + " " + doubleParam + " " + stringParam + " " + intArrParam.length + json.toString();
        return result;
    }

5 .弹出Toast
在目标方法上增加@Xerath_PopToast注解,其中str为需要显示Toast的内容

    @Xerath_PopToast(str = "测试Toast")
    public static void popToast() {
        //do something
    }

功能列表(补充中)


参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

鸣谢

License

Copyright 2021, Jiang Zhengnan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...

💡极致性能的企业级Java服务器框架,RPC,游戏服务器框架,web应用服务器框架。(Extreme fast enterprise Java server framework, can be RPC, game server framework, web server framework.)

💡极致性能的企业级Java服务器框架,RPC,游戏服务器框架,web应用服务器框架。(Extreme fast enterprise Java server framework, can be RPC, game server framework, web server framework.)

👉 为性能而生的万能服务器框架 👈 Ⅰ. zfoo简介 🚩 性能炸裂,天生异步,Actor设计思想,无锁化设计,基于Spring的MVC式用法的万能RPC框架 极致序列化,原生集成的目前二进制序列化和反序列化速度最快的 zfoo protocol 作为网络通讯协议 高可拓展性,单台服务器部署,

Jan 1, 2023

Log4j CVE-2021-44228 examples: Remote Code Execution (through LDAP, RMI, ...), Forced DNS queries, ...

Log4j CVE-2021-44228 and CVE-2021-45046 Requisites Use a vulnerable JDK, for instance JDK 1.8.0_181 Usage Malicious server The malicious server deploy

Feb 7, 2022

DM Movie is an app with several movies catalogued through a database, you enter your email and your rating of the movie

DM Movie is an app with several movies catalogued through a database, you enter your email and your rating of the movie

DM Movie is an app with several movies catalogued through a database, you enter your email and your rating of the movie

Jan 28, 2022

ijrd - internal java runtime debugger (loads through java agents LOL)

ijrd ijrd - internal java runtime debugger (loads through java agents LOL) this actually requires brain to build and then setup little guide to setup

Jan 28, 2022

Project developed in Block 1 through the Generation bootcamp

Project developed in Block 1 through the Generation bootcamp

PROJETO JAVA - CCHIV COMBATE CONTRA O HIV COMO SURGIU ? É um software criado para facilitar a forma de atender o público de pessoas portadoras do HIV

Jul 5, 2022

The application consists of a web page with a list of some movies. The page allows user interaction through ratings of movies listed in the web app.

The application consists of a web page with a list of some movies. The page allows user interaction through ratings of movies listed in the web app.

DSMovie About the project https://matheus-maia-alvarez-dsmovie.netlify.app/ DSMovie is a full stack web and mobile application built during the Spring

Jul 21, 2022

A custom minimap that displays resources all around you while you adventure through Aeternum!

A custom minimap that displays resources all around you while you adventure through Aeternum!

New-World-MiniMap A custom minimap that displays resources all around you while you adventure through Aeternum! Download Download Page Minimap.rar Oth

Dec 9, 2021

Service that will swap rbtc for btc and then initiated a loopin through lnd-loop

Code https://github.com/grmkris/marduk-admin-frontend https://github.com/grmkris/marduk-admin-backend RSK balances https://wiki.sovryn.app/en/technica

Dec 31, 2021

An extension that wraps a Cellpose environment such that WSI can be analyzed using Cellpose through QuPath.

An extension that wraps a Cellpose environment such that WSI can be analyzed using Cellpose through QuPath.

QuPath Cellpose extension This repo adds some support to use 2D Cellpose within QuPath through a Python virtual environment. Installing Step 1: Instal

Nov 25, 2022
Owner
Pumpkin
@alibaba
Pumpkin
Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml

manifest-guard Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml The problem being solved Every third-par

Daniil Popov 39 Dec 24, 2022
Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Gabriele Rizzo 865 Jan 2, 2023
An annotation-based command framework for Bukkit

Blade Blade is an easy-to-use command framework based on annotations. It currently only supports Bukkit, but it can be easily extended to more platfor

null 40 Nov 6, 2022
Spring JPA Many To Many example with Hibernate and Spring Boot CRUD Rest API - ManyToMany annotation

Spring JPA Many To Many example with Hibernate and Spring Boot CRUD Rest API - ManyToMany annotation

null 17 Dec 28, 2022
Simple Calender App Written in Java , Built with Gradle

Simple Calendar Simple Calendar is an just another open-source Android Calendar application written in java. Features Minimal & Clean Fullfilles needs

Aryan Sinha 2 Dec 3, 2021
A sample microservice built with Spring Boot and Gradle.

Project Overview A sample microservice built with Spring Boot and Gradle. There are APIs built using REST and the resource is bicycle. All CRUD operat

Gordon Mendonsa 1 Feb 2, 2022
A supercharged gradle template for developing Minecraft plugins with multi platform support.

Minecraft Multi-Platform Template You can use this template to develop your own high quality Minecraft plugins for multiple platforms using Gradle wit

sVoxelDev 3 Nov 23, 2022
Share food-Android- - Food donation coded in native android with firebase, google maps api and php server xampp

share_food-Android- Instructions: 1. Create a firebase account and link it with the project via google-services.json. 2. This project also uses a XAMP

Abubakar 3 Dec 28, 2021
A collection of design patterns implemented in Java

Design Patterns A collection of design patterns implemented in Java and referenced from this book: Design Patterns: Elements of Reusable Object-Orient

Karim Elghamry 6 Sep 5, 2022
The Spring Boot Sample App on K8S has been implemented using GKE K8S Cluster, Spring Boot, Maven, and Docker.

gke-springboot-sampleapp ?? The Spring Boot Sample App on K8S has been implemented using GKE K8S Cluster, Spring Boot, Maven, and Docker. Usage To be

KYEONGMIN CHO 1 Feb 1, 2022