https://github.com/carmjos/easyannotation
:bulb: Easy (to use) Annotations! A lightweight, easy-to-use annotation load library in Java, which can use the data values in the annotations in a simple, friendly and expandable way.
https://github.com/carmjos/easyannotation
annotation fastdev java java-library library loader metadata utils
Last synced: 10 months ago
JSON representation
:bulb: Easy (to use) Annotations! A lightweight, easy-to-use annotation load library in Java, which can use the data values in the annotations in a simple, friendly and expandable way.
- Host: GitHub
- URL: https://github.com/carmjos/easyannotation
- Owner: CarmJos
- License: mit
- Created: 2024-01-16T14:23:00.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-11T20:40:43.000Z (about 1 year ago)
- Last Synced: 2025-03-11T21:32:55.781Z (about 1 year ago)
- Topics: annotation, fastdev, java, java-library, library, loader, metadata, utils
- Language: Java
- Homepage: https://carmjos.github.io/EasyAnnotation/
- Size: 322 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
```text
___ _ _ _ _
| __|__ _ ____ _ /_\ _ _ _ _ ___| |_ __ _| |_(_)___ _ _
| _|/ _` (_-< || |/ _ \| ' \| ' \/ _ \ _/ _` | _| / _ \ ' \
|___\__,_/__/\_, /_/ \_\_||_|_||_\___/\__\__,_|\__|_\___/_||_|
|__/
```
README LANGUAGES [ [**English**](README.md) | [中文](README_CN.md) ]
# EasyAnnotation
[](https://github.com/CarmJos/EasyAnnotation/releases)
[](https://www.gnu.org/licenses/lgpl-3.0.html)
[](https://github.com/CarmJos/EasyAnnotation/actions/workflows/maven.yml)
[](https://www.codefactor.io/repository/github/carmjos/EasyAnnotation)


**Easy _(to use)_ Annotations!**
A lightweight, easy-to-use annotation load library in Java,
which can use the data values in the annotations in a simple, friendly and expandable way.
## Development
For the latest JavaDoc release, [CLICK HERE](https://CarmJos.github.io/EasyAnnotation).
### Code Samples
```java
public interface DemoMetas {
/**
* Meta descriptions
*/
AnnotatedMetaType SAYING = AnnotatedMetaType.of(
DemoAnnotation.class, DemoAnnotation::value
);
AnnotatedMetaType SUCCESS = AnnotatedMetaType.of(
DemoAnnotation.class, DemoAnnotation::success
);
AnnotatedMetaType ANNOTATED = AnnotatedMetaType.of(
DemoAnnotation.class, (a) -> true
);
}
```
```java
public class Sample {
public static void main(String[] args) {
// Create a loader
AnnotatedMetaLoader loader = AnnotatedMetaLoader.of(
DemoMetas.ANNOTATED, DemoMetas.SAYING, DemoMetas.SUCCESS
);
// Load from a field
Field field = AnnotationTest.class.getField("SOME_FIELD");
AnnotatedMetaHolder fieldMeta = loader.load(field);
boolean annotated = fieldMeta.get(DemoMetas.ANNOTATED);
// Load from a class
AnnotatedMetaHolder classMeta = loader.load(AnnotationTest.class);
String saying = classMeta.get(DemoMetas.SAYING);
}
}
```
### Dependencies
#### Maven Dependency
Remote Repository Configuration
```xml
maven
Maven Central
https://repo1.maven.org/maven2
github
GitHub Packages
https://maven.pkg.github.com/CarmJos/EasyAnnotation
```
Generic Native Dependency
```xml
cc.carm.lib
easyannotation
[LATEST RELEASE]
compile
```
#### Gradle Dependency
Remote Repository Configuration
```groovy
repositories {
// Using Maven Central Repository for secure and stable updates, though synchronization might be needed.
mavenCentral()
// Using GitHub dependencies for real-time updates, configure required (recommended).
maven { url 'https://maven.pkg.github.com/CarmJos/EasyAnnotation' }
}
```
Generic Native Dependency
```groovy
dependencies {
api "cc.carm.lib:easyannotation:[LATEST RELEASE]"
}
```
## Support and Donation
If you appreciate this plugin, consider supporting me with a donation!
Thank you for supporting open-source projects!
Many thanks to Jetbrains for kindly providing a license for us to work on this and other open-source projects.
[](https://www.jetbrains.com/?from=https://github.com/CarmJos/EasyAnnotation)
## Open Source License
This project's source code is licensed under [The MIT License](https://opensource.org/licenses/MIT).