首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Intellij不尊重工具:自定义Spring命名空间中的预期类型批注

Intellij不尊重工具:自定义Spring命名空间中的预期类型批注
EN

Stack Overflow用户
提问于 2012-12-01 14:22:44
回答 2查看 506关注 0票数 2

我创建了一个自定义的Spring命名空间。它在正确部署等方面工作得很好,但是Intellij没有验证bean引用上的tool:expected-type注释(例如,我可以引用任何类型的bean,Intellij不会像它应该的那样用红色突出显示属性),也没有在这些引用上提供任何自动补全。

tool:exports等其他tool特性似乎工作得很好。

Intellij识别我的模式,并提供除预期类型的ref之外的所有其他自动完成功能。

在选择Parse custom bean命令时,Intellij还成功地将自定义元素解析为各种所需的beans。

这是我想要的精简版本,但这是我目前正在尝试的:

代码语言:javascript
复制
<xsd:element name="routed-channel">
    <xsd:annotation>
        <xsd:appinfo>
            <tool:annotation>
                <!-- This part works - other bean refs that require a MessageChannel can reference this channel -->
                <tool:exports type="org.springframework.integration.core.MessageChannel" />
            </tool:annotation>
        </xsd:appinfo>
    </xsd:annotation>
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="recipient" minOccurs="1" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:attribute name="channel" type="xsd:string" use="required">
                        <xsd:annotation>
                            <xsd:appinfo>
                                <tool:annotation kind="ref">
                                    <!-- This part does not work - IntelliJ allows a any reference here -->
                                    <tool:expected-type type="org.springframework.integration.core.MessageChannel" />
                                </tool:annotation>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:attribute>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>
</xsd:element>

我使用的是IntelliJ IDEA v11.1.3。

如果有人能提供一些线索,说明哪里可能出了问题,或者如何修复它,那就太好了。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-09-16 11:29:36

我升级到了IntelliJ 12,这不再是问题。所以答案是:升级IntelliJ!

票数 0
EN

Stack Overflow用户

发布于 2012-12-10 20:41:49

以下是Intellij bugbase中的相关错误报告:http://youtrack.jetbrains.com/issue/IDEA-87187

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13657005

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档