MCPcopy Create free account
hub / github.com/STIXProject/python-stix / buildChildren

Method buildChildren

stix/bindings/incident.py:372–410  ·  view source on GitHub ↗
(self, child_, node, nodeName_, fromsubclass_=False)

Source from the content-addressed store, hash-verified

370 def buildAttributes(self, node, attrs, already_processed):
371 pass
372 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
373 if nodeName_ == 'Direct_Impact_Summary':
374 obj_ = DirectImpactSummaryType.factory()
375 obj_.build(child_)
376 self.set_Direct_Impact_Summary(obj_)
377 elif nodeName_ == 'Indirect_Impact_Summary':
378 obj_ = IndirectImpactSummaryType.factory()
379 obj_.build(child_)
380 self.set_Indirect_Impact_Summary(obj_)
381 elif nodeName_ == 'Total_Loss_Estimation':
382 obj_ = TotalLossEstimationType.factory()
383 obj_.build(child_)
384 self.set_Total_Loss_Estimation(obj_)
385 elif nodeName_ == 'Impact_Qualification':
386 obj_ = stix_common_binding.ControlledVocabularyStringType.factory()
387 obj_.build(child_)
388 self.set_Impact_Qualification(obj_)
389 elif nodeName_ == 'Effects':
390 obj_ = EffectsType.factory()
391 obj_.build(child_)
392 self.set_Effects(obj_)
393 elif nodeName_ == 'External_Impact_Assessment_Model':
394 type_name_ = child_.attrib.get(
395 '{http://www.w3.org/2001/XMLSchema-instance}type')
396 if type_name_ is None:
397 type_name_ = child_.attrib.get('type')
398 if type_name_ is not None:
399 type_names_ = type_name_.split(':')
400 if len(type_names_) == 1:
401 type_name_ = type_names_[0]
402 else:
403 type_name_ = type_names_[1]
404 class_ = globals()[type_name_]
405 obj_ = class_.factory()
406 obj_.build(child_)
407 else:
408 raise NotImplementedError(
409 'Class not implemented for <External_Impact_Assessment_Model> element')
410 self.set_External_Impact_Assessment_Model(obj_)
411# end class ImpactAssessmentType
412
413class ExternalImpactAssessmentModelType(GeneratedsSuper):

Callers 1

buildMethod · 0.95

Calls 8

set_EffectsMethod · 0.95
factoryMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected