field ===== .. include:: /ref/targets/autogen/descriptions/field.txt .. contents:: Configuration options --------------------- type ~~~~ Checks the declaration type of the field. .. code-block:: yaml search: field: type: "String" .. code-block:: java :emphasize-lines: 2 class SomeClass { private String example = "test"; } .. seealso:: The examples above use shorthands, see :doc:`type` target for more advanced configurations name ~~~~ Checks the name of the field. .. code-block:: yaml search: field: name: "example" .. code-block:: java :emphasize-lines: 2 class SomeClass { private String example = "test"; } .. seealso:: The examples above use shorthands, see :doc:`string` target for more advanced configurations modifier ~~~~~~~~ Checks if the field contains a modifier that matches the :doc:`string` target. All modifiers are matched separately. To match multiple modifiers, use ``allOf`` or ``anyOf``. .. code-block:: yaml search: field: modifier: "private" .. code-block:: java :emphasize-lines: 2 class SomeClass { private String example = "test"; } example of multiple modifiers .. code-block:: yaml search: field: allOf: - modifier: "public" - modifier: "static" - modifier: "final" .. code-block:: java :emphasize-lines: 2 class SomeClass { public static final String example = "test"; } annotation ~~~~~~~~~~ Checks if the specified annotation is present. This option is configured using the :doc:`annotation` target. .. code-block:: yaml search: field: annotation: "Deprecated" .. code-block:: java :emphasize-lines: 2, 3 class SomeClass { @Deprecated private String example = "test"; } javadoc ~~~~~~~ Checks if the defined field contains a javadoc comment that matches the :doc:`javadoc` target. .. code-block:: yaml search: field: javadoc: contents: matches: ".*example.*" .. code-block:: java :emphasize-lines: 2-5 class Example { /** * this is an example. */ private String example; } .. include:: /ref/targets/partials/searcher.txt