Skip to content

Simple component scan in Java to find annotated classes, methods or fields.

License

Notifications You must be signed in to change notification settings

Velocy-Laboratories/java-component-scan

Repository files navigation

java-component-scan

Find annotations inside classed, methods and fields.

Installation

Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>org.velocy</groupId>
    <artifactId>java-component-scan</artifactId>
    <version>{VERSION}</version>
</dependency>

Gradle

repositories {
    maven("https://jitpack.io")
}

dependencies {
    implementation("org.velocy:java-component-scan:{VERSION}")
}

Usage

// Get classes
Set<Class<?>> classes = ComponentScan.of("org.velocy").getAnnotatedClasses(MyAnnotation.class);

// Get methods
Set<Method> methods = ComponentScan.of("org.velocy").getAnnotatedMethods(MyAnnotation.class);

// Get fields 
Set<Field> fields = ComponentScan.of("org.velocy").getAnnotatedFields(MyAnnotation.class);

// Do something with the classes, methods and fields

License

© Velocy Labs; Licensed under the MIT License.

About

Simple component scan in Java to find annotated classes, methods or fields.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages