MCPcopy Index your code
hub / github.com/Auties00/Reified

github.com/Auties00/Reified @reified-1.15

Chat with this repo
repository ↗ · DeepWiki ↗ · release reified-1.15 ↗ · + Follow
138 symbols 348 edges 19 files 0 documented · 0% updated 15mo ago★ 61

Browse by type

Functions 117 Types & classes 21
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Reified

Reified in Java 11 and upwards

What is Reified

Reified is an Annotation for Java 11 and upwards inspired by the reified keyword in Kotlin. Kotlin's approach requires the instruction to also be inlined, excluding as a result classes by design. This library supports also classes instead as inlining is not needed. Reified creates a local variable, or a parameter of type Class for each type parameter annotated. The correct type is deduced and passed to the tree that owns the type variable based on the enclosing statements(ex. return statements and variable declarations) and the type parameters of the invocation. If a non annotated type parameter is needed to determine the type of annotated one, Reified will take care of automatically applying the same process to said parameters to determine the first.

How to install

Maven

Add this dependency to your dependencies in the pom:

<dependencies>
    <dependency>
        <groupId>com.github.auties00</groupId>
        <artifactId>reified</artifactId>
        <version>1.14</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>


17


                <target>17</target>
                <annotationProcessorPaths>
                    <path>
                        <groupId>com.github.auties00</groupId>
                        <artifactId>reified</artifactId>
                        <version>1.14</version>
                    </path>
                </annotationProcessorPaths>
            </configuration>
        </plugin>
    </plugins>
</build>

Gradle

Add this dependency to your build.gradle:

implementation 'com.github.auties00:reified:1.14'
annotationProcessor 'com.github.auties00:reified:1.14'

Plugins

In order to make linting work in your favourite IDE, a plugin is needed.

Most common IDEs: 1. IntelliJ - IntelliJ Marketplace, Source Code 2. Eclipse - Not yet 3. NetBeans - Not yet

Example

With reified:

class JsonUtils {
    private static final ObjectMapper JACKSON = new ObjectMapper();

    public static <@Reified T> T fromJson(String json){
        return JACKSON.readValue(json, T);
    }
}

record ExampleObject(String name) {
    public static ExampleObject fromJson(String json){
        return JsonUtils.fromJson(json);
    }
}

Without reified:

class JsonUtils {
    private static final ObjectMapper JACKSON = new ObjectMapper();

    public static <T> T fromJson(String json, Class<T> clazz){
        return JACKSON.readValue(json, clazz);
    }
}

record ExampleObject(String name) {
    public static ExampleObject fromJson(String json){
        return JsonUtils.fromJson(json, ExampleObject.class);
    }
}

Core symbols most depended-on inside this repo

Shape

Method 117
Class 20
Enum 1

Languages

Java100%

Modules by API surface

src/main/java/it/auties/reified/simplified/SimpleTypes.java31 symbols
src/main/java/it/auties/reified/annotation/ReifiedProcessor.java23 symbols
src/main/java/it/auties/reified/simplified/SimpleMaker.java22 symbols
src/main/java/it/auties/reified/util/IllegalReflection.java11 symbols
src/main/java/it/auties/reified/util/DiagnosticHandlerWorker.java8 symbols
src/main/java/it/auties/reified/simplified/SimpleContext.java6 symbols
src/main/java/it/auties/reified/simplified/SimpleClasses.java6 symbols
src/main/java/it/auties/reified/scanner/ReifiedScanner.java6 symbols
src/main/java/it/auties/reified/scanner/MethodInvocationScanner.java5 symbols
src/main/java/it/auties/reified/scanner/ExtendedClassesScanner.java4 symbols
src/main/java/it/auties/reified/scanner/ArrayInitializationScanner.java4 symbols
src/main/java/it/auties/reified/scanner/ClassInitializationScanner.java3 symbols

For agents

$ claude mcp add Reified \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page