在结构搜索中使用参考时,如何过滤其字段?

时间:2018-12-13 10:22:53

标签: java intellij-idea structural-search

对于found how to search,我已经实现了实现给定接口的类型的所有字段和变量,以我为例,AutoCloseable

我目前的方法是首先为实现AutoCloseable的类创建一个过滤器。通过在接口上添加过滤器,此过滤器源自预定义的过滤器“接口的实现器(在层次结构内)”。

class $Class$ implements $Interface$ {},其中$Interface$text=AutoCloseable过滤。

将该过滤器另存为“ AutoCloseableFilter”后,我使用了另一个使用它的过滤器:

$FieldType$,其中$FieldType$reference=AutoCloseableFilter过滤。

可以,但是我希望能够跳过保存该预定义过滤器的特定实例的步骤,而是在将其用作参考时设置其过滤器。

换句话说,我想创建一个过滤器,其中$FieldTypereference=implementors of interface (within hierarchy)过滤,然后一次性将$Interface$过滤到特定接口。

结构搜索有可能吗?

1 个答案:

答案 0 :(得分:1)

在您的用例中,似乎足以在$FieldType$上指定文本过滤器而不是引用过滤器。使用文字AutoCloseable,然后选中Within type hierarchy复选框。

structural search dialog example