annotation ========== .. include:: /ref/targets/autogen/descriptions/annotation.txt .. contents:: Configuration options --------------------- type ~~~~ Checks the type of the annotation. .. code-block:: yaml search: annotation: type: HttpPost .. code-block:: java :emphasize-lines: 1 @HttpPost public void createUser(UserDTO request) { } .. code-block:: java :emphasize-lines: 1 @my.framework.HttpPost public void createUser(UserDTO request) { } .. seealso:: The examples above use shorthands, see :doc:`type` target for more advanced configurations simplified ~~~~~~~~~~ Checks if the usage of the annotation uses a :term:`simple name`. This is the opposite of using a :term:`fully qualified name`. .. code-block:: yaml search: annotation: simplified: true .. code-block:: java :emphasize-lines: 1 @HttpPost public void createUser(UserDTO request) { } .. code-block:: java @my.framework.HttpPost public void createUser(UserDTO request) { } .. _annotation_owner: owner ~~~~~ Every annotation adds metadata to a definition. This definition is what we call the ``owner`` of the annotation. Usually, this is a :doc:`method` or :doc:`class` and can be defined by their targets respectively. .. code-block:: yaml search: annotation: name: Deprecated owner: method: .. code-block:: java @Deprecated class Example { public void doSomething() { } } .. code-block:: java :emphasize-lines: 2 class Example { @Deprecated public void doSomething() { } } parameters ~~~~~~~~~~ Additional options can be configured when using annotations. These options are often referred to as annotation parameters. This configuration is a list of :doc:`annotationParameter` targets. .. code-block:: yaml search: annotation: parameters: - name: "authorize" value: value: "all" .. code-block:: java :emphasize-lines: 2 class Example { @HttpPost(authorize = "all") public void doSomething() { } } .. include:: /ref/targets/partials/searcher.txt