Skip to content

Commit

Permalink
1、修改文档
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyJingFish committed Oct 23, 2024
1 parent 278c7af commit da4fdfa
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 24 deletions.
8 changes: 8 additions & 0 deletions docs/AndroidAopCollectMethod.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ This aspect collects inherited classes or classes that match regular expressions

> **💡💡💡If the parameter is set to Object or Any, this setting will be ignored, but `regex` must be filled in**
``` mermaid
graph LR
C[C class] ---> |C class inherits from B class| B{ B class };
B --->|B class inherits from A class| A[ A class];
B --->|DIRECT_EXTENDS / EXTENDS| A[ A class];
C ---->|LEAF_EXTENDS / EXTENDS| A[ A class];
```

### regex fill in `Regular expression`

After setting the regular expression, the class name that meets the requirements will be found according to the regular expression you set
Expand Down
8 changes: 8 additions & 0 deletions docs/AndroidAopMatchClassMethod.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ This aspect is used to match a class and its corresponding method. This aspect f
- ```DIRECT_EXTENDS``` means that the match is **<em><strong>directly inherited from</strong></em>** the class set by targetClassName
- ```LEAF_EXTENDS``` means that the match is **<em><strong>Terminal inheritance (no subclasses)</strong></em>** The class set by targetClassName

``` mermaid
graph LR
C[C class] ---> |C class inherits from B class| B{ B class };
B --->|B class inherits from A class| A[ A class];
B --->|DIRECT_EXTENDS / EXTENDS| A[ A class];
C ---->|LEAF_EXTENDS / EXTENDS| A[ A class];
```

Simply put, ```LEAF_EXTENDS``` and ```DIRECT_EXTENDS``` are two extremes. The former focuses on the last node in the inheritance relationship, while the latter focuses on the first node in the inheritance relationship. Also note that ```EXTENDS``` This type of match has a wide range, and all inherited intermediate classes may also add aspect codes

- excludeClasses
Expand Down
8 changes: 8 additions & 0 deletions docs/AndroidAopReplaceClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ This aspect is used to replace the method call in the code, and needs to be used
- ```DIRECT_EXTENDS``` means that the class set by **<em><strong>directly inherited</strong></em>** is matched
- ```LEAF_EXTENDS``` means matching the class set by **<em><strong>terminal inheritance (no subclasses)</strong></em>** value

``` mermaid
graph LR
C[C class] ---> |C class inherits from B class| B{ B class };
B --->|B class inherits from A class| A[ A class];
B --->|DIRECT_EXTENDS / EXTENDS| A[ A class];
C ---->|LEAF_EXTENDS / EXTENDS| A[ A class];
```

In simple terms, ```LEAF_EXTENDS``` and ```DIRECT_EXTENDS``` are two extremes. The former focuses on the last node in the inheritance relationship, while the latter focuses on the first node in the inheritance relationship.

!!! warning
Expand Down
12 changes: 0 additions & 12 deletions docs/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,3 @@
font-weight: bold;
font-size: .5rem
}

@media (prefers-color-scheme: dark) {
.dark-mode-image {
content: url('/AndroidAOP/svg/star_dark.svg');
}
}

@media (prefers-color-scheme: light) {
.dark-mode-image {
content: url('/AndroidAOP/svg/star.svg');
}
}
9 changes: 6 additions & 3 deletions docs/js/header-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ document.addEventListener('DOMContentLoaded', function () {

// 创建 img 元素,指向外部的 SVG 文件
var img = document.createElement('img');
img.src = '/AndroidAOP/svg/star.svg';
img.alt = 'Icon';
img.classList.add('dark-mode-image');
img.src = '/AndroidAOP/svg/star.svg#only-light';
img.alt = 'Star';
label.appendChild(img);
var img1 = document.createElement('img');
img1.src = '/AndroidAOP/svg/star_dark.svg#only-dark';
img1.alt = 'Star';
label.appendChild(img1);
div.appendChild(label);
div.addEventListener('click', function() {
window.location.href = "https://github.com/FlyJingFish/AndroidAOP";
Expand Down
8 changes: 8 additions & 0 deletions docs/zh/AndroidAopCollectMethod.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@

> **💡💡💡如果设置参数为Object或Any时,则此项设置将会被忽略,但是 `regex` 必须要填写**
``` mermaid
graph LR
C[C 类] ---> |C类继承于B类| B{ B 类 };
B --->|B类继承于A类| A[ A 类];
B --->|DIRECT_EXTENDS / EXTENDS| A[ A 类];
C ---->|LEAF_EXTENDS / EXTENDS| A[ A 类];
```


### regex 填写 `正则表达式`

Expand Down
17 changes: 12 additions & 5 deletions docs/zh/AndroidAopMatchClassMethod.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@


- type 有四种类型(不设置默认 ```EXTENDS```):
- ```SELF``` 表示匹配的是 targetClassName 所设置类的**自身**
- ```EXTENDS``` 表示匹配的是**所有继承于** targetClassName 所设置的类
- ```DIRECT_EXTENDS``` 表示匹配的是 **<em><strong>直接继承于</strong></em>** targetClassName 所设置的类
- ```LEAF_EXTENDS``` 表示匹配的是 **<em><strong>末端继承(就是没有子类了)</strong></em>** targetClassName 所设置的类
- ```SELF``` 表示匹配的是 targetClassName 所设置类的 **自身**
- ```EXTENDS``` 表示匹配的是 **所有继承于** targetClassName 所设置的类
- ```DIRECT_EXTENDS``` 表示匹配的是 <em><strong>直接继承于</strong></em> targetClassName 所设置的类
- ```LEAF_EXTENDS``` 表示匹配的是 <em><strong>末端继承(就是没有子类了)</strong></em> targetClassName 所设置的类

简单来说,```LEAF_EXTENDS``````DIRECT_EXTENDS```是两个极端,前者关注的是继承关系中最后一个节点,后者关注的是继承关系中第一个节点。另外注意 ```EXTENDS``` 这种匹配类型范围比较大,所有继承的中间类也可能会加入切面代码


``` mermaid
graph LR
C[C 类] ---> |C类继承于B类| B{ B 类 };
B --->|B类继承于A类| A[ A 类];
B --->|DIRECT_EXTENDS / EXTENDS| A[ A 类];
C ---->|LEAF_EXTENDS / EXTENDS| A[ A 类];
```

- excludeClasses
- 如果 targetClassName 是类名,就是排除掉继承关系中的一些类,可以设置多个,且 type 不是 SELF 才有效
- 如果 targetClassName 是包名,就是排除掉匹配到的一些类,可以设置多个,且 type 是 SELF 才有效
Expand Down
12 changes: 8 additions & 4 deletions docs/zh/AndroidAopReplaceClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@
- ```EXTENDS``` 表示匹配的是**所有继承于** value 所设置的类
- ```DIRECT_EXTENDS``` 表示匹配的是 **<em><strong>直接继承于</strong></em>** value 所设置的类
- ```LEAF_EXTENDS``` 表示匹配的是 **<em><strong>末端继承(就是没有子类了)</strong></em>** value 所设置的类

``` mermaid
graph LR
C[C 类] ---> |C类继承于B类| B{ B 类 };
B --->|B类继承于A类| A[ A 类];
B --->|DIRECT_EXTENDS / EXTENDS| A[ A 类];
C ---->|LEAF_EXTENDS / EXTENDS| A[ A 类];
```

简单来说,```LEAF_EXTENDS``````DIRECT_EXTENDS```是两个极端,前者关注的是继承关系中最后一个节点,后者关注的是继承关系中第一个节点。

```diff
-另外注意 当 type 不是 [SELF] 时会拖慢打包速度,请酌情使用,能不用尽量不用
```



### @AndroidAopReplaceNew
Expand Down

0 comments on commit da4fdfa

Please sign in to comment.