"redeclare="true""是否允许我改变一个子类型的属性类型?

问题描述 投票:1回答:1

如果我有:

<itemtype code="A">
    <attributes>
       <attribute qualifier="attributeA" type="java.lang.String">
         <modifiers .../>
       </attribute>
    </attributes>
</itemtype>

<itemtype code="B" extends="A">
    <attributes>
       <attribute qualifier="attributeA" redeclare="true" type="ATTENTION.HERE">
         <modifiers .../>
       </attribute>
    </attributes>
</itemtype>

如果我使用 "redeclare=true "会怎样?这会让我改变属性的类型吗?例如,我用 "redeclare=true "来代替 type="ATTENTION.HERE",我可以写 type="java.lang.Integer? 如果是的话,这个 "属性A "会不会是类型为 Integer 只针对B?

hybris
1个回答
2
投票

重新声明属性 部中 https:/help.sap.comviewerd0224eca81e249cb821f2cdf45a82ace2005en-US8bffa9cc86691014bb70ac2d012708bc.html。

基本上你只能让它成为父类定义的一个更具体的子类型。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.