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
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorRepresentation.rb', line 18
def self.unpack(hVector, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hVector.empty?
@MessagePath.issueWarning(910, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intVector = intMetadataClass.newVectorInfo
outContext = 'vector representation'
outContext = inContext + ' > ' + outContext unless inContext.nil?
haveVector = false
if hVector.has_key?('topologyLevel')
unless hVector['topologyLevel'] == ''
intVector[:topologyLevel] = hVector['topologyLevel']
haveVector = true
end
end
if hVector.has_key?('vectorObject')
hVector['vectorObject'].each do |item|
hVec = VectorObject.unpack(item, responseObj, outContext)
unless hVec.nil?
intVector[:vectorObject] << hVec
haveVector = true
end
end
end
if hVector.has_key?('scope')
hVector['scope'].each do |item|
scope = Scope.unpack(item, responseObj, outContext)
unless scope.nil?
intVector[:scope] << scope
end
end
end
unless haveVector
@MessagePath.issueError(911, responseObj, inContext)
end
return intVector
end
|