An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

```text
___ _ _ _ _
| __|__ _ ____ _ /_\ _ _ _ _ ___| |_ __ _| |_(_)___ _ _
| _|/ _` (_-< || |/ _ \| ' \| ' \/ _ \ _/ _` | _| / _ \ ' \
|___\__,_/__/\_, /_/ \_\_||_|_||_\___/\__\__,_|\__|_\___/_||_|
|__/
```

README LANGUAGES [ [**English**](README.md) | [中文](README_CN.md) ]

# EasyAnnotation

[![version](https://img.shields.io/github/v/release/CarmJos/EasyAnnotation)](https://github.com/CarmJos/EasyAnnotation/releases)
[![License](https://img.shields.io/github/license/CarmJos/EasyAnnotation)](https://www.gnu.org/licenses/lgpl-3.0.html)
[![workflow](https://github.com/CarmJos/EasyAnnotation/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/EasyAnnotation/actions/workflows/maven.yml)
[![CodeFactor](https://www.codefactor.io/repository/github/carmjos/EasyAnnotation/badge)](https://www.codefactor.io/repository/github/carmjos/EasyAnnotation)
![CodeSize](https://img.shields.io/github/languages/code-size/CarmJos/EasyAnnotation)
![](https://visitor-badge.glitch.me/badge?page_id=EasyAnnotation.readme)

**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://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](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).