-
Notifications
You must be signed in to change notification settings - Fork 0
/
uAtorXMI.pas
59 lines (42 loc) · 1.41 KB
/
uAtorXMI.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
unit uAtorXMI;
interface
uses uIXMI, XMLIntf, XMLDoc;
type
TAtorXMI = class(TInterfacedObject, iXMI)
private
fid: Integer;
fNome: String;
public
property Id: Integer read fId write fId;
property Nome: String read fNome write fNome;
function gerarTag(pXML: TXMLDocument): IXMLNode;
end;
implementation
uses System.SysUtils;
{ TAtorXMI }
function TAtorXMI.gerarTag(pXML: TXMLDocument): IXMLNode;
var
nodeElemento, nodeAtributo: IXMLNode;
begin
nodeElemento := pXML.CreateNode('UML:Actor', ntElement);
nodeAtributo := pXML.CreateNode('isAbstract', ntAttribute);
nodeAtributo.Text := 'false';
nodeElemento.AttributeNodes.Add(nodeAtributo);
nodeAtributo := pXML.CreateNode('isLeaf', ntAttribute);
nodeAtributo.Text := 'false';
nodeElemento.AttributeNodes.Add(nodeAtributo);
nodeAtributo := pXML.CreateNode('isRoot', ntAttribute);
nodeAtributo.Text := 'false';
nodeElemento.AttributeNodes.Add(nodeAtributo);
nodeAtributo := pXML.CreateNode('isSpecification', ntAttribute);
nodeAtributo.Text := 'false';
nodeElemento.AttributeNodes.Add(nodeAtributo);
nodeAtributo := pXML.CreateNode('name', ntAttribute);
nodeAtributo.Text := Self.Nome;
nodeElemento.AttributeNodes.Add(nodeAtributo);
nodeAtributo := pXML.CreateNode('xmi.id', ntAttribute);
nodeAtributo.Text := IntToStr(Self.Id);
nodeElemento.AttributeNodes.Add(nodeAtributo);
Result := nodeElemento;
end;
end.