[//]: # (DO NOT EDIT THIS FILE DIRECTLY. Instead, edit the corresponding stub file and execute `npm run docs:api`.)

# <code class="doc-symbol doc-symbol-annotation"></code> `Targets` {#safeds.lang.Targets data-toc-label='[annotation] Targets'}

The annotation must target only the specified declaration types. By default, any declaration type can be targeted.

**Parameters:**

| Name | Type | Description | Default |
|------|------|-------------|---------|
| `targets` | [`List<AnnotationTarget>`][safeds.lang.List] | An exhaustive list of the valid targets. | - |

**Targets:**

- `Annotation`

??? quote "Stub code in `annotationUsage.sdsstub`"

    ```sds linenums="9"
    annotation Targets(
        targets: List<AnnotationTarget>
    )
    ```
    { data-search-exclude }
