https://github.com/zhhaogen/preprocessor
Java预编译宏
https://github.com/zhhaogen/preprocessor
Last synced: about 2 months ago
JSON representation
Java预编译宏
- Host: GitHub
- URL: https://github.com/zhhaogen/preprocessor
- Owner: zhhaogen
- License: mit
- Created: 2019-06-23T16:08:05.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-23T16:38:33.000Z (almost 6 years ago)
- Last Synced: 2023-09-12T23:17:13.151Z (over 1 year ago)
- Language: Java
- Size: 37.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Java预编译宏
## 支持关键字
参见[CompilerConstant](interfaces\src\main\java\cn\zhg\preprocessor\inter\CompilerConstant.java)
* `__LINE__` 行号
* `__COLUMN__`列号
* `__METHOD_NAME__`方法名
* `__CLASS_NAME__`类名
* `__FILE_NAME__`文件名
* `__LOCATION__`当前位置
* `__FILE_PATH__`文件路径
## 例子
参见[demo](demo)
```java
public class SimpleService implements CompilerConstant {
public void sayHello() {
System.out.println("--------------");
System.out.println(__LINE__);
System.out.println("Hello");
System.out.println(__CLASS_NAME__);
System.out.println(__COLUMN__);
System.out.println(__FILE_NAME__);
System.out.println(__FILE_PATH__);
System.out.println(__METHOD_NAME__);
System.out.println(__LOCATION__);
}
}
```
生成结果
