0
在Enterprise Architect(属性窗口中的属性复选框)中将类属性设置为属性时,是否有方法将getter标记为查询(IsQuery复选框在方法的窗口高级选项卡)默认?这不是默认情况下完成的,因此我必须为每个属性获取器手动执行此操作。如何在Enterprise Architect中默认设置属性获取器查询
在Enterprise Architect(属性窗口中的属性复选框)中将类属性设置为属性时,是否有方法将getter标记为查询(IsQuery复选框在方法的窗口高级选项卡)默认?这不是默认情况下完成的,因此我必须为每个属性获取器手动执行此操作。如何在Enterprise Architect中默认设置属性获取器查询
我不认为有这个选项可以设置,但你可以尝试模板包。
此特殊包用作所有新元素的模板,因此它也可以设置isQuery属性。
如果这不起作用,您可以制作一个小脚本作为解决方法为每个吸气剂设置它。
财产EA.Method.IsQuery
在API中可用。 因此,一个VBScript脚本来更新这可能是类似于
option explicit
!INC Local Scripts.EAConstants-VBScript
'
' Script Name: Set IsQuery Getter
' Author: Geert Bellekens
' Purpose: sets the IsQuery property to true for all operations in the selected package with stereotype "property get"
' Date: 2016-01-22
'
sub main
dim selectedPackage as EA.Package
set selectedPackage = Repository.GetTreeSelectedPackage()
dim element as EA.Element
dim operation as EA.Method
for each element in selectedPackage.Elements
for each operation in element.Methods
if operation.Stereotype = "property get" then
operation.IsQuery = true
operation.Update
end if
next
next
end sub
main
谢谢,我会看看它。 – NapOli1084
模板包似乎不起作用,即使您从拥有该属性的属性中复制属性,您创建的任何新属性都具有不带IsQuery标记的getter。我将不得不看脚本,但由于我还没有做任何可能需要一些时间。 – NapOli1084
我在我的答案中增加了一个小例子脚本。我只是不确定关于“吸气”操作的刻板印象。 –