Class: Archimate::FileFormats::ModelExchangeFileReader21
Overview
This class implements a file reader for ArchiMate 2.1 Model Exchange Format
Instance Method Summary
collapse
#identifier_to_id, #parse, #parse_bendpoints, #parse_bounds, #parse_color, #parse_connections, #parse_diagrams, #parse_documentation, #parse_elements, #parse_font, #parse_model, #parse_nodes, #parse_organizations, #parse_properties, #parse_property, #parse_property_defs, #parse_relationships, #parse_style, #parse_viewpoints
Instance Method Details
#connection_relationship_ref ⇒ Object
53
54
55
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 53
def connection_relationship_ref
"relationshipref"
end
|
#diagrams_path ⇒ Object
41
42
43
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 41
def diagrams_path
">views>view"
end
|
#identifier_ref_name ⇒ Object
37
38
39
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 37
def identifier_ref_name
"identifierref"
end
|
#organizations_root_selector ⇒ Object
17
18
19
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 17
def organizations_root_selector
">organization>item"
end
|
#parse_archimate_version(root) ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 8
def parse_archimate_version(root)
case root.namespace.href
when "http://www.opengroup.org/xsd/archimate"
:archimate_2_1
else
raise "Unexpected namespace: #{root.namespace.href}"
end
end
|
#parse_element_name(el) ⇒ Object
33
34
35
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 33
def parse_element_name(el)
ModelExchangeFile::XmlLangString.parse(el.at_css(">label"))
end
|
#property_def_attr_name ⇒ Object
25
26
27
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 25
def property_def_attr_name
"identifierref"
end
|
#property_def_name(node) ⇒ Object
29
30
31
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 29
def property_def_name(node)
node["name"]
end
|
#property_defs_selector ⇒ Object
21
22
23
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 21
def property_defs_selector
">propertydefs>propertydef"
end
|
#style_to_int(str) ⇒ Object
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 57
def style_to_int(str)
case str
when nil
0
when "italic"
1
when "bold"
2
when "bold|italic"
3
else
raise "Broken for value: #{str}"
end
end
|
#view_node_element_ref ⇒ Object
45
46
47
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 45
def view_node_element_ref
"elementref"
end
|
#view_node_type_attr ⇒ Object
49
50
51
|
# File 'lib/archimate/file_formats/model_exchange_file_reader_21.rb', line 49
def view_node_type_attr
"type"
end
|