Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hybris 是";重新声明=";“真的”&引用;允许我更改子类型的属性类型吗?_Hybris - Fatal编程技术网

Hybris 是";重新声明=";“真的”&引用;允许我更改子类型的属性类型吗?

Hybris 是";重新声明=";“真的”&引用;允许我更改子类型的属性类型吗?,hybris,Hybris,如果我有: <itemtype code="A"> <attributes> <attribute qualifier="attributeA" type="java.lang.String"> <modifiers .../> </attribute> </attributes> </itemtype> 及 如果我使用“redeclare=

如果我有:

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


如果我使用“redeclare=true”,会发生什么?这样可以更改属性的类型吗?例如,我是否可以编写
type=“java.lang.Integer
,而不是
type=“ATTENTION.HERE”
?如果是,这个“attributeA”是否仅为B的类型
Integer


基本上,您只能使其成为父类定义的更具体的子类型。

是的,我已经读过了,但我不确定这是否是答案。谢谢:您可以将属性重新声明为:-更改其行为。例如,您可以添加“唯一”标记,或不允许写入。-使属性的类型对于子类型更具体。
<itemtype code="B" extends="A">
    <attributes>
       <attribute qualifier="attributeA" redeclare="true" type="ATTENTION.HERE">
         <modifiers .../>
       </attribute>
    </attributes>
</itemtype>