instanceof ========== .. include:: /ref/targets/autogen/descriptions/instanceof.txt .. contents:: Configuration options --------------------- expression ~~~~~~~~~~ The ``expression`` in the comparison. .. code-block:: yaml search: instanceof: expression: type: "Object" .. code-block:: java :emphasize-lines: 5 void myMethod(Object o, MyClass mo) { if (o instanceof String) { } if (mo instanceof MyOtherClass) { } } checkType ~~~~~~~~~ Checks the type of the class that's being checked inside the ``instanceof`` comparison. .. code-block:: yaml search: instanceof: checkType: "MyClass" .. code-block:: java :emphasize-lines: 5 void myMethod(Object o) { if (o instanceof MyClass) { } if (o instanceof MyOtherClass) { } } .. seealso:: The examples above use shorthands, see :doc:`type` target for more advanced configurations .. include:: /ref/targets/partials/searcher.txt