Graalvm Annotations


Лицензия

Лицензия

Категории

Категории

Graal ORM Данные
Группа

Группа

com.formkiq
Идентификатор

Идентификатор

graalvm-annotations
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

Graalvm Annotations
Graalvm Annotations
Ссылка на сайт

Ссылка на сайт

https://github.com/formkiq/graalvm-annotations
Система контроля версий

Система контроля версий

https://github.com/formkiq/graalvm-annotations.git

Скачать graalvm-annotations

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Graalvm Annotations

License

Java Annotations for generating Graalvm ReflectionConfigurationFiles (https://github.com/oracle/graal/blob/master/substratevm/Reflection.md).

Can be used in combination with Gradle Graalvm Annotation Processor.

Annotation Description
@Reflectable Can be applied to a class add the class to Graalvm's list of reflection classes to process, (based on https://github.com/oracle/graal/blob/master/substratevm/Reflection.md).
@ReflectableClass Manually configure Graalvm reflection class (based on https://github.com/oracle/graal/blob/master/substratevm/Reflection.md). Can be used on any class you cannot apply the @Reflectable annotation to.
@ReflectableClasses List of ReflectableClass definitions.
@ReflectableField Used with @ReflectableClass to define Graalvm reflection for a class field.
@ReflectableMethod Used with @ReflectableClass to define Graalvm reflection for a class method.
@ReflectableImport Import existing Graalvm 'ReflectionConfigurationFiles' File.

Maven Installation

Add the following to your pom.xml

    <dependency>
        <groupId>com.formkiq</groupId>
        <artifactId>graalvm-annotations</artifactId>
        <version>1.0.0</version>
        <!-- Replace 1.0.0 with the version you want to use -->
    </dependency>

Gradle Installation

Add the following to your build.gradle

   implementation group: 'com.formkiq', name: 'graalvm-annotations', version:'1.0.0'
   <!-- Replace 1.0.0 with the version you want to use -->

@Reflectable Example

TestObject.java

@Reflectable
class TestObject {

  /** Preset Key. */
  @Reflectable
  private String id;
}

@ReflectableClasses / @ReflectableClass Example

TestObject.java

class TestObject {
  private String foo;
  public void bar(String s) {}
}

Test.java

@ReflectableClasses({
  @ReflectableClass(
    className=TestObject.class,
    allDeclaredConstructors=false,
    fields = {@ReflectableField(allowWrite = true, name = "foo")},
    methods = {@ReflectableMethod(name = "bar", parameterTypes = {"java.lang.String"})}
  )
})
class Test { }

@ReflectableImport classes Example

Test.java

@Reflectable
class TestObject {
  /** Preset Key. */
  @Reflectable
  private String id;
}
@ReflectableImport(classes = {TestObject.class})
class Test { }

@ReflectableImport file Example

test.json

[
  {
    "name": "sample.Test",
    "allDeclaredConstructors": true,
    "allPublicConstructors": true,
    "allDeclaredMethods": true,
    "allPublicMethods": true,
    "fields": [
      {
        "name": "foo"
      }
    ],
    "methods": [
      {
        "name": "bar",
        "parameterTypes": [
          "int"
        ]
      }
    ]
  }
]
}

Test.java

@ReflectableImport(files="test.json")
class Test { }
com.formkiq

Версии библиотеки

Версия
1.0.0