Arthur Logo Apache Geronimo Arthur
  • Apache
  • Documentation
  • Community
  • Downloads
  • ASF
    License Sponsorship Thanks
    Security

Arthur API

Arthur API enables you to mark in your code some Graal metainformation. Under the hood it just uses a meta-extension linked to this specific API.

For more information about extensions, see SPI documentation.

Dependencies

<dependency>
  <groupId>org.apache.geronimo.arthur</groupId>
  <artifactId>arthur-api</artifactId>
  <version>${arthur.version}</version>
</dependency>

Usage

@Register* annotation enables to register reflection and resources on your classes directly.

Example:

@RegisterClass(all = true) (1)
public class All {
    private String name;

    public All() {
        // no-op
    }

    public All(final String name) {
        this.name = name;
    }

    public boolean isAll() {
        return true;
    }
}
1 will register the public constructors, fields and methods as available in the native image.

Previous: Documentation Next: Arthur SPI

Custom annotation marker

You can set extension.annotation.custom.annotations.class to a list of custom annotations set on classes to replace RegisterClass. Exact configuration value follows this pattern: <custom annotation fully qualified name>[:[<RegisterClass attribute>=value]|*]?. A common example is: com.foo.MyAnnot1:all=true,com.foo.MyAnnot2:allPublicMethods=true|allPublicFields=true.

Similarly extension.annotation.custom.annotations.properties enables to configure the same thing but to find classes from marked fields or methods. It is very common with unmanaged @ConfigProperty classes for example.

Copyright © 1999-2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache Geronimo, Geronimo, Apache, the Apache feather logo, and the Apache Geronimo project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.