---
title: "TargetElement"
description: "Specifies additional properties for an element also annotated with Alias, Delete, Substitute, AnnotateOriginal, or KeepOriginal."
kind: "annotation interface"
id: "com.oracle.svm.core.annotate.TargetElement"
module: "nativeimage"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/nativeimage/com/oracle/svm/core/annotate/TargetElement.html"
---

# @ TargetElement

[nativeimage](../../../../../index.md) › [com.oracle.svm.core.annotate](index.md) · Every page: [llms.txt](../../../../../llms.txt)

Annotation interface in [`com.oracle.svm.core.annotate`](index.md). Since 22.3.

```java
@Retention(RUNTIME)
@Target({METHOD, CONSTRUCTOR, FIELD})
public @interface TargetElement
```

Specifies additional properties for an element also annotated with [`Alias`](Alias.md), [`Delete`](Delete.md), [`Substitute`](Substitute.md), [`AnnotateOriginal`](AnnotateOriginal.md), or [`KeepOriginal`](KeepOriginal.md).

See [`TargetClass`](TargetClass.md) for an overview of the annotation system.

## Fields

### CONSTRUCTOR_NAME
<a id="CONSTRUCTOR_NAME"></a>`String CONSTRUCTOR_NAME`. Since 22.3. Constant value: `"<init>"`. Cite: `com/oracle/svm/core/annotate/TargetElement.html#CONSTRUCTOR_NAME`

## Elements

### name()
<a id="name()"></a>`String name() default ""`. Since 22.3. The name of the field or method in the original class. If the default value is specified for this element, then the name of the annotated field or method is used. To make a reference to a constructor, use the name `CONSTRUCTOR_NAME`. Default: `""`. Cite: `com/oracle/svm/core/annotate/TargetElement.html#name()`

### onlyWith()
<a id="onlyWith()"></a>`Class<?>[] onlyWith() default {com.oracle.svm.core.annotate.TargetClass.AlwaysIncluded.class}`. Since 22.3. Substitute only if all provided predicates are true (default: unconditional substitution that is always included). The classes must either implement [`BooleanSupplier`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/BooleanSupplier.html) or [`Predicate`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html)\<Class\> (the parameter for [`Predicate.test`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html#test%28T%29) is the "original" class as specified by the `TargetClass` annotation, as a [`Class`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Class.html)). Default: `{com.oracle.svm.core.annotate.TargetClass.AlwaysIncluded.class}`. Cite: `com/oracle/svm/core/annotate/TargetElement.html#onlyWith()`
