Skip to content

Latest commit

 

History

History
54 lines (39 loc) · 1.11 KB

README.md

File metadata and controls

54 lines (39 loc) · 1.11 KB

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.