在结构搜索中使用参考时,如何过滤其字段? [英] When using a reference in a structural search, how do I filter its fields?
问题描述
在我的找到了如何搜索的所有字段和类型都实现了给定接口的变量情况自动关闭.
I've found how to search for all fields and variables of a type that implements a given interface, in my case AutoCloseable.
我目前的方法是首先为实现AutoCloseable的类创建一个过滤器.通过在接口上添加过滤器,此过滤器源自预定义的过滤器接口的实现器(在层次结构内)".
My current way to do this is first creating a filter for classes that implement AutoCloseable. This filter is derived from the pre-defined filter "implementors of interface (within hierarchy)" by adding a filter on the Interface.
class $Class$ implements $Interface$ {}
,其中$Interface$
用text=AutoCloseable
过滤.
将该过滤器另存为"AutoCloseableFilter"后,我使用了另一个使用它的过滤器:
After saving that filter as "AutoCloseableFilter", I use another filter that uses it:
$FieldType$
,其中$FieldType$
用reference=AutoCloseableFilter
过滤.
可以,但是我希望能够跳过保存该预定义过滤器的特定实例的步骤,而是在将其用作参考时设置其过滤器.
That works, but I'd like to be able to skip the step of saving a specific instance of that pre-defined filter, instead setting its filter when using it as a reference.
换句话说,我想创建一个过滤器,其中$FieldType
被reference=implementors of interface (within hierarchy)
过滤,然后一次性过滤$Interface$
到特定接口.
In other words, I'd like to create a filter where $FieldType
is filtered by reference=implementors of interface (within hierarchy)
and then filtering $Interface$
to a specific interface in one go.
结构搜索有可能吗?
推荐答案
对于您的用例,似乎足以在$FieldType$
上指定文本过滤器而不是引用过滤器.使用文本AutoCloseable
并选中Within type hierarchy
复选框.
For your use case it appears to be enough to specify a text filter on $FieldType$
instead of a reference filter. Use text AutoCloseable
and check the Within type hierarchy
checkbox.
这篇关于在结构搜索中使用参考时,如何过滤其字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!