Skip to content

Annotation Interface TrackCaller

Javadoc 27 generates this reference during each site build from the exported packages and the annotation processor. The Java guide shows the API in use.

@Documented @Retention(RUNTIME) @Target(TYPE) public @interface TrackCaller
Marks a class as a layer over this package, such as a builder in another JVM language, whose frames call sites skip.

The call site of a statement is the innermost frame outside this package. Frames of a class that carries this annotation, or that a class carrying it encloses, are skipped too, so that a statement made through the layer points at the code that called the layer, as Rust's #[track_caller] does. A Kotlin file opts in with @file:TrackCaller.