Package lib :: Package maec :: Module maec11
[hide private]
[frames] | no frames]

Source Code for Module lib.maec.maec11

    1  #!/usr/bin/env python 
    2  # -*- coding: utf-8 -*- 
    3  # Copyright (C) 2010-2014 Cuckoo Foundation. 
    4  # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org 
    5  # See the file 'docs/LICENSE' for copying permission. 
    6   
    7  import sys 
    8  import getopt 
    9  import re as re_ 
   10   
   11  etree_ = None 
   12  Verbose_import_ = False 
   13  (   XMLParser_import_none, XMLParser_import_lxml, 
   14      XMLParser_import_elementtree 
   15      ) = range(3) 
   16  XMLParser_import_library = None 
   17  try: 
   18      # lxml 
   19      from lxml import etree as etree_ 
   20      XMLParser_import_library = XMLParser_import_lxml 
   21      if Verbose_import_: 
   22          print("running with lxml.etree") 
   23  except ImportError: 
   24      try: 
   25          # cElementTree from Python 2.5+ 
   26          import xml.etree.cElementTree as etree_ 
   27          XMLParser_import_library = XMLParser_import_elementtree 
   28          if Verbose_import_: 
   29              print("running with cElementTree on Python 2.5+") 
   30      except ImportError: 
   31          try: 
   32              # ElementTree from Python 2.5+ 
   33              import xml.etree.ElementTree as etree_ 
   34              XMLParser_import_library = XMLParser_import_elementtree 
   35              if Verbose_import_: 
   36                  print("running with ElementTree on Python 2.5+") 
   37          except ImportError: 
   38              try: 
   39                  # normal cElementTree install 
   40                  import cElementTree as etree_ 
   41                  XMLParser_import_library = XMLParser_import_elementtree 
   42                  if Verbose_import_: 
   43                      print("running with cElementTree") 
   44              except ImportError: 
   45                  try: 
   46                      # normal ElementTree install 
   47                      import elementtree.ElementTree as etree_ 
   48                      XMLParser_import_library = XMLParser_import_elementtree 
   49                      if Verbose_import_: 
   50                          print("running with ElementTree") 
   51                  except ImportError: 
   52                      raise ImportError("Failed to import ElementTree from any known place") 
   53   
54 -def parsexml_(*args, **kwargs):
55 if (XMLParser_import_library == XMLParser_import_lxml and 56 'parser' not in kwargs): 57 # Use the lxml ElementTree compatible parser so that, e.g., 58 # we ignore comments. 59 kwargs['parser'] = etree_.ETCompatXMLParser() 60 doc = etree_.parse(*args, **kwargs) 61 return doc
62 63 # 64 # User methods 65 # 66 # Calls to the methods in these classes are generated by generateDS.py. 67 # You can replace these methods by re-implementing the following class 68 # in a module named generatedssuper.py. 69 70 try: 71 from generatedssuper import GeneratedsSuper 72 except ImportError: 73
74 - class GeneratedsSuper(object):
75 - def gds_format_string(self, input_data, input_name=''):
76 return input_data
77 - def gds_validate_string(self, input_data, node, input_name=''):
78 return input_data
79 - def gds_format_integer(self, input_data, input_name=''):
80 return '%d' % input_data
81 - def gds_validate_integer(self, input_data, node, input_name=''):
82 return input_data
83 - def gds_format_integer_list(self, input_data, input_name=''):
84 return '%s' % input_data
85 - def gds_validate_integer_list(self, input_data, node, input_name=''):
86 values = input_data.split() 87 for value in values: 88 try: 89 fvalue = float(value) 90 except (TypeError, ValueError): 91 raise_parse_error(node, 'Requires sequence of integers') 92 return input_data
93 - def gds_format_float(self, input_data, input_name=''):
94 return '%f' % input_data
95 - def gds_validate_float(self, input_data, node, input_name=''):
96 return input_data
97 - def gds_format_float_list(self, input_data, input_name=''):
98 return '%s' % input_data
99 - def gds_validate_float_list(self, input_data, node, input_name=''):
100 values = input_data.split() 101 for value in values: 102 try: 103 fvalue = float(value) 104 except (TypeError, ValueError): 105 raise_parse_error(node, 'Requires sequence of floats') 106 return input_data
107 - def gds_format_double(self, input_data, input_name=''):
108 return '%e' % input_data
109 - def gds_validate_double(self, input_data, node, input_name=''):
110 return input_data
111 - def gds_format_double_list(self, input_data, input_name=''):
112 return '%s' % input_data
113 - def gds_validate_double_list(self, input_data, node, input_name=''):
114 values = input_data.split() 115 for value in values: 116 try: 117 fvalue = float(value) 118 except (TypeError, ValueError): 119 raise_parse_error(node, 'Requires sequence of doubles') 120 return input_data
121 - def gds_format_boolean(self, input_data, input_name=''):
122 return '%s' % input_data
123 - def gds_validate_boolean(self, input_data, node, input_name=''):
124 return input_data
125 - def gds_format_boolean_list(self, input_data, input_name=''):
126 return '%s' % input_data
127 - def gds_validate_boolean_list(self, input_data, node, input_name=''):
128 values = input_data.split() 129 for value in values: 130 if value not in ('true', '1', 'false', '0', ): 131 raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') 132 return input_data
133 - def gds_str_lower(self, instring):
134 return instring.lower()
135 - def get_path_(self, node):
136 path_list = [] 137 self.get_path_list_(node, path_list) 138 path_list.reverse() 139 path = '/'.join(path_list) 140 return path
141 Tag_strip_pattern_ = re_.compile(r'\{.*\}')
142 - def get_path_list_(self, node, path_list):
143 if node is None: 144 return 145 tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) 146 if tag: 147 path_list.append(tag) 148 self.get_path_list_(node.getparent(), path_list)
149 - def get_class_obj_(self, node, default_class=None):
150 class_obj1 = default_class 151 if 'xsi' in node.nsmap: 152 classname = node.get('{%s}type' % node.nsmap['xsi']) 153 if classname is not None: 154 names = classname.split(':') 155 if len(names) == 2: 156 classname = names[1] 157 class_obj2 = globals().get(classname) 158 if class_obj2 is not None: 159 class_obj1 = class_obj2 160 return class_obj1
161 - def gds_build_any(self, node, type_name=None):
162 return None
163 164 165 # 166 # If you have installed IPython you can uncomment and use the following. 167 # IPython is available from http://ipython.scipy.org/. 168 # 169 170 ## from IPython.Shell import IPShellEmbed 171 ## args = '' 172 ## ipshell = IPShellEmbed(args, 173 ## banner = 'Dropping into IPython', 174 ## exit_msg = 'Leaving Interpreter, back to program.') 175 176 # Then use the following line where and when you want to drop into the 177 # IPython shell: 178 # ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit') 179 180 # 181 # Globals 182 # 183 184 ExternalEncoding = 'ascii' 185 Tag_pattern_ = re_.compile(r'({.*})?(.*)') 186 String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") 187 Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') 188 189 # 190 # Support/utility functions. 191 # 192
193 -def showIndent(outfile, level):
194 for idx in range(level): 195 outfile.write(' ')
196
197 -def quote_xml(inStr):
198 if not inStr: 199 return '' 200 s1 = (isinstance(inStr, basestring) and inStr or 201 '%s' % inStr) 202 s1 = s1.replace('&', '&amp;') 203 s1 = s1.replace('<', '&lt;') 204 s1 = s1.replace('>', '&gt;') 205 return s1
206
207 -def quote_attrib(inStr):
208 s1 = (isinstance(inStr, basestring) and inStr or 209 '%s' % inStr) 210 s1 = s1.replace('&', '&amp;') 211 s1 = s1.replace('<', '&lt;') 212 s1 = s1.replace('>', '&gt;') 213 if '"' in s1: 214 if "'" in s1: 215 s1 = '"%s"' % s1.replace('"', "&quot;") 216 else: 217 s1 = "'%s'" % s1 218 else: 219 s1 = '"%s"' % s1 220 return s1
221
222 -def quote_python(inStr):
223 s1 = inStr 224 if s1.find("'") == -1: 225 if s1.find('\n') == -1: 226 return "'%s'" % s1 227 else: 228 return "'''%s'''" % s1 229 else: 230 if s1.find('"') != -1: 231 s1 = s1.replace('"', '\\"') 232 if s1.find('\n') == -1: 233 return '"%s"' % s1 234 else: 235 return '"""%s"""' % s1
236
237 -def get_all_text_(node):
238 if node.text is not None: 239 text = node.text 240 else: 241 text = '' 242 for child in node: 243 if child.tail is not None: 244 text += child.tail 245 return text
246
247 -def find_attr_value_(attr_name, node):
248 attrs = node.attrib 249 attr_parts = attr_name.split(':') 250 value = None 251 if len(attr_parts) == 1: 252 value = attrs.get(attr_name) 253 elif len(attr_parts) == 2: 254 prefix, name = attr_parts 255 namespace = node.nsmap.get(prefix) 256 if namespace is not None: 257 value = attrs.get('{%s}%s' % (namespace, name, )) 258 return value
259 260
261 -class GDSParseError(Exception):
262 pass
263
264 -def raise_parse_error(node, msg):
265 if XMLParser_import_library == XMLParser_import_lxml: 266 msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) 267 else: 268 msg = '%s (element %s)' % (msg, node.tag, ) 269 raise GDSParseError(msg)
270 271
272 -class MixedContainer:
273 # Constants for category: 274 CategoryNone = 0 275 CategoryText = 1 276 CategorySimple = 2 277 CategoryComplex = 3 278 # Constants for content_type: 279 TypeNone = 0 280 TypeText = 1 281 TypeString = 2 282 TypeInteger = 3 283 TypeFloat = 4 284 TypeDecimal = 5 285 TypeDouble = 6 286 TypeBoolean = 7
287 - def __init__(self, category, content_type, name, value):
288 self.category = category 289 self.content_type = content_type 290 self.name = name 291 self.value = value
292 - def getCategory(self):
293 return self.category
294 - def getContenttype(self, content_type):
295 return self.content_type
296 - def getValue(self):
297 return self.value
298 - def getName(self):
299 return self.name
300 - def export(self, outfile, level, name, namespace):
301 if self.category == MixedContainer.CategoryText: 302 # Prevent exporting empty content as empty lines. 303 if self.value.strip(): 304 outfile.write(self.value) 305 elif self.category == MixedContainer.CategorySimple: 306 self.exportSimple(outfile, level, name) 307 else: # category == MixedContainer.CategoryComplex 308 self.value.export(outfile, level, namespace,name)
309 - def exportSimple(self, outfile, level, name):
310 if self.content_type == MixedContainer.TypeString: 311 outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name)) 312 elif self.content_type == MixedContainer.TypeInteger or \ 313 self.content_type == MixedContainer.TypeBoolean: 314 outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name)) 315 elif self.content_type == MixedContainer.TypeFloat or \ 316 self.content_type == MixedContainer.TypeDecimal: 317 outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name)) 318 elif self.content_type == MixedContainer.TypeDouble: 319 outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))
320 - def exportLiteral(self, outfile, level, name):
321 if self.category == MixedContainer.CategoryText: 322 showIndent(outfile, level) 323 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ 324 (self.category, self.content_type, self.name, self.value)) 325 elif self.category == MixedContainer.CategorySimple: 326 showIndent(outfile, level) 327 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ 328 (self.category, self.content_type, self.name, self.value)) 329 else: # category == MixedContainer.CategoryComplex 330 showIndent(outfile, level) 331 outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ 332 (self.category, self.content_type, self.name,)) 333 self.value.exportLiteral(outfile, level + 1) 334 showIndent(outfile, level) 335 outfile.write(')\n')
336 337
338 -class MemberSpec_(object):
339 - def __init__(self, name='', data_type='', container=0):
340 self.name = name 341 self.data_type = data_type 342 self.container = container
343 - def set_name(self, name): self.name = name
344 - def get_name(self): return self.name
345 - def set_data_type(self, data_type): self.data_type = data_type
346 - def get_data_type_chain(self): return self.data_type
347 - def get_data_type(self):
348 if isinstance(self.data_type, list): 349 if len(self.data_type) > 0: 350 return self.data_type[-1] 351 else: 352 return 'xs:string' 353 else: 354 return self.data_type
355 - def set_container(self, container): self.container = container
356 - def get_container(self): return self.container
357
358 -def _cast(typ, value):
359 if typ is None or value is None: 360 return value 361 return typ(value)
362 363 # 364 # Data representation classes. 365 # 366
367 -class BundleType(GeneratedsSuper):
368 """BundleType is intended to serve as the high-level construct under 369 which all other MAEC elements reside. The required 370 schema_version attribute specifies the version of the MAEC 371 Schema that the document has been written in and that should be 372 used for validation.""" 373 subclass = None 374 superclass = None
375 - def __init__(self, id=None, schema_version=None, Analyses=None, Behaviors=None, Actions=None, Pools=None):
376 self.id = _cast(None, id) 377 self.schema_version = _cast(float, schema_version) 378 self.Analyses = Analyses 379 self.Behaviors = Behaviors 380 self.Actions = Actions 381 self.Pools = Pools
382 - def factory(*args_, **kwargs_):
383 if BundleType.subclass: 384 return BundleType.subclass(*args_, **kwargs_) 385 else: 386 return BundleType(*args_, **kwargs_)
387 factory = staticmethod(factory)
388 - def get_Analyses(self): return self.Analyses
389 - def set_Analyses(self, Analyses): self.Analyses = Analyses
390 - def get_Behaviors(self): return self.Behaviors
391 - def set_Behaviors(self, Behaviors): self.Behaviors = Behaviors
392 - def get_Actions(self): return self.Actions
393 - def set_Actions(self, Actions): self.Actions = Actions
394 - def get_Pools(self): return self.Pools
395 - def set_Pools(self, Pools): self.Pools = Pools
396 - def get_id(self): return self.id
397 - def set_id(self, id): self.id = id
398 - def get_schema_version(self): return self.schema_version
399 - def set_schema_version(self, schema_version): self.schema_version = schema_version
400 - def export(self, outfile, level, namespace_='maec:', name_='BundleType', namespacedef_=''):
401 showIndent(outfile, level) 402 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 403 already_processed = [] 404 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BundleType') 405 if self.hasContent_(): 406 outfile.write('>\n') 407 self.exportChildren(outfile, level + 1, namespace_, name_) 408 showIndent(outfile, level) 409 outfile.write('</%s%s>\n' % (namespace_, name_)) 410 else: 411 outfile.write('/>\n')
412 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BundleType'):
413 if self.id is not None and 'id' not in already_processed: 414 already_processed.append('id') 415 outfile.write(' id=%s' % (quote_attrib(self.id), )) 416 if self.schema_version is not None and 'schema_version' not in already_processed: 417 already_processed.append('schema_version') 418 outfile.write(' schema_version="%s"' % self.gds_format_float(self.schema_version, input_name='schema_version'))
419 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BundleType', fromsubclass_=False):
420 if self.Analyses is not None: 421 self.Analyses.export(outfile, level, namespace_, name_='Analyses') 422 if self.Behaviors is not None: 423 self.Behaviors.export(outfile, level, namespace_, name_='Behaviors') 424 if self.Actions is not None: 425 self.Actions.export(outfile, level, namespace_, name_='Actions') 426 if self.Pools is not None: 427 self.Pools.export(outfile, level, namespace_, name_='Pools')
428 - def hasContent_(self):
429 if ( 430 self.Analyses is not None or 431 self.Behaviors is not None or 432 self.Actions is not None or 433 self.Pools is not None 434 ): 435 return True 436 else: 437 return False
438 - def exportLiteral(self, outfile, level, name_='BundleType'):
439 level += 1 440 self.exportLiteralAttributes(outfile, level, [], name_) 441 if self.hasContent_(): 442 self.exportLiteralChildren(outfile, level, name_)
443 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
444 if self.id is not None and 'id' not in already_processed: 445 already_processed.append('id') 446 showIndent(outfile, level) 447 outfile.write('id = %s,\n' % (self.id,)) 448 if self.schema_version is not None and 'schema_version' not in already_processed: 449 already_processed.append('schema_version') 450 showIndent(outfile, level) 451 outfile.write('schema_version = %f,\n' % (self.schema_version,))
452 - def exportLiteralChildren(self, outfile, level, name_):
453 if self.Analyses is not None: 454 showIndent(outfile, level) 455 outfile.write('Analyses=model_.AnalysesType(\n') 456 self.Analyses.exportLiteral(outfile, level, name_='Analyses') 457 showIndent(outfile, level) 458 outfile.write('),\n') 459 if self.Behaviors is not None: 460 showIndent(outfile, level) 461 outfile.write('Behaviors=model_.BehaviorsType(\n') 462 self.Behaviors.exportLiteral(outfile, level, name_='Behaviors') 463 showIndent(outfile, level) 464 outfile.write('),\n') 465 if self.Actions is not None: 466 showIndent(outfile, level) 467 outfile.write('Actions=model_.ActionsType(\n') 468 self.Actions.exportLiteral(outfile, level, name_='Actions') 469 showIndent(outfile, level) 470 outfile.write('),\n') 471 if self.Pools is not None: 472 showIndent(outfile, level) 473 outfile.write('Pools=model_.PoolsType(\n') 474 self.Pools.exportLiteral(outfile, level, name_='Pools') 475 showIndent(outfile, level) 476 outfile.write('),\n')
477 - def build(self, node):
478 self.buildAttributes(node, node.attrib, []) 479 for child in node: 480 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 481 self.buildChildren(child, node, nodeName_)
482 - def buildAttributes(self, node, attrs, already_processed):
483 value = find_attr_value_('id', node) 484 if value is not None and 'id' not in already_processed: 485 already_processed.append('id') 486 self.id = value 487 value = find_attr_value_('schema_version', node) 488 if value is not None and 'schema_version' not in already_processed: 489 already_processed.append('schema_version') 490 try: 491 self.schema_version = float(value) 492 except ValueError as e: 493 raise ValueError('Bad float/double attribute (schema_version): %s' % e)
494 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
495 if nodeName_ == 'Analyses': 496 obj_ = AnalysesType.factory() 497 obj_.build(child_) 498 self.set_Analyses(obj_) 499 elif nodeName_ == 'Behaviors': 500 obj_ = BehaviorsType.factory() 501 obj_.build(child_) 502 self.set_Behaviors(obj_) 503 elif nodeName_ == 'Actions': 504 obj_ = ActionsType.factory() 505 obj_.build(child_) 506 self.set_Actions(obj_) 507 elif nodeName_ == 'Pools': 508 obj_ = PoolsType.factory() 509 obj_.build(child_) 510 self.set_Pools(obj_)
511 # end class BundleType 512 513
514 -class BehaviorCollectionType(GeneratedsSuper):
515 """BehaviorCollectionType is intended to provide a mechanism for 516 characterizing collections of behaviors.The name attribute 517 contains the name of the behavior collection, if applicable.""" 518 subclass = None 519 superclass = None
520 - def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Purpose=None, Description=None, Effects=None, Behavior_Sub_Collection=None, Behavior=None, Behavior_Reference=None):
521 self.id = _cast(None, id) 522 self.name = _cast(None, name) 523 self.Affinity_Type = Affinity_Type 524 self.Affinity_Degree = Affinity_Degree 525 self.Purpose = Purpose 526 self.Description = Description 527 self.Effects = Effects 528 if Behavior_Sub_Collection is None: 529 self.Behavior_Sub_Collection = [] 530 else: 531 self.Behavior_Sub_Collection = Behavior_Sub_Collection 532 if Behavior is None: 533 self.Behavior = [] 534 else: 535 self.Behavior = Behavior 536 if Behavior_Reference is None: 537 self.Behavior_Reference = [] 538 else: 539 self.Behavior_Reference = Behavior_Reference
540 - def factory(*args_, **kwargs_):
541 if BehaviorCollectionType.subclass: 542 return BehaviorCollectionType.subclass(*args_, **kwargs_) 543 else: 544 return BehaviorCollectionType(*args_, **kwargs_)
545 factory = staticmethod(factory)
546 - def get_Affinity_Type(self): return self.Affinity_Type
547 - def set_Affinity_Type(self, Affinity_Type): self.Affinity_Type = Affinity_Type
548 - def get_Affinity_Degree(self): return self.Affinity_Degree
549 - def set_Affinity_Degree(self, Affinity_Degree): self.Affinity_Degree = Affinity_Degree
550 - def get_Purpose(self): return self.Purpose
551 - def set_Purpose(self, Purpose): self.Purpose = Purpose
552 - def get_Description(self): return self.Description
553 - def set_Description(self, Description): self.Description = Description
554 - def get_Effects(self): return self.Effects
555 - def set_Effects(self, Effects): self.Effects = Effects
556 - def get_Behavior_Sub_Collection(self): return self.Behavior_Sub_Collection
557 - def set_Behavior_Sub_Collection(self, Behavior_Sub_Collection): self.Behavior_Sub_Collection = Behavior_Sub_Collection
558 - def add_Behavior_Sub_Collection(self, value): self.Behavior_Sub_Collection.append(value)
559 - def insert_Behavior_Sub_Collection(self, index, value): self.Behavior_Sub_Collection[index] = value
560 - def get_Behavior(self): return self.Behavior
561 - def set_Behavior(self, Behavior): self.Behavior = Behavior
562 - def add_Behavior(self, value): self.Behavior.append(value)
563 - def insert_Behavior(self, index, value): self.Behavior[index] = value
564 - def get_Behavior_Reference(self): return self.Behavior_Reference
565 - def set_Behavior_Reference(self, Behavior_Reference): self.Behavior_Reference = Behavior_Reference
566 - def add_Behavior_Reference(self, value): self.Behavior_Reference.append(value)
567 - def insert_Behavior_Reference(self, index, value): self.Behavior_Reference[index] = value
568 - def get_id(self): return self.id
569 - def set_id(self, id): self.id = id
570 - def get_name(self): return self.name
571 - def set_name(self, name): self.name = name
572 - def export(self, outfile, level, namespace_='maec:', name_='BehaviorCollectionType', namespacedef_=''):
573 showIndent(outfile, level) 574 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 575 already_processed = [] 576 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BehaviorCollectionType') 577 if self.hasContent_(): 578 outfile.write('>\n') 579 self.exportChildren(outfile, level + 1, namespace_, name_) 580 showIndent(outfile, level) 581 outfile.write('</%s%s>\n' % (namespace_, name_)) 582 else: 583 outfile.write('/>\n')
584 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorCollectionType'):
585 if self.id is not None and 'id' not in already_processed: 586 already_processed.append('id') 587 outfile.write(' id=%s' % (quote_attrib(self.id), )) 588 if self.name is not None and 'name' not in already_processed: 589 already_processed.append('name') 590 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
591 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BehaviorCollectionType', fromsubclass_=False):
592 if self.Affinity_Type is not None: 593 showIndent(outfile, level) 594 outfile.write('<%sAffinity_Type>%s</%sAffinity_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Type).encode(ExternalEncoding), input_name='Affinity_Type'), namespace_)) 595 if self.Affinity_Degree is not None: 596 showIndent(outfile, level) 597 outfile.write('<%sAffinity_Degree>%s</%sAffinity_Degree>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Degree).encode(ExternalEncoding), input_name='Affinity_Degree'), namespace_)) 598 if self.Purpose is not None: 599 showIndent(outfile, level) 600 outfile.write('<%sPurpose>%s</%sPurpose>\n' % (namespace_, self.gds_format_string(quote_xml(self.Purpose).encode(ExternalEncoding), input_name='Purpose'), namespace_)) 601 if self.Description is not None: 602 self.Description.export(outfile, level, namespace_, name_='Description') 603 if self.Effects is not None: 604 self.Effects.export(outfile, level, namespace_, name_='Effects') 605 for Behavior_Sub_Collection_ in self.Behavior_Sub_Collection: 606 Behavior_Sub_Collection_.export(outfile, level, namespace_, name_='Behavior_Sub_Collection') 607 for Behavior_ in self.Behavior: 608 Behavior_.export(outfile, level, namespace_, name_='Behavior') 609 for Behavior_Reference_ in self.Behavior_Reference: 610 Behavior_Reference_.export(outfile, level, namespace_, name_='Behavior_Reference')
611 - def hasContent_(self):
612 if ( 613 self.Affinity_Type is not None or 614 self.Affinity_Degree is not None or 615 self.Purpose is not None or 616 self.Description is not None or 617 self.Effects is not None or 618 self.Behavior_Sub_Collection or 619 self.Behavior or 620 self.Behavior_Reference 621 ): 622 return True 623 else: 624 return False
625 - def exportLiteral(self, outfile, level, name_='BehaviorCollectionType'):
626 level += 1 627 self.exportLiteralAttributes(outfile, level, [], name_) 628 if self.hasContent_(): 629 self.exportLiteralChildren(outfile, level, name_)
630 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
631 if self.id is not None and 'id' not in already_processed: 632 already_processed.append('id') 633 showIndent(outfile, level) 634 outfile.write('id = %s,\n' % (self.id,)) 635 if self.name is not None and 'name' not in already_processed: 636 already_processed.append('name') 637 showIndent(outfile, level) 638 outfile.write('name = "%s",\n' % (self.name,))
639 - def exportLiteralChildren(self, outfile, level, name_):
640 if self.Affinity_Type is not None: 641 showIndent(outfile, level) 642 outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding)) 643 if self.Affinity_Degree is not None: 644 showIndent(outfile, level) 645 outfile.write('Affinity_Degree=%s,\n' % quote_python(self.Affinity_Degree).encode(ExternalEncoding)) 646 if self.Purpose is not None: 647 showIndent(outfile, level) 648 outfile.write('Purpose=%s,\n' % quote_python(self.Purpose).encode(ExternalEncoding)) 649 if self.Description is not None: 650 showIndent(outfile, level) 651 outfile.write('Description=model_.StructuredTextType(\n') 652 self.Description.exportLiteral(outfile, level, name_='Description') 653 showIndent(outfile, level) 654 outfile.write('),\n') 655 if self.Effects is not None: 656 showIndent(outfile, level) 657 outfile.write('Effects=model_.EffectsType(\n') 658 self.Effects.exportLiteral(outfile, level, name_='Effects') 659 showIndent(outfile, level) 660 outfile.write('),\n') 661 showIndent(outfile, level) 662 outfile.write('Behavior_Sub_Collection=[\n') 663 level += 1 664 for Behavior_Sub_Collection_ in self.Behavior_Sub_Collection: 665 showIndent(outfile, level) 666 outfile.write('model_.BehaviorCollectionType(\n') 667 Behavior_Sub_Collection_.exportLiteral(outfile, level, name_='BehaviorCollectionType') 668 showIndent(outfile, level) 669 outfile.write('),\n') 670 level -= 1 671 showIndent(outfile, level) 672 outfile.write('],\n') 673 showIndent(outfile, level) 674 outfile.write('Behavior=[\n') 675 level += 1 676 for Behavior_ in self.Behavior: 677 showIndent(outfile, level) 678 outfile.write('model_.BehaviorType(\n') 679 Behavior_.exportLiteral(outfile, level, name_='BehaviorType') 680 showIndent(outfile, level) 681 outfile.write('),\n') 682 level -= 1 683 showIndent(outfile, level) 684 outfile.write('],\n') 685 showIndent(outfile, level) 686 outfile.write('Behavior_Reference=[\n') 687 level += 1 688 for Behavior_Reference_ in self.Behavior_Reference: 689 showIndent(outfile, level) 690 outfile.write('model_.BehaviorReferenceType(\n') 691 Behavior_Reference_.exportLiteral(outfile, level, name_='BehaviorReferenceType') 692 showIndent(outfile, level) 693 outfile.write('),\n') 694 level -= 1 695 showIndent(outfile, level) 696 outfile.write('],\n')
697 - def build(self, node):
698 self.buildAttributes(node, node.attrib, []) 699 for child in node: 700 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 701 self.buildChildren(child, node, nodeName_)
702 - def buildAttributes(self, node, attrs, already_processed):
703 value = find_attr_value_('id', node) 704 if value is not None and 'id' not in already_processed: 705 already_processed.append('id') 706 self.id = value 707 value = find_attr_value_('name', node) 708 if value is not None and 'name' not in already_processed: 709 already_processed.append('name') 710 self.name = value
711 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
712 if nodeName_ == 'Affinity_Type': 713 Affinity_Type_ = child_.text 714 Affinity_Type_ = self.gds_validate_string(Affinity_Type_, node, 'Affinity_Type') 715 self.Affinity_Type = Affinity_Type_ 716 elif nodeName_ == 'Affinity_Degree': 717 Affinity_Degree_ = child_.text 718 Affinity_Degree_ = self.gds_validate_string(Affinity_Degree_, node, 'Affinity_Degree') 719 self.Affinity_Degree = Affinity_Degree_ 720 elif nodeName_ == 'Purpose': 721 Purpose_ = child_.text 722 Purpose_ = self.gds_validate_string(Purpose_, node, 'Purpose') 723 self.Purpose = Purpose_ 724 elif nodeName_ == 'Description': 725 obj_ = StructuredTextType.factory() 726 obj_.build(child_) 727 self.set_Description(obj_) 728 elif nodeName_ == 'Effects': 729 obj_ = EffectsType.factory() 730 obj_.build(child_) 731 self.set_Effects(obj_) 732 elif nodeName_ == 'Behavior_Sub_Collection': 733 obj_ = BehaviorCollectionType.factory() 734 obj_.build(child_) 735 self.Behavior_Sub_Collection.append(obj_) 736 elif nodeName_ == 'Behavior': 737 obj_ = BehaviorType.factory() 738 obj_.build(child_) 739 self.Behavior.append(obj_) 740 elif nodeName_ == 'Behavior_Reference': 741 obj_ = BehaviorReferenceType.factory() 742 obj_.build(child_) 743 self.Behavior_Reference.append(obj_)
744 # end class BehaviorCollectionType 745 746
747 -class BehaviorType(GeneratedsSuper):
748 """BehaviorType is intended to serve as a method for the 749 characterization of malicious behaviors found or observed in 750 malware. Behaviors can be thought of as representing the purpose 751 behind groups of MAEC actions, and are therefore representative 752 of distinct portions of higher-level malware functionality. 753 Thus, while a malware instance may perform some thousands of 754 actions, it is likely that these actions represent only a few 755 dozen distinct behaviors. Some examples include vulnerability 756 exploitation, email address harvesting, and the disabling of a 757 security service.The ordinal_position attribute is intended to 758 reference the ordinal position of the behavior with respect to 759 the execution of the malware.The successful attribute is used to 760 describe whether the behavior was successful or not.The duration 761 attribute represents the duration of the behavior. Such a value 762 may be derived by calculating the difference between the 763 timestamps of the first and last actions that compose the 764 behavior.""" 765 subclass = None 766 superclass = None
767 - def __init__(self, successful=None, duration=None, ordinal_position=None, id=None, Purpose=None, Description=None, Discovery_Method=None, Actions=None, Objects=None, Effects=None, Related_Behaviors=None):
768 self.successful = _cast(bool, successful) 769 self.duration = _cast(None, duration) 770 self.ordinal_position = _cast(int, ordinal_position) 771 self.id = _cast(None, id) 772 self.Purpose = Purpose 773 self.Description = Description 774 self.Discovery_Method = Discovery_Method 775 self.Actions = Actions 776 self.Objects = Objects 777 self.Effects = Effects 778 self.Related_Behaviors = Related_Behaviors
779 - def factory(*args_, **kwargs_):
780 if BehaviorType.subclass: 781 return BehaviorType.subclass(*args_, **kwargs_) 782 else: 783 return BehaviorType(*args_, **kwargs_)
784 factory = staticmethod(factory)
785 - def get_Purpose(self): return self.Purpose
786 - def set_Purpose(self, Purpose): self.Purpose = Purpose
787 - def get_Description(self): return self.Description
788 - def set_Description(self, Description): self.Description = Description
789 - def get_Discovery_Method(self): return self.Discovery_Method
790 - def set_Discovery_Method(self, Discovery_Method): self.Discovery_Method = Discovery_Method
791 - def get_Actions(self): return self.Actions
792 - def set_Actions(self, Actions): self.Actions = Actions
793 - def get_Objects(self): return self.Objects
794 - def set_Objects(self, Objects): self.Objects = Objects
795 - def get_Effects(self): return self.Effects
796 - def set_Effects(self, Effects): self.Effects = Effects
799 - def get_successful(self): return self.successful
800 - def set_successful(self, successful): self.successful = successful
801 - def get_duration(self): return self.duration
802 - def set_duration(self, duration): self.duration = duration
803 - def get_ordinal_position(self): return self.ordinal_position
804 - def set_ordinal_position(self, ordinal_position): self.ordinal_position = ordinal_position
805 - def get_id(self): return self.id
806 - def set_id(self, id): self.id = id
807 - def export(self, outfile, level, namespace_='maec:', name_='BehaviorType', namespacedef_=''):
808 showIndent(outfile, level) 809 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 810 already_processed = [] 811 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BehaviorType') 812 if self.hasContent_(): 813 outfile.write('>\n') 814 self.exportChildren(outfile, level + 1, namespace_, name_) 815 showIndent(outfile, level) 816 outfile.write('</%s%s>\n' % (namespace_, name_)) 817 else: 818 outfile.write('/>\n')
819 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorType'):
820 if self.successful is not None and 'successful' not in already_processed: 821 already_processed.append('successful') 822 outfile.write(' successful="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.successful)), input_name='successful')) 823 if self.duration is not None and 'duration' not in already_processed: 824 already_processed.append('duration') 825 outfile.write(' duration=%s' % (self.gds_format_string(quote_attrib(self.duration).encode(ExternalEncoding), input_name='duration'), )) 826 if self.ordinal_position is not None and 'ordinal_position' not in already_processed: 827 already_processed.append('ordinal_position') 828 outfile.write(' ordinal_position="%s"' % self.gds_format_integer(self.ordinal_position, input_name='ordinal_position')) 829 if self.id is not None and 'id' not in already_processed: 830 already_processed.append('id') 831 outfile.write(' id=%s' % (quote_attrib(self.id), ))
832 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BehaviorType', fromsubclass_=False):
833 if self.Purpose is not None: 834 self.Purpose.export(outfile, level, namespace_, name_='Purpose') 835 if self.Description is not None: 836 self.Description.export(outfile, level, namespace_, name_='Description') 837 if self.Discovery_Method is not None: 838 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method') 839 if self.Actions is not None: 840 self.Actions.export(outfile, level, namespace_, name_='Actions') 841 if self.Objects is not None: 842 self.Objects.export(outfile, level, namespace_, name_='Objects') 843 if self.Effects is not None: 844 self.Effects.export(outfile, level, namespace_, name_='Effects') 845 if self.Related_Behaviors is not None: 846 self.Related_Behaviors.export(outfile, level, namespace_, name_='Related_Behaviors')
847 - def hasContent_(self):
848 if ( 849 self.Purpose is not None or 850 self.Description is not None or 851 self.Discovery_Method is not None or 852 self.Actions is not None or 853 self.Objects is not None or 854 self.Effects is not None or 855 self.Related_Behaviors is not None 856 ): 857 return True 858 else: 859 return False
860 - def exportLiteral(self, outfile, level, name_='BehaviorType'):
861 level += 1 862 self.exportLiteralAttributes(outfile, level, [], name_) 863 if self.hasContent_(): 864 self.exportLiteralChildren(outfile, level, name_)
865 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
866 if self.successful is not None and 'successful' not in already_processed: 867 already_processed.append('successful') 868 showIndent(outfile, level) 869 outfile.write('successful = %s,\n' % (self.successful,)) 870 if self.duration is not None and 'duration' not in already_processed: 871 already_processed.append('duration') 872 showIndent(outfile, level) 873 outfile.write('duration = "%s",\n' % (self.duration,)) 874 if self.ordinal_position is not None and 'ordinal_position' not in already_processed: 875 already_processed.append('ordinal_position') 876 showIndent(outfile, level) 877 outfile.write('ordinal_position = %d,\n' % (self.ordinal_position,)) 878 if self.id is not None and 'id' not in already_processed: 879 already_processed.append('id') 880 showIndent(outfile, level) 881 outfile.write('id = %s,\n' % (self.id,))
882 - def exportLiteralChildren(self, outfile, level, name_):
883 if self.Purpose is not None: 884 showIndent(outfile, level) 885 outfile.write('Purpose=model_.PurposeType(\n') 886 self.Purpose.exportLiteral(outfile, level, name_='Purpose') 887 showIndent(outfile, level) 888 outfile.write('),\n') 889 if self.Description is not None: 890 showIndent(outfile, level) 891 outfile.write('Description=model_.StructuredTextType(\n') 892 self.Description.exportLiteral(outfile, level, name_='Description') 893 showIndent(outfile, level) 894 outfile.write('),\n') 895 if self.Discovery_Method is not None: 896 showIndent(outfile, level) 897 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n') 898 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method') 899 showIndent(outfile, level) 900 outfile.write('),\n') 901 if self.Actions is not None: 902 showIndent(outfile, level) 903 outfile.write('Actions=model_.ActionsType1(\n') 904 self.Actions.exportLiteral(outfile, level, name_='Actions') 905 showIndent(outfile, level) 906 outfile.write('),\n') 907 if self.Objects is not None: 908 showIndent(outfile, level) 909 outfile.write('Objects=model_.ObjectsType(\n') 910 self.Objects.exportLiteral(outfile, level, name_='Objects') 911 showIndent(outfile, level) 912 outfile.write('),\n') 913 if self.Effects is not None: 914 showIndent(outfile, level) 915 outfile.write('Effects=model_.EffectsType1(\n') 916 self.Effects.exportLiteral(outfile, level, name_='Effects') 917 showIndent(outfile, level) 918 outfile.write('),\n') 919 if self.Related_Behaviors is not None: 920 showIndent(outfile, level) 921 outfile.write('Related_Behaviors=model_.Related_BehaviorsType(\n') 922 self.Related_Behaviors.exportLiteral(outfile, level, name_='Related_Behaviors') 923 showIndent(outfile, level) 924 outfile.write('),\n')
925 - def build(self, node):
926 self.buildAttributes(node, node.attrib, []) 927 for child in node: 928 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 929 self.buildChildren(child, node, nodeName_)
930 - def buildAttributes(self, node, attrs, already_processed):
931 value = find_attr_value_('successful', node) 932 if value is not None and 'successful' not in already_processed: 933 already_processed.append('successful') 934 if value in ('true', '1'): 935 self.successful = True 936 elif value in ('false', '0'): 937 self.successful = False 938 else: 939 raise_parse_error(node, 'Bad boolean attribute') 940 value = find_attr_value_('duration', node) 941 if value is not None and 'duration' not in already_processed: 942 already_processed.append('duration') 943 self.duration = value 944 value = find_attr_value_('ordinal_position', node) 945 if value is not None and 'ordinal_position' not in already_processed: 946 already_processed.append('ordinal_position') 947 try: 948 self.ordinal_position = int(value) 949 except ValueError as e: 950 raise_parse_error(node, 'Bad integer attribute: %s' % e) 951 if self.ordinal_position <= 0: 952 raise_parse_error(node, 'Invalid PositiveInteger') 953 value = find_attr_value_('id', node) 954 if value is not None and 'id' not in already_processed: 955 already_processed.append('id') 956 self.id = value
957 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
958 if nodeName_ == 'Purpose': 959 obj_ = PurposeType.factory() 960 obj_.build(child_) 961 self.set_Purpose(obj_) 962 elif nodeName_ == 'Description': 963 obj_ = StructuredTextType.factory() 964 obj_.build(child_) 965 self.set_Description(obj_) 966 elif nodeName_ == 'Discovery_Method': 967 obj_ = DiscoveryMethod.factory() 968 obj_.build(child_) 969 self.set_Discovery_Method(obj_) 970 elif nodeName_ == 'Actions': 971 obj_ = ActionsType1.factory() 972 obj_.build(child_) 973 self.set_Actions(obj_) 974 elif nodeName_ == 'Objects': 975 obj_ = ObjectsType.factory() 976 obj_.build(child_) 977 self.set_Objects(obj_) 978 elif nodeName_ == 'Effects': 979 obj_ = EffectsType1.factory() 980 obj_.build(child_) 981 self.set_Effects(obj_) 982 elif nodeName_ == 'Related_Behaviors': 983 obj_ = Related_BehaviorsType.factory() 984 obj_.build(child_) 985 self.set_Related_Behaviors(obj_)
986 # end class BehaviorType 987 988
989 -class BehaviorReferenceType(GeneratedsSuper):
990 """BehaviorReferenceType is intended to serve as a method for linking 991 to behaviors.The behavior_id attribute refers to the ID of the 992 behavior being referenced.The type attribute refers to the type 993 of behavior entity that is being referenced. Possible values: 994 Behavior, Behavior_Collection.""" 995 subclass = None 996 superclass = None
997 - def __init__(self, type_=None, behavior_id=None):
998 self.type_ = _cast(None, type_) 999 self.behavior_id = _cast(None, behavior_id) 1000 pass
1001 - def factory(*args_, **kwargs_):
1002 if BehaviorReferenceType.subclass: 1003 return BehaviorReferenceType.subclass(*args_, **kwargs_) 1004 else: 1005 return BehaviorReferenceType(*args_, **kwargs_)
1006 factory = staticmethod(factory)
1007 - def get_type(self): return self.type_
1008 - def set_type(self, type_): self.type_ = type_
1009 - def get_behavior_id(self): return self.behavior_id
1010 - def set_behavior_id(self, behavior_id): self.behavior_id = behavior_id
1011 - def export(self, outfile, level, namespace_='maec:', name_='BehaviorReferenceType', namespacedef_=''):
1012 showIndent(outfile, level) 1013 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1014 already_processed = [] 1015 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BehaviorReferenceType') 1016 if self.hasContent_(): 1017 outfile.write('>\n') 1018 self.exportChildren(outfile, level + 1, namespace_, name_) 1019 outfile.write('</%s%s>\n' % (namespace_, name_)) 1020 else: 1021 outfile.write('/>\n')
1022 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorReferenceType'):
1023 if self.type_ is not None and 'type_' not in already_processed: 1024 already_processed.append('type_') 1025 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), )) 1026 if self.behavior_id is not None and 'behavior_id' not in already_processed: 1027 already_processed.append('behavior_id') 1028 outfile.write(' behavior_id=%s' % (quote_attrib(self.behavior_id), ))
1029 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BehaviorReferenceType', fromsubclass_=False):
1030 pass
1031 - def hasContent_(self):
1032 if ( 1033 1034 ): 1035 return True 1036 else: 1037 return False
1038 - def exportLiteral(self, outfile, level, name_='BehaviorReferenceType'):
1039 level += 1 1040 self.exportLiteralAttributes(outfile, level, [], name_) 1041 if self.hasContent_(): 1042 self.exportLiteralChildren(outfile, level, name_)
1043 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1044 if self.type_ is not None and 'type_' not in already_processed: 1045 already_processed.append('type_') 1046 showIndent(outfile, level) 1047 outfile.write('type_ = "%s",\n' % (self.type_,)) 1048 if self.behavior_id is not None and 'behavior_id' not in already_processed: 1049 already_processed.append('behavior_id') 1050 showIndent(outfile, level) 1051 outfile.write('behavior_id = %s,\n' % (self.behavior_id,))
1052 - def exportLiteralChildren(self, outfile, level, name_):
1053 pass
1054 - def build(self, node):
1055 self.buildAttributes(node, node.attrib, []) 1056 for child in node: 1057 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1058 self.buildChildren(child, node, nodeName_)
1059 - def buildAttributes(self, node, attrs, already_processed):
1060 value = find_attr_value_('type', node) 1061 if value is not None and 'type' not in already_processed: 1062 already_processed.append('type') 1063 self.type_ = value 1064 value = find_attr_value_('behavior_id', node) 1065 if value is not None and 'behavior_id' not in already_processed: 1066 already_processed.append('behavior_id') 1067 self.behavior_id = value
1068 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1069 pass
1070 # end class BehaviorReferenceType 1071 1072
1073 -class ActionCollectionType(GeneratedsSuper):
1074 """ActionCollectionType is intended to provide a method for 1075 characterizing collections of actions. This can be useful for 1076 organizing actions that may be related and where the exact 1077 relationship is unknown, as well as actions whose associated 1078 behavior has not yet been established.The name attribute 1079 contains the name of the action collection, if applicable.""" 1080 subclass = None 1081 superclass = None
1082 - def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Description=None, Action_Sub_Collection=None, Action=None, Action_Reference=None, Effects=None):
1083 self.id = _cast(None, id) 1084 self.name = _cast(None, name) 1085 self.Affinity_Type = Affinity_Type 1086 self.Affinity_Degree = Affinity_Degree 1087 self.Description = Description 1088 if Action_Sub_Collection is None: 1089 self.Action_Sub_Collection = [] 1090 else: 1091 self.Action_Sub_Collection = Action_Sub_Collection 1092 if Action is None: 1093 self.Action = [] 1094 else: 1095 self.Action = Action 1096 if Action_Reference is None: 1097 self.Action_Reference = [] 1098 else: 1099 self.Action_Reference = Action_Reference 1100 self.Effects = Effects
1101 - def factory(*args_, **kwargs_):
1102 if ActionCollectionType.subclass: 1103 return ActionCollectionType.subclass(*args_, **kwargs_) 1104 else: 1105 return ActionCollectionType(*args_, **kwargs_)
1106 factory = staticmethod(factory)
1107 - def get_Affinity_Type(self): return self.Affinity_Type
1108 - def set_Affinity_Type(self, Affinity_Type): self.Affinity_Type = Affinity_Type
1109 - def get_Affinity_Degree(self): return self.Affinity_Degree
1110 - def set_Affinity_Degree(self, Affinity_Degree): self.Affinity_Degree = Affinity_Degree
1111 - def get_Description(self): return self.Description
1112 - def set_Description(self, Description): self.Description = Description
1113 - def get_Action_Sub_Collection(self): return self.Action_Sub_Collection
1114 - def set_Action_Sub_Collection(self, Action_Sub_Collection): self.Action_Sub_Collection = Action_Sub_Collection
1115 - def add_Action_Sub_Collection(self, value): self.Action_Sub_Collection.append(value)
1116 - def insert_Action_Sub_Collection(self, index, value): self.Action_Sub_Collection[index] = value
1117 - def get_Action(self): return self.Action
1118 - def set_Action(self, Action): self.Action = Action
1119 - def add_Action(self, value): self.Action.append(value)
1120 - def insert_Action(self, index, value): self.Action[index] = value
1121 - def get_Action_Reference(self): return self.Action_Reference
1122 - def set_Action_Reference(self, Action_Reference): self.Action_Reference = Action_Reference
1123 - def add_Action_Reference(self, value): self.Action_Reference.append(value)
1124 - def insert_Action_Reference(self, index, value): self.Action_Reference[index] = value
1125 - def get_Effects(self): return self.Effects
1126 - def set_Effects(self, Effects): self.Effects = Effects
1127 - def get_id(self): return self.id
1128 - def set_id(self, id): self.id = id
1129 - def get_name(self): return self.name
1130 - def set_name(self, name): self.name = name
1131 - def export(self, outfile, level, namespace_='maec:', name_='ActionCollectionType', namespacedef_=''):
1132 showIndent(outfile, level) 1133 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1134 already_processed = [] 1135 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionCollectionType') 1136 if self.hasContent_(): 1137 outfile.write('>\n') 1138 self.exportChildren(outfile, level + 1, namespace_, name_) 1139 showIndent(outfile, level) 1140 outfile.write('</%s%s>\n' % (namespace_, name_)) 1141 else: 1142 outfile.write('/>\n')
1143 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionCollectionType'):
1144 if self.id is not None and 'id' not in already_processed: 1145 already_processed.append('id') 1146 outfile.write(' id=%s' % (quote_attrib(self.id), )) 1147 if self.name is not None and 'name' not in already_processed: 1148 already_processed.append('name') 1149 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
1150 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionCollectionType', fromsubclass_=False):
1151 if self.Affinity_Type is not None: 1152 showIndent(outfile, level) 1153 outfile.write('<%sAffinity_Type>%s</%sAffinity_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Type).encode(ExternalEncoding), input_name='Affinity_Type'), namespace_)) 1154 if self.Affinity_Degree is not None: 1155 showIndent(outfile, level) 1156 outfile.write('<%sAffinity_Degree>%s</%sAffinity_Degree>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Degree).encode(ExternalEncoding), input_name='Affinity_Degree'), namespace_)) 1157 if self.Description is not None: 1158 self.Description.export(outfile, level, namespace_, name_='Description') 1159 for Action_Sub_Collection_ in self.Action_Sub_Collection: 1160 Action_Sub_Collection_.export(outfile, level, namespace_, name_='Action_Sub-Collection') 1161 for Action_ in self.Action: 1162 Action_.export(outfile, level, namespace_, name_='Action') 1163 for Action_Reference_ in self.Action_Reference: 1164 Action_Reference_.export(outfile, level, namespace_, name_='Action_Reference') 1165 if self.Effects is not None: 1166 self.Effects.export(outfile, level, namespace_, name_='Effects')
1167 - def hasContent_(self):
1168 if ( 1169 self.Affinity_Type is not None or 1170 self.Affinity_Degree is not None or 1171 self.Description is not None or 1172 self.Action_Sub_Collection or 1173 self.Action or 1174 self.Action_Reference or 1175 self.Effects is not None 1176 ): 1177 return True 1178 else: 1179 return False
1180 - def exportLiteral(self, outfile, level, name_='ActionCollectionType'):
1181 level += 1 1182 self.exportLiteralAttributes(outfile, level, [], name_) 1183 if self.hasContent_(): 1184 self.exportLiteralChildren(outfile, level, name_)
1185 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1186 if self.id is not None and 'id' not in already_processed: 1187 already_processed.append('id') 1188 showIndent(outfile, level) 1189 outfile.write('id = %s,\n' % (self.id,)) 1190 if self.name is not None and 'name' not in already_processed: 1191 already_processed.append('name') 1192 showIndent(outfile, level) 1193 outfile.write('name = "%s",\n' % (self.name,))
1194 - def exportLiteralChildren(self, outfile, level, name_):
1195 if self.Affinity_Type is not None: 1196 showIndent(outfile, level) 1197 outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding)) 1198 if self.Affinity_Degree is not None: 1199 showIndent(outfile, level) 1200 outfile.write('Affinity_Degree=%s,\n' % quote_python(self.Affinity_Degree).encode(ExternalEncoding)) 1201 if self.Description is not None: 1202 showIndent(outfile, level) 1203 outfile.write('Description=model_.StructuredTextType(\n') 1204 self.Description.exportLiteral(outfile, level, name_='Description') 1205 showIndent(outfile, level) 1206 outfile.write('),\n') 1207 showIndent(outfile, level) 1208 outfile.write('Action_Sub_Collection=[\n') 1209 level += 1 1210 for Action_Sub_Collection_ in self.Action_Sub_Collection: 1211 showIndent(outfile, level) 1212 outfile.write('model_.ActionCollectionType(\n') 1213 Action_Sub_Collection_.exportLiteral(outfile, level, name_='ActionCollectionType') 1214 showIndent(outfile, level) 1215 outfile.write('),\n') 1216 level -= 1 1217 showIndent(outfile, level) 1218 outfile.write('],\n') 1219 showIndent(outfile, level) 1220 outfile.write('Action=[\n') 1221 level += 1 1222 for Action_ in self.Action: 1223 showIndent(outfile, level) 1224 outfile.write('model_.ActionType(\n') 1225 Action_.exportLiteral(outfile, level, name_='ActionType') 1226 showIndent(outfile, level) 1227 outfile.write('),\n') 1228 level -= 1 1229 showIndent(outfile, level) 1230 outfile.write('],\n') 1231 showIndent(outfile, level) 1232 outfile.write('Action_Reference=[\n') 1233 level += 1 1234 for Action_Reference_ in self.Action_Reference: 1235 showIndent(outfile, level) 1236 outfile.write('model_.ActionReferenceType(\n') 1237 Action_Reference_.exportLiteral(outfile, level, name_='ActionReferenceType') 1238 showIndent(outfile, level) 1239 outfile.write('),\n') 1240 level -= 1 1241 showIndent(outfile, level) 1242 outfile.write('],\n') 1243 if self.Effects is not None: 1244 showIndent(outfile, level) 1245 outfile.write('Effects=model_.EffectsType2(\n') 1246 self.Effects.exportLiteral(outfile, level, name_='Effects') 1247 showIndent(outfile, level) 1248 outfile.write('),\n')
1249 - def build(self, node):
1250 self.buildAttributes(node, node.attrib, []) 1251 for child in node: 1252 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1253 self.buildChildren(child, node, nodeName_)
1254 - def buildAttributes(self, node, attrs, already_processed):
1255 value = find_attr_value_('id', node) 1256 if value is not None and 'id' not in already_processed: 1257 already_processed.append('id') 1258 self.id = value 1259 value = find_attr_value_('name', node) 1260 if value is not None and 'name' not in already_processed: 1261 already_processed.append('name') 1262 self.name = value
1263 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1264 if nodeName_ == 'Affinity_Type': 1265 Affinity_Type_ = child_.text 1266 Affinity_Type_ = self.gds_validate_string(Affinity_Type_, node, 'Affinity_Type') 1267 self.Affinity_Type = Affinity_Type_ 1268 elif nodeName_ == 'Affinity_Degree': 1269 Affinity_Degree_ = child_.text 1270 Affinity_Degree_ = self.gds_validate_string(Affinity_Degree_, node, 'Affinity_Degree') 1271 self.Affinity_Degree = Affinity_Degree_ 1272 elif nodeName_ == 'Description': 1273 obj_ = StructuredTextType.factory() 1274 obj_.build(child_) 1275 self.set_Description(obj_) 1276 elif nodeName_ == 'Action_Sub-Collection': 1277 obj_ = ActionCollectionType.factory() 1278 obj_.build(child_) 1279 self.Action_Sub_Collection.append(obj_) 1280 elif nodeName_ == 'Action': 1281 obj_ = ActionType.factory() 1282 obj_.build(child_) 1283 self.Action.append(obj_) 1284 elif nodeName_ == 'Action_Reference': 1285 obj_ = ActionReferenceType.factory() 1286 obj_.build(child_) 1287 self.Action_Reference.append(obj_) 1288 elif nodeName_ == 'Effects': 1289 obj_ = EffectsType2.factory() 1290 obj_.build(child_) 1291 self.set_Effects(obj_)
1292 # end class ActionCollectionType 1293 1294
1295 -class ActionType(GeneratedsSuper):
1296 """ActionType is intended to serve as a method for the characterization 1297 of actions found or observed in malware. Actions can be thought 1298 of as system state changes and similar operations that represent 1299 the fundamental low-level operation of malware. Some examples 1300 include the creation of a file, deletion of a registry key, and 1301 the sending of some arbitrary packets on a socket.The type 1302 attribute is intended to characterize the type of action that 1303 occurred, based on its activity. Possible values: Login/Logon, 1304 Logout/Logoff, Start, Stop, Suspend/Pause, Resume, Create, 1305 Remove/Delete, Access/Open, Close, Move, Copy/Duplicate, Read, 1306 Write, Execute, Quarantine, Find, Clean, Block, Update, Upgrade, 1307 Scan, Filter, Install, Allocate, Initialize, Save, Connect, 1308 Disconnect, Audit, Replicate, Detect, Alert, Backup, Search, 1309 Restore, Get, Set, Assign, Send, Receive, Transmit, Map, Load, 1310 Query, Enumerate, Bind, Free, Kill, Encrypt, Decrypt, Encode, 1311 Decode, Pack, Unpack, Archive, Compress, Decompress, Download, 1312 Upload, Load, Fork, Join,Merge, Interleave, Schedule, Call, 1313 Compare, Wipe/Destroy/Purge, Throw/Raise, Lock, Unlock, 1314 Synchronize, Hook, Unhook, Draw, Click, Press, Depress, 1315 Close(network), Open(network), Callback, Drop, Accept, Deny, 1316 Modify, Listen, Send,Start_Winsock, Other.The action_name 1317 attribute is intended to contain the name of the action 1318 performed. Typically, this is composed of the Action_Type 1319 concatenated with the type of object the action is performed 1320 upon. For instance, the action name for creating a file would be 1321 'create_file', where the action_type is 'create'. If the object 1322 does not exist in MAEC's object_type enumeration, it can still 1323 be included as the second half of the action name. If a specific 1324 object attribute is being used in the action, this attribute can 1325 be concatenated after the object type. For instance, an action 1326 that sets a timestamp on a file would 'set_file_timestamp'. 1327 Object modifiers can be used by including the modifier in front 1328 of the object type. For instance, an action that creates a 1329 remote thread would be 'create_remote_thread'.The 1330 ordinal_position attribute is intended to reference the ordinal 1331 position of the action with respect to the execution of the 1332 malware.The successful attribute is used to describe whether the 1333 action was successful or not.The timestamp attribute represents 1334 the local or relative time at which the action occurred or was 1335 observed.""" 1336 subclass = None 1337 superclass = None
1338 - def __init__(self, successful=None, timestamp=None, action_name=None, ordinal_position=None, type_=None, id=None, Description=None, Discovery_Method=None, Action_Initiator=None, Action_Implementation=None, Objects=None, Effects=None, Related_Actions=None):
1339 self.successful = _cast(bool, successful) 1340 self.timestamp = _cast(None, timestamp) 1341 self.action_name = _cast(None, action_name) 1342 self.ordinal_position = _cast(int, ordinal_position) 1343 self.type_ = _cast(None, type_) 1344 self.id = _cast(None, id) 1345 self.Description = Description 1346 self.Discovery_Method = Discovery_Method 1347 self.Action_Initiator = Action_Initiator 1348 self.Action_Implementation = Action_Implementation 1349 self.Objects = Objects 1350 self.Effects = Effects 1351 self.Related_Actions = Related_Actions
1352 - def factory(*args_, **kwargs_):
1353 if ActionType.subclass: 1354 return ActionType.subclass(*args_, **kwargs_) 1355 else: 1356 return ActionType(*args_, **kwargs_)
1357 factory = staticmethod(factory)
1358 - def get_Description(self): return self.Description
1359 - def set_Description(self, Description): self.Description = Description
1360 - def get_Discovery_Method(self): return self.Discovery_Method
1361 - def set_Discovery_Method(self, Discovery_Method): self.Discovery_Method = Discovery_Method
1362 - def get_Action_Initiator(self): return self.Action_Initiator
1363 - def set_Action_Initiator(self, Action_Initiator): self.Action_Initiator = Action_Initiator
1364 - def get_Action_Implementation(self): return self.Action_Implementation
1365 - def set_Action_Implementation(self, Action_Implementation): self.Action_Implementation = Action_Implementation
1366 - def get_Objects(self): return self.Objects
1367 - def set_Objects(self, Objects): self.Objects = Objects
1368 - def get_Effects(self): return self.Effects
1369 - def set_Effects(self, Effects): self.Effects = Effects
1372 - def get_successful(self): return self.successful
1373 - def set_successful(self, successful): self.successful = successful
1374 - def get_timestamp(self): return self.timestamp
1375 - def set_timestamp(self, timestamp): self.timestamp = timestamp
1376 - def get_action_name(self): return self.action_name
1377 - def set_action_name(self, action_name): self.action_name = action_name
1378 - def get_ordinal_position(self): return self.ordinal_position
1379 - def set_ordinal_position(self, ordinal_position): self.ordinal_position = ordinal_position
1380 - def get_type(self): return self.type_
1381 - def set_type(self, type_): self.type_ = type_
1382 - def get_id(self): return self.id
1383 - def set_id(self, id): self.id = id
1384 - def export(self, outfile, level, namespace_='maec:', name_='ActionType', namespacedef_=''):
1385 showIndent(outfile, level) 1386 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1387 already_processed = [] 1388 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionType') 1389 if self.hasContent_(): 1390 outfile.write('>\n') 1391 self.exportChildren(outfile, level + 1, namespace_, name_) 1392 showIndent(outfile, level) 1393 outfile.write('</%s%s>\n' % (namespace_, name_)) 1394 else: 1395 outfile.write('/>\n')
1396 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionType'):
1397 if self.successful is not None and 'successful' not in already_processed: 1398 already_processed.append('successful') 1399 outfile.write(' successful="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.successful)), input_name='successful')) 1400 if self.timestamp is not None and 'timestamp' not in already_processed: 1401 already_processed.append('timestamp') 1402 outfile.write(' timestamp=%s' % (quote_attrib(self.timestamp), )) 1403 if self.action_name is not None and 'action_name' not in already_processed: 1404 already_processed.append('action_name') 1405 outfile.write(' action_name=%s' % (self.gds_format_string(quote_attrib(self.action_name).encode(ExternalEncoding), input_name='action_name'), )) 1406 if self.ordinal_position is not None and 'ordinal_position' not in already_processed: 1407 already_processed.append('ordinal_position') 1408 outfile.write(' ordinal_position="%s"' % self.gds_format_integer(self.ordinal_position, input_name='ordinal_position')) 1409 if self.type_ is not None and 'type_' not in already_processed: 1410 already_processed.append('type_') 1411 outfile.write(' type=%s' % (quote_attrib(self.type_), )) 1412 if self.id is not None and 'id' not in already_processed: 1413 already_processed.append('id') 1414 outfile.write(' id=%s' % (quote_attrib(self.id), ))
1415 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionType', fromsubclass_=False):
1416 if self.Description is not None: 1417 self.Description.export(outfile, level, namespace_, name_='Description') 1418 if self.Discovery_Method is not None: 1419 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method') 1420 if self.Action_Initiator is not None: 1421 self.Action_Initiator.export(outfile, level, namespace_, name_='Action_Initiator') 1422 if self.Action_Implementation is not None: 1423 self.Action_Implementation.export(outfile, level, namespace_, name_='Action_Implementation') 1424 if self.Objects is not None: 1425 self.Objects.export(outfile, level, namespace_, name_='Objects') 1426 if self.Effects is not None: 1427 self.Effects.export(outfile, level, namespace_, name_='Effects') 1428 if self.Related_Actions is not None: 1429 self.Related_Actions.export(outfile, level, namespace_, name_='Related_Actions')
1430 - def hasContent_(self):
1431 if ( 1432 self.Description is not None or 1433 self.Discovery_Method is not None or 1434 self.Action_Initiator is not None or 1435 self.Action_Implementation is not None or 1436 self.Objects is not None or 1437 self.Effects is not None or 1438 self.Related_Actions is not None 1439 ): 1440 return True 1441 else: 1442 return False
1443 - def exportLiteral(self, outfile, level, name_='ActionType'):
1444 level += 1 1445 self.exportLiteralAttributes(outfile, level, [], name_) 1446 if self.hasContent_(): 1447 self.exportLiteralChildren(outfile, level, name_)
1448 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1449 if self.successful is not None and 'successful' not in already_processed: 1450 already_processed.append('successful') 1451 showIndent(outfile, level) 1452 outfile.write('successful = %s,\n' % (self.successful,)) 1453 if self.timestamp is not None and 'timestamp' not in already_processed: 1454 already_processed.append('timestamp') 1455 showIndent(outfile, level) 1456 outfile.write('timestamp = %s,\n' % (self.timestamp,)) 1457 if self.action_name is not None and 'action_name' not in already_processed: 1458 already_processed.append('action_name') 1459 showIndent(outfile, level) 1460 outfile.write('action_name = "%s",\n' % (self.action_name,)) 1461 if self.ordinal_position is not None and 'ordinal_position' not in already_processed: 1462 already_processed.append('ordinal_position') 1463 showIndent(outfile, level) 1464 outfile.write('ordinal_position = %d,\n' % (self.ordinal_position,)) 1465 if self.type_ is not None and 'type_' not in already_processed: 1466 already_processed.append('type_') 1467 showIndent(outfile, level) 1468 outfile.write('type_ = %s,\n' % (self.type_,)) 1469 if self.id is not None and 'id' not in already_processed: 1470 already_processed.append('id') 1471 showIndent(outfile, level) 1472 outfile.write('id = %s,\n' % (self.id,))
1473 - def exportLiteralChildren(self, outfile, level, name_):
1474 if self.Description is not None: 1475 showIndent(outfile, level) 1476 outfile.write('Description=model_.StructuredTextType(\n') 1477 self.Description.exportLiteral(outfile, level, name_='Description') 1478 showIndent(outfile, level) 1479 outfile.write('),\n') 1480 if self.Discovery_Method is not None: 1481 showIndent(outfile, level) 1482 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n') 1483 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method') 1484 showIndent(outfile, level) 1485 outfile.write('),\n') 1486 if self.Action_Initiator is not None: 1487 showIndent(outfile, level) 1488 outfile.write('Action_Initiator=model_.Action_InitiatorType(\n') 1489 self.Action_Initiator.exportLiteral(outfile, level, name_='Action_Initiator') 1490 showIndent(outfile, level) 1491 outfile.write('),\n') 1492 if self.Action_Implementation is not None: 1493 showIndent(outfile, level) 1494 outfile.write('Action_Implementation=model_.ActionImplementationType(\n') 1495 self.Action_Implementation.exportLiteral(outfile, level, name_='Action_Implementation') 1496 showIndent(outfile, level) 1497 outfile.write('),\n') 1498 if self.Objects is not None: 1499 showIndent(outfile, level) 1500 outfile.write('Objects=model_.ObjectsType1(\n') 1501 self.Objects.exportLiteral(outfile, level, name_='Objects') 1502 showIndent(outfile, level) 1503 outfile.write('),\n') 1504 if self.Effects is not None: 1505 showIndent(outfile, level) 1506 outfile.write('Effects=model_.EffectsType3(\n') 1507 self.Effects.exportLiteral(outfile, level, name_='Effects') 1508 showIndent(outfile, level) 1509 outfile.write('),\n') 1510 if self.Related_Actions is not None: 1511 showIndent(outfile, level) 1512 outfile.write('Related_Actions=model_.Related_ActionsType(\n') 1513 self.Related_Actions.exportLiteral(outfile, level, name_='Related_Actions') 1514 showIndent(outfile, level) 1515 outfile.write('),\n')
1516 - def build(self, node):
1517 self.buildAttributes(node, node.attrib, []) 1518 for child in node: 1519 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1520 self.buildChildren(child, node, nodeName_)
1521 - def buildAttributes(self, node, attrs, already_processed):
1522 value = find_attr_value_('successful', node) 1523 if value is not None and 'successful' not in already_processed: 1524 already_processed.append('successful') 1525 if value in ('true', '1'): 1526 self.successful = True 1527 elif value in ('false', '0'): 1528 self.successful = False 1529 else: 1530 raise_parse_error(node, 'Bad boolean attribute') 1531 value = find_attr_value_('timestamp', node) 1532 if value is not None and 'timestamp' not in already_processed: 1533 already_processed.append('timestamp') 1534 self.timestamp = value 1535 value = find_attr_value_('action_name', node) 1536 if value is not None and 'action_name' not in already_processed: 1537 already_processed.append('action_name') 1538 self.action_name = value 1539 value = find_attr_value_('ordinal_position', node) 1540 if value is not None and 'ordinal_position' not in already_processed: 1541 already_processed.append('ordinal_position') 1542 try: 1543 self.ordinal_position = int(value) 1544 except ValueError as e: 1545 raise_parse_error(node, 'Bad integer attribute: %s' % e) 1546 if self.ordinal_position <= 0: 1547 raise_parse_error(node, 'Invalid PositiveInteger') 1548 value = find_attr_value_('type', node) 1549 if value is not None and 'type' not in already_processed: 1550 already_processed.append('type') 1551 self.type_ = value 1552 value = find_attr_value_('id', node) 1553 if value is not None and 'id' not in already_processed: 1554 already_processed.append('id') 1555 self.id = value
1556 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1557 if nodeName_ == 'Description': 1558 obj_ = StructuredTextType.factory() 1559 obj_.build(child_) 1560 self.set_Description(obj_) 1561 elif nodeName_ == 'Discovery_Method': 1562 obj_ = DiscoveryMethod.factory() 1563 obj_.build(child_) 1564 self.set_Discovery_Method(obj_) 1565 elif nodeName_ == 'Action_Initiator': 1566 obj_ = Action_InitiatorType.factory() 1567 obj_.build(child_) 1568 self.set_Action_Initiator(obj_) 1569 elif nodeName_ == 'Action_Implementation': 1570 obj_ = ActionImplementationType.factory() 1571 obj_.build(child_) 1572 self.set_Action_Implementation(obj_) 1573 elif nodeName_ == 'Objects': 1574 obj_ = ObjectsType1.factory() 1575 obj_.build(child_) 1576 self.set_Objects(obj_) 1577 elif nodeName_ == 'Effects': 1578 obj_ = EffectsType3.factory() 1579 obj_.build(child_) 1580 self.set_Effects(obj_) 1581 elif nodeName_ == 'Related_Actions': 1582 obj_ = Related_ActionsType.factory() 1583 obj_.build(child_) 1584 self.set_Related_Actions(obj_)
1585 # end class ActionType 1586 1587
1588 -class ActionReferenceType(GeneratedsSuper):
1589 """ActionReferenceType is intended to serve as a method for linking to 1590 actions.The action_id attribute refers to the ID of the action 1591 being referenced.The type field refers to the type of action 1592 entity that is being referenced. Possible values: Action, 1593 Action_Collection.""" 1594 subclass = None 1595 superclass = None
1596 - def __init__(self, type_=None, action_id=None):
1597 self.type_ = _cast(None, type_) 1598 self.action_id = _cast(None, action_id) 1599 pass
1600 - def factory(*args_, **kwargs_):
1601 if ActionReferenceType.subclass: 1602 return ActionReferenceType.subclass(*args_, **kwargs_) 1603 else: 1604 return ActionReferenceType(*args_, **kwargs_)
1605 factory = staticmethod(factory)
1606 - def get_type(self): return self.type_
1607 - def set_type(self, type_): self.type_ = type_
1608 - def get_action_id(self): return self.action_id
1609 - def set_action_id(self, action_id): self.action_id = action_id
1610 - def export(self, outfile, level, namespace_='maec:', name_='ActionReferenceType', namespacedef_=''):
1611 showIndent(outfile, level) 1612 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1613 already_processed = [] 1614 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionReferenceType') 1615 if self.hasContent_(): 1616 outfile.write('>\n') 1617 self.exportChildren(outfile, level + 1, namespace_, name_) 1618 outfile.write('</%s%s>\n' % (namespace_, name_)) 1619 else: 1620 outfile.write('/>\n')
1621 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionReferenceType'):
1622 if self.type_ is not None and 'type_' not in already_processed: 1623 already_processed.append('type_') 1624 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), )) 1625 if self.action_id is not None and 'action_id' not in already_processed: 1626 already_processed.append('action_id') 1627 outfile.write(' action_id=%s' % (quote_attrib(self.action_id), ))
1628 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionReferenceType', fromsubclass_=False):
1629 pass
1630 - def hasContent_(self):
1631 if ( 1632 1633 ): 1634 return True 1635 else: 1636 return False
1637 - def exportLiteral(self, outfile, level, name_='ActionReferenceType'):
1638 level += 1 1639 self.exportLiteralAttributes(outfile, level, [], name_) 1640 if self.hasContent_(): 1641 self.exportLiteralChildren(outfile, level, name_)
1642 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1643 if self.type_ is not None and 'type_' not in already_processed: 1644 already_processed.append('type_') 1645 showIndent(outfile, level) 1646 outfile.write('type_ = "%s",\n' % (self.type_,)) 1647 if self.action_id is not None and 'action_id' not in already_processed: 1648 already_processed.append('action_id') 1649 showIndent(outfile, level) 1650 outfile.write('action_id = %s,\n' % (self.action_id,))
1651 - def exportLiteralChildren(self, outfile, level, name_):
1652 pass
1653 - def build(self, node):
1654 self.buildAttributes(node, node.attrib, []) 1655 for child in node: 1656 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1657 self.buildChildren(child, node, nodeName_)
1658 - def buildAttributes(self, node, attrs, already_processed):
1659 value = find_attr_value_('type', node) 1660 if value is not None and 'type' not in already_processed: 1661 already_processed.append('type') 1662 self.type_ = value 1663 value = find_attr_value_('action_id', node) 1664 if value is not None and 'action_id' not in already_processed: 1665 already_processed.append('action_id') 1666 self.action_id = value
1667 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1668 pass
1669 # end class ActionReferenceType 1670 1671
1672 -class ObjectType(GeneratedsSuper):
1673 """ObjectType is intended to serve as a method for the characterization 1674 of any entities that actions and behaviors operate on or are 1675 associated with.The object_name attribute specifies the name of 1676 the object, if applicable.The type attribute is intended to 1677 characterize the type of object being characterized in this 1678 element. Possible values are: URI, Host, Session, Session Token, 1679 Account, Device (physical), Handle, Heap,Memory Address, Memory 1680 Page, Window, Dialog, Parameter, Authentication Token,Encryption 1681 Token, Web Query, Protocol Header, Protocol Field, Link, SQL 1682 Query,Database, ACL, Role, System, VM, Signature, Channel, API 1683 Call, Environment Variable, Application, Network, Configuration, 1684 Policy, Tack, Malware, Message,Email Message, Media, Operating 1685 System, Query, Domain, Event, OtherThe permanent attribute is 1686 intended to characterize whether an object stays resident after 1687 execution of the malware, that is, whather or not it remains on 1688 the filesystem or other non-volatile entity in some fashion.""" 1689 subclass = None 1690 superclass = None
1691 - def __init__(self, object_name=None, permanent=None, type_=None, id=None, Object_Size=None, Classifications=None, Associated_Code=None, Related_Objects=None, File_System_Object_Attributes=None, GUI_Object_Attributes=None, IPC_Object_Attributes=None, Internet_Object_Attributes=None, Module_Object_Attributes=None, Registry_Object_Attributes=None, Process_Object_Attributes=None, Memory_Object_Attributes=None, Network_Object_Attributes=None, Daemon_Object_Attributes=None, Custom_Object_Attributes=None):
1692 self.object_name = _cast(None, object_name) 1693 self.permanent = _cast(bool, permanent) 1694 self.type_ = _cast(None, type_) 1695 self.id = _cast(None, id) 1696 self.Object_Size = Object_Size 1697 self.Classifications = Classifications 1698 self.Associated_Code = Associated_Code 1699 self.Related_Objects = Related_Objects 1700 self.File_System_Object_Attributes = File_System_Object_Attributes 1701 self.GUI_Object_Attributes = GUI_Object_Attributes 1702 self.IPC_Object_Attributes = IPC_Object_Attributes 1703 self.Internet_Object_Attributes = Internet_Object_Attributes 1704 self.Module_Object_Attributes = Module_Object_Attributes 1705 self.Registry_Object_Attributes = Registry_Object_Attributes 1706 self.Process_Object_Attributes = Process_Object_Attributes 1707 self.Memory_Object_Attributes = Memory_Object_Attributes 1708 self.Network_Object_Attributes = Network_Object_Attributes 1709 self.Daemon_Object_Attributes = Daemon_Object_Attributes 1710 self.Custom_Object_Attributes = Custom_Object_Attributes
1711 - def factory(*args_, **kwargs_):
1712 if ObjectType.subclass: 1713 return ObjectType.subclass(*args_, **kwargs_) 1714 else: 1715 return ObjectType(*args_, **kwargs_)
1716 factory = staticmethod(factory)
1717 - def get_Object_Size(self): return self.Object_Size
1718 - def set_Object_Size(self, Object_Size): self.Object_Size = Object_Size
1719 - def get_Classifications(self): return self.Classifications
1720 - def set_Classifications(self, Classifications): self.Classifications = Classifications
1721 - def get_Associated_Code(self): return self.Associated_Code
1722 - def set_Associated_Code(self, Associated_Code): self.Associated_Code = Associated_Code
1725 - def get_File_System_Object_Attributes(self): return self.File_System_Object_Attributes
1726 - def set_File_System_Object_Attributes(self, File_System_Object_Attributes): self.File_System_Object_Attributes = File_System_Object_Attributes
1727 - def get_GUI_Object_Attributes(self): return self.GUI_Object_Attributes
1728 - def set_GUI_Object_Attributes(self, GUI_Object_Attributes): self.GUI_Object_Attributes = GUI_Object_Attributes
1729 - def get_IPC_Object_Attributes(self): return self.IPC_Object_Attributes
1730 - def set_IPC_Object_Attributes(self, IPC_Object_Attributes): self.IPC_Object_Attributes = IPC_Object_Attributes
1731 - def get_Internet_Object_Attributes(self): return self.Internet_Object_Attributes
1732 - def set_Internet_Object_Attributes(self, Internet_Object_Attributes): self.Internet_Object_Attributes = Internet_Object_Attributes
1733 - def get_Module_Object_Attributes(self): return self.Module_Object_Attributes
1734 - def set_Module_Object_Attributes(self, Module_Object_Attributes): self.Module_Object_Attributes = Module_Object_Attributes
1735 - def get_Registry_Object_Attributes(self): return self.Registry_Object_Attributes
1736 - def set_Registry_Object_Attributes(self, Registry_Object_Attributes): self.Registry_Object_Attributes = Registry_Object_Attributes
1737 - def get_Process_Object_Attributes(self): return self.Process_Object_Attributes
1738 - def set_Process_Object_Attributes(self, Process_Object_Attributes): self.Process_Object_Attributes = Process_Object_Attributes
1739 - def get_Memory_Object_Attributes(self): return self.Memory_Object_Attributes
1740 - def set_Memory_Object_Attributes(self, Memory_Object_Attributes): self.Memory_Object_Attributes = Memory_Object_Attributes
1741 - def get_Network_Object_Attributes(self): return self.Network_Object_Attributes
1742 - def set_Network_Object_Attributes(self, Network_Object_Attributes): self.Network_Object_Attributes = Network_Object_Attributes
1743 - def get_Daemon_Object_Attributes(self): return self.Daemon_Object_Attributes
1744 - def set_Daemon_Object_Attributes(self, Daemon_Object_Attributes): self.Daemon_Object_Attributes = Daemon_Object_Attributes
1745 - def get_Custom_Object_Attributes(self): return self.Custom_Object_Attributes
1746 - def set_Custom_Object_Attributes(self, Custom_Object_Attributes): self.Custom_Object_Attributes = Custom_Object_Attributes
1747 - def get_object_name(self): return self.object_name
1748 - def set_object_name(self, object_name): self.object_name = object_name
1749 - def get_permanent(self): return self.permanent
1750 - def set_permanent(self, permanent): self.permanent = permanent
1751 - def get_type(self): return self.type_
1752 - def set_type(self, type_): self.type_ = type_
1753 - def get_id(self): return self.id
1754 - def set_id(self, id): self.id = id
1755 - def export(self, outfile, level, namespace_='maec:', name_='ObjectType', namespacedef_=''):
1756 showIndent(outfile, level) 1757 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 1758 already_processed = [] 1759 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectType') 1760 if self.hasContent_(): 1761 outfile.write('>\n') 1762 self.exportChildren(outfile, level + 1, namespace_, name_) 1763 showIndent(outfile, level) 1764 outfile.write('</%s%s>\n' % (namespace_, name_)) 1765 else: 1766 outfile.write('/>\n')
1767 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectType'):
1768 if self.object_name is not None and 'object_name' not in already_processed: 1769 already_processed.append('object_name') 1770 outfile.write(' object_name=%s' % (self.gds_format_string(quote_attrib(self.object_name).encode(ExternalEncoding), input_name='object_name'), )) 1771 if self.permanent is not None and 'permanent' not in already_processed: 1772 already_processed.append('permanent') 1773 outfile.write(' permanent="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.permanent)), input_name='permanent')) 1774 if self.type_ is not None and 'type_' not in already_processed: 1775 already_processed.append('type_') 1776 outfile.write(' type=%s' % (quote_attrib(self.type_), )) 1777 if self.id is not None and 'id' not in already_processed: 1778 already_processed.append('id') 1779 outfile.write(' id=%s' % (quote_attrib(self.id), ))
1780 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectType', fromsubclass_=False):
1781 if self.Object_Size is not None: 1782 self.Object_Size.export(outfile, level, namespace_, name_='Object_Size') 1783 if self.Classifications is not None: 1784 self.Classifications.export(outfile, level, namespace_, name_='Classifications') 1785 if self.Associated_Code is not None: 1786 self.Associated_Code.export(outfile, level, namespace_, name_='Associated_Code') 1787 if self.Related_Objects is not None: 1788 self.Related_Objects.export(outfile, level, namespace_, name_='Related_Objects') 1789 if self.File_System_Object_Attributes is not None: 1790 self.File_System_Object_Attributes.export(outfile, level, namespace_, name_='File_System_Object_Attributes') 1791 if self.GUI_Object_Attributes is not None: 1792 self.GUI_Object_Attributes.export(outfile, level, namespace_, name_='GUI_Object_Attributes') 1793 if self.IPC_Object_Attributes is not None: 1794 self.IPC_Object_Attributes.export(outfile, level, namespace_, name_='IPC_Object_Attributes') 1795 if self.Internet_Object_Attributes is not None: 1796 self.Internet_Object_Attributes.export(outfile, level, namespace_, name_='Internet_Object_Attributes') 1797 if self.Module_Object_Attributes is not None: 1798 self.Module_Object_Attributes.export(outfile, level, namespace_, name_='Module_Object_Attributes') 1799 if self.Registry_Object_Attributes is not None: 1800 self.Registry_Object_Attributes.export(outfile, level, namespace_, name_='Registry_Object_Attributes') 1801 if self.Process_Object_Attributes is not None: 1802 self.Process_Object_Attributes.export(outfile, level, namespace_, name_='Process_Object_Attributes') 1803 if self.Memory_Object_Attributes is not None: 1804 self.Memory_Object_Attributes.export(outfile, level, namespace_, name_='Memory_Object_Attributes') 1805 if self.Network_Object_Attributes is not None: 1806 self.Network_Object_Attributes.export(outfile, level, namespace_, name_='Network_Object_Attributes') 1807 if self.Daemon_Object_Attributes is not None: 1808 self.Daemon_Object_Attributes.export(outfile, level, namespace_, name_='Daemon_Object_Attributes') 1809 if self.Custom_Object_Attributes is not None: 1810 self.Custom_Object_Attributes.export(outfile, level, namespace_, name_='Custom_Object_Attributes')
1811 - def hasContent_(self):
1812 if ( 1813 self.Object_Size is not None or 1814 self.Classifications is not None or 1815 self.Associated_Code is not None or 1816 self.Related_Objects is not None or 1817 self.File_System_Object_Attributes is not None or 1818 self.GUI_Object_Attributes is not None or 1819 self.IPC_Object_Attributes is not None or 1820 self.Internet_Object_Attributes is not None or 1821 self.Module_Object_Attributes is not None or 1822 self.Registry_Object_Attributes is not None or 1823 self.Process_Object_Attributes is not None or 1824 self.Memory_Object_Attributes is not None or 1825 self.Network_Object_Attributes is not None or 1826 self.Daemon_Object_Attributes is not None or 1827 self.Custom_Object_Attributes is not None 1828 ): 1829 return True 1830 else: 1831 return False
1832 - def exportLiteral(self, outfile, level, name_='ObjectType'):
1833 level += 1 1834 self.exportLiteralAttributes(outfile, level, [], name_) 1835 if self.hasContent_(): 1836 self.exportLiteralChildren(outfile, level, name_)
1837 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
1838 if self.object_name is not None and 'object_name' not in already_processed: 1839 already_processed.append('object_name') 1840 showIndent(outfile, level) 1841 outfile.write('object_name = "%s",\n' % (self.object_name,)) 1842 if self.permanent is not None and 'permanent' not in already_processed: 1843 already_processed.append('permanent') 1844 showIndent(outfile, level) 1845 outfile.write('permanent = %s,\n' % (self.permanent,)) 1846 if self.type_ is not None and 'type_' not in already_processed: 1847 already_processed.append('type_') 1848 showIndent(outfile, level) 1849 outfile.write('type_ = %s,\n' % (self.type_,)) 1850 if self.id is not None and 'id' not in already_processed: 1851 already_processed.append('id') 1852 showIndent(outfile, level) 1853 outfile.write('id = %s,\n' % (self.id,))
1854 - def exportLiteralChildren(self, outfile, level, name_):
1855 if self.Object_Size is not None: 1856 showIndent(outfile, level) 1857 outfile.write('Object_Size=model_.Object_SizeType(\n') 1858 self.Object_Size.exportLiteral(outfile, level, name_='Object_Size') 1859 showIndent(outfile, level) 1860 outfile.write('),\n') 1861 if self.Classifications is not None: 1862 showIndent(outfile, level) 1863 outfile.write('Classifications=model_.ClassificationsType(\n') 1864 self.Classifications.exportLiteral(outfile, level, name_='Classifications') 1865 showIndent(outfile, level) 1866 outfile.write('),\n') 1867 if self.Associated_Code is not None: 1868 showIndent(outfile, level) 1869 outfile.write('Associated_Code=model_.Associated_CodeType(\n') 1870 self.Associated_Code.exportLiteral(outfile, level, name_='Associated_Code') 1871 showIndent(outfile, level) 1872 outfile.write('),\n') 1873 if self.Related_Objects is not None: 1874 showIndent(outfile, level) 1875 outfile.write('Related_Objects=model_.Related_ObjectsType(\n') 1876 self.Related_Objects.exportLiteral(outfile, level, name_='Related_Objects') 1877 showIndent(outfile, level) 1878 outfile.write('),\n') 1879 if self.File_System_Object_Attributes is not None: 1880 showIndent(outfile, level) 1881 outfile.write('File_System_Object_Attributes=model_.File_System_Object_AttributesType(\n') 1882 self.File_System_Object_Attributes.exportLiteral(outfile, level, name_='File_System_Object_Attributes') 1883 showIndent(outfile, level) 1884 outfile.write('),\n') 1885 if self.GUI_Object_Attributes is not None: 1886 showIndent(outfile, level) 1887 outfile.write('GUI_Object_Attributes=model_.GUI_Object_AttributesType(\n') 1888 self.GUI_Object_Attributes.exportLiteral(outfile, level, name_='GUI_Object_Attributes') 1889 showIndent(outfile, level) 1890 outfile.write('),\n') 1891 if self.IPC_Object_Attributes is not None: 1892 showIndent(outfile, level) 1893 outfile.write('IPC_Object_Attributes=model_.IPC_Object_AttributesType(\n') 1894 self.IPC_Object_Attributes.exportLiteral(outfile, level, name_='IPC_Object_Attributes') 1895 showIndent(outfile, level) 1896 outfile.write('),\n') 1897 if self.Internet_Object_Attributes is not None: 1898 showIndent(outfile, level) 1899 outfile.write('Internet_Object_Attributes=model_.Internet_Object_AttributesType(\n') 1900 self.Internet_Object_Attributes.exportLiteral(outfile, level, name_='Internet_Object_Attributes') 1901 showIndent(outfile, level) 1902 outfile.write('),\n') 1903 if self.Module_Object_Attributes is not None: 1904 showIndent(outfile, level) 1905 outfile.write('Module_Object_Attributes=model_.Module_Object_AttributesType(\n') 1906 self.Module_Object_Attributes.exportLiteral(outfile, level, name_='Module_Object_Attributes') 1907 showIndent(outfile, level) 1908 outfile.write('),\n') 1909 if self.Registry_Object_Attributes is not None: 1910 showIndent(outfile, level) 1911 outfile.write('Registry_Object_Attributes=model_.Registry_Object_AttributesType(\n') 1912 self.Registry_Object_Attributes.exportLiteral(outfile, level, name_='Registry_Object_Attributes') 1913 showIndent(outfile, level) 1914 outfile.write('),\n') 1915 if self.Process_Object_Attributes is not None: 1916 showIndent(outfile, level) 1917 outfile.write('Process_Object_Attributes=model_.Process_Object_AttributesType(\n') 1918 self.Process_Object_Attributes.exportLiteral(outfile, level, name_='Process_Object_Attributes') 1919 showIndent(outfile, level) 1920 outfile.write('),\n') 1921 if self.Memory_Object_Attributes is not None: 1922 showIndent(outfile, level) 1923 outfile.write('Memory_Object_Attributes=model_.Memory_Object_AttributesType(\n') 1924 self.Memory_Object_Attributes.exportLiteral(outfile, level, name_='Memory_Object_Attributes') 1925 showIndent(outfile, level) 1926 outfile.write('),\n') 1927 if self.Network_Object_Attributes is not None: 1928 showIndent(outfile, level) 1929 outfile.write('Network_Object_Attributes=model_.Network_Object_AttributesType(\n') 1930 self.Network_Object_Attributes.exportLiteral(outfile, level, name_='Network_Object_Attributes') 1931 showIndent(outfile, level) 1932 outfile.write('),\n') 1933 if self.Daemon_Object_Attributes is not None: 1934 showIndent(outfile, level) 1935 outfile.write('Daemon_Object_Attributes=model_.Daemon_Object_AttributesType(\n') 1936 self.Daemon_Object_Attributes.exportLiteral(outfile, level, name_='Daemon_Object_Attributes') 1937 showIndent(outfile, level) 1938 outfile.write('),\n') 1939 if self.Custom_Object_Attributes is not None: 1940 showIndent(outfile, level) 1941 outfile.write('Custom_Object_Attributes=model_.Custom_Object_AttributesType(\n') 1942 self.Custom_Object_Attributes.exportLiteral(outfile, level, name_='Custom_Object_Attributes') 1943 showIndent(outfile, level) 1944 outfile.write('),\n')
1945 - def build(self, node):
1946 self.buildAttributes(node, node.attrib, []) 1947 for child in node: 1948 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 1949 self.buildChildren(child, node, nodeName_)
1950 - def buildAttributes(self, node, attrs, already_processed):
1951 value = find_attr_value_('object_name', node) 1952 if value is not None and 'object_name' not in already_processed: 1953 already_processed.append('object_name') 1954 self.object_name = value 1955 value = find_attr_value_('permanent', node) 1956 if value is not None and 'permanent' not in already_processed: 1957 already_processed.append('permanent') 1958 if value in ('true', '1'): 1959 self.permanent = True 1960 elif value in ('false', '0'): 1961 self.permanent = False 1962 else: 1963 raise_parse_error(node, 'Bad boolean attribute') 1964 value = find_attr_value_('type', node) 1965 if value is not None and 'type' not in already_processed: 1966 already_processed.append('type') 1967 self.type_ = value 1968 value = find_attr_value_('id', node) 1969 if value is not None and 'id' not in already_processed: 1970 already_processed.append('id') 1971 self.id = value
1972 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1973 if nodeName_ == 'Object_Size': 1974 obj_ = Object_SizeType.factory() 1975 obj_.build(child_) 1976 self.set_Object_Size(obj_) 1977 elif nodeName_ == 'Classifications': 1978 obj_ = ClassificationsType.factory() 1979 obj_.build(child_) 1980 self.set_Classifications(obj_) 1981 elif nodeName_ == 'Associated_Code': 1982 obj_ = Associated_CodeType.factory() 1983 obj_.build(child_) 1984 self.set_Associated_Code(obj_) 1985 elif nodeName_ == 'Related_Objects': 1986 obj_ = Related_ObjectsType.factory() 1987 obj_.build(child_) 1988 self.set_Related_Objects(obj_) 1989 elif nodeName_ == 'File_System_Object_Attributes': 1990 obj_ = File_System_Object_AttributesType.factory() 1991 obj_.build(child_) 1992 self.set_File_System_Object_Attributes(obj_) 1993 elif nodeName_ == 'GUI_Object_Attributes': 1994 obj_ = GUI_Object_AttributesType.factory() 1995 obj_.build(child_) 1996 self.set_GUI_Object_Attributes(obj_) 1997 elif nodeName_ == 'IPC_Object_Attributes': 1998 obj_ = IPC_Object_AttributesType.factory() 1999 obj_.build(child_) 2000 self.set_IPC_Object_Attributes(obj_) 2001 elif nodeName_ == 'Internet_Object_Attributes': 2002 obj_ = Internet_Object_AttributesType.factory() 2003 obj_.build(child_) 2004 self.set_Internet_Object_Attributes(obj_) 2005 elif nodeName_ == 'Module_Object_Attributes': 2006 obj_ = Module_Object_AttributesType.factory() 2007 obj_.build(child_) 2008 self.set_Module_Object_Attributes(obj_) 2009 elif nodeName_ == 'Registry_Object_Attributes': 2010 obj_ = Registry_Object_AttributesType.factory() 2011 obj_.build(child_) 2012 self.set_Registry_Object_Attributes(obj_) 2013 elif nodeName_ == 'Process_Object_Attributes': 2014 obj_ = Process_Object_AttributesType.factory() 2015 obj_.build(child_) 2016 self.set_Process_Object_Attributes(obj_) 2017 elif nodeName_ == 'Memory_Object_Attributes': 2018 obj_ = Memory_Object_AttributesType.factory() 2019 obj_.build(child_) 2020 self.set_Memory_Object_Attributes(obj_) 2021 elif nodeName_ == 'Network_Object_Attributes': 2022 obj_ = Network_Object_AttributesType.factory() 2023 obj_.build(child_) 2024 self.set_Network_Object_Attributes(obj_) 2025 elif nodeName_ == 'Daemon_Object_Attributes': 2026 obj_ = Daemon_Object_AttributesType.factory() 2027 obj_.build(child_) 2028 self.set_Daemon_Object_Attributes(obj_) 2029 elif nodeName_ == 'Custom_Object_Attributes': 2030 obj_ = Custom_Object_AttributesType.factory() 2031 obj_.build(child_) 2032 self.set_Custom_Object_Attributes(obj_)
2033 # end class ObjectType 2034 2035
2036 -class EffectType(GeneratedsSuper):
2037 """EffectType is intended to serve as a method for the characterization 2038 of the results of succesfully executed actions and behaviors.""" 2039 subclass = None 2040 superclass = None
2041 - def __init__(self, id=None, Description=None, Affected_Objects=None, Constituent_Effects=None, Vulnerability_Exploit=None):
2042 self.id = _cast(None, id) 2043 self.Description = Description 2044 self.Affected_Objects = Affected_Objects 2045 self.Constituent_Effects = Constituent_Effects 2046 self.Vulnerability_Exploit = Vulnerability_Exploit
2047 - def factory(*args_, **kwargs_):
2048 if EffectType.subclass: 2049 return EffectType.subclass(*args_, **kwargs_) 2050 else: 2051 return EffectType(*args_, **kwargs_)
2052 factory = staticmethod(factory)
2053 - def get_Description(self): return self.Description
2054 - def set_Description(self, Description): self.Description = Description
2055 - def get_Affected_Objects(self): return self.Affected_Objects
2056 - def set_Affected_Objects(self, Affected_Objects): self.Affected_Objects = Affected_Objects
2057 - def get_Constituent_Effects(self): return self.Constituent_Effects
2058 - def set_Constituent_Effects(self, Constituent_Effects): self.Constituent_Effects = Constituent_Effects
2059 - def get_Vulnerability_Exploit(self): return self.Vulnerability_Exploit
2060 - def set_Vulnerability_Exploit(self, Vulnerability_Exploit): self.Vulnerability_Exploit = Vulnerability_Exploit
2061 - def get_id(self): return self.id
2062 - def set_id(self, id): self.id = id
2063 - def export(self, outfile, level, namespace_='maec:', name_='EffectType', namespacedef_=''):
2064 showIndent(outfile, level) 2065 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2066 already_processed = [] 2067 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectType') 2068 if self.hasContent_(): 2069 outfile.write('>\n') 2070 self.exportChildren(outfile, level + 1, namespace_, name_) 2071 showIndent(outfile, level) 2072 outfile.write('</%s%s>\n' % (namespace_, name_)) 2073 else: 2074 outfile.write('/>\n')
2075 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectType'):
2076 if self.id is not None and 'id' not in already_processed: 2077 already_processed.append('id') 2078 outfile.write(' id=%s' % (quote_attrib(self.id), ))
2079 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectType', fromsubclass_=False):
2080 if self.Description is not None: 2081 self.Description.export(outfile, level, namespace_, name_='Description') 2082 if self.Affected_Objects is not None: 2083 self.Affected_Objects.export(outfile, level, namespace_, name_='Affected_Objects') 2084 if self.Constituent_Effects is not None: 2085 self.Constituent_Effects.export(outfile, level, namespace_, name_='Constituent_Effects') 2086 if self.Vulnerability_Exploit is not None: 2087 self.Vulnerability_Exploit.export(outfile, level, namespace_, name_='Vulnerability_Exploit')
2088 - def hasContent_(self):
2089 if ( 2090 self.Description is not None or 2091 self.Affected_Objects is not None or 2092 self.Constituent_Effects is not None or 2093 self.Vulnerability_Exploit is not None 2094 ): 2095 return True 2096 else: 2097 return False
2098 - def exportLiteral(self, outfile, level, name_='EffectType'):
2099 level += 1 2100 self.exportLiteralAttributes(outfile, level, [], name_) 2101 if self.hasContent_(): 2102 self.exportLiteralChildren(outfile, level, name_)
2103 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2104 if self.id is not None and 'id' not in already_processed: 2105 already_processed.append('id') 2106 showIndent(outfile, level) 2107 outfile.write('id = %s,\n' % (self.id,))
2108 - def exportLiteralChildren(self, outfile, level, name_):
2109 if self.Description is not None: 2110 showIndent(outfile, level) 2111 outfile.write('Description=model_.StructuredTextType(\n') 2112 self.Description.exportLiteral(outfile, level, name_='Description') 2113 showIndent(outfile, level) 2114 outfile.write('),\n') 2115 if self.Affected_Objects is not None: 2116 showIndent(outfile, level) 2117 outfile.write('Affected_Objects=model_.Affected_ObjectsType(\n') 2118 self.Affected_Objects.exportLiteral(outfile, level, name_='Affected_Objects') 2119 showIndent(outfile, level) 2120 outfile.write('),\n') 2121 if self.Constituent_Effects is not None: 2122 showIndent(outfile, level) 2123 outfile.write('Constituent_Effects=model_.Constituent_EffectsType(\n') 2124 self.Constituent_Effects.exportLiteral(outfile, level, name_='Constituent_Effects') 2125 showIndent(outfile, level) 2126 outfile.write('),\n') 2127 if self.Vulnerability_Exploit is not None: 2128 showIndent(outfile, level) 2129 outfile.write('Vulnerability_Exploit=model_.Vulnerability_ExploitType(\n') 2130 self.Vulnerability_Exploit.exportLiteral(outfile, level, name_='Vulnerability_Exploit') 2131 showIndent(outfile, level) 2132 outfile.write('),\n')
2133 - def build(self, node):
2134 self.buildAttributes(node, node.attrib, []) 2135 for child in node: 2136 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2137 self.buildChildren(child, node, nodeName_)
2138 - def buildAttributes(self, node, attrs, already_processed):
2139 value = find_attr_value_('id', node) 2140 if value is not None and 'id' not in already_processed: 2141 already_processed.append('id') 2142 self.id = value
2143 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2144 if nodeName_ == 'Description': 2145 obj_ = StructuredTextType.factory() 2146 obj_.build(child_) 2147 self.set_Description(obj_) 2148 elif nodeName_ == 'Affected_Objects': 2149 obj_ = Affected_ObjectsType.factory() 2150 obj_.build(child_) 2151 self.set_Affected_Objects(obj_) 2152 elif nodeName_ == 'Constituent_Effects': 2153 obj_ = Constituent_EffectsType.factory() 2154 obj_.build(child_) 2155 self.set_Constituent_Effects(obj_) 2156 elif nodeName_ == 'Vulnerability_Exploit': 2157 obj_ = Vulnerability_ExploitType.factory() 2158 obj_.build(child_) 2159 self.set_Vulnerability_Exploit(obj_)
2160 # end class EffectType 2161 2162
2163 -class EffectCollectionType(GeneratedsSuper):
2164 """EffectCollectionType is intended to provide a mechanism for 2165 characterizing collections of effects. For instance, it can be 2166 used to group all of the effects that result from the execution 2167 of a particular malware instance.The name attribute contains the 2168 name of the effect collection, if applicable.""" 2169 subclass = None 2170 superclass = None
2171 - def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Description=None, Effect_Sub_Collection=None, Effect=None, Effect_Reference=None):
2172 self.id = _cast(None, id) 2173 self.name = _cast(None, name) 2174 self.Affinity_Type = Affinity_Type 2175 self.Affinity_Degree = Affinity_Degree 2176 self.Description = Description 2177 if Effect_Sub_Collection is None: 2178 self.Effect_Sub_Collection = [] 2179 else: 2180 self.Effect_Sub_Collection = Effect_Sub_Collection 2181 if Effect is None: 2182 self.Effect = [] 2183 else: 2184 self.Effect = Effect 2185 if Effect_Reference is None: 2186 self.Effect_Reference = [] 2187 else: 2188 self.Effect_Reference = Effect_Reference
2189 - def factory(*args_, **kwargs_):
2190 if EffectCollectionType.subclass: 2191 return EffectCollectionType.subclass(*args_, **kwargs_) 2192 else: 2193 return EffectCollectionType(*args_, **kwargs_)
2194 factory = staticmethod(factory)
2195 - def get_Affinity_Type(self): return self.Affinity_Type
2196 - def set_Affinity_Type(self, Affinity_Type): self.Affinity_Type = Affinity_Type
2197 - def get_Affinity_Degree(self): return self.Affinity_Degree
2198 - def set_Affinity_Degree(self, Affinity_Degree): self.Affinity_Degree = Affinity_Degree
2199 - def get_Description(self): return self.Description
2200 - def set_Description(self, Description): self.Description = Description
2201 - def get_Effect_Sub_Collection(self): return self.Effect_Sub_Collection
2202 - def set_Effect_Sub_Collection(self, Effect_Sub_Collection): self.Effect_Sub_Collection = Effect_Sub_Collection
2203 - def add_Effect_Sub_Collection(self, value): self.Effect_Sub_Collection.append(value)
2204 - def insert_Effect_Sub_Collection(self, index, value): self.Effect_Sub_Collection[index] = value
2205 - def get_Effect(self): return self.Effect
2206 - def set_Effect(self, Effect): self.Effect = Effect
2207 - def add_Effect(self, value): self.Effect.append(value)
2208 - def insert_Effect(self, index, value): self.Effect[index] = value
2209 - def get_Effect_Reference(self): return self.Effect_Reference
2210 - def set_Effect_Reference(self, Effect_Reference): self.Effect_Reference = Effect_Reference
2211 - def add_Effect_Reference(self, value): self.Effect_Reference.append(value)
2212 - def insert_Effect_Reference(self, index, value): self.Effect_Reference[index] = value
2213 - def get_id(self): return self.id
2214 - def set_id(self, id): self.id = id
2215 - def get_name(self): return self.name
2216 - def set_name(self, name): self.name = name
2217 - def export(self, outfile, level, namespace_='maec:', name_='EffectCollectionType', namespacedef_=''):
2218 showIndent(outfile, level) 2219 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2220 already_processed = [] 2221 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectCollectionType') 2222 if self.hasContent_(): 2223 outfile.write('>\n') 2224 self.exportChildren(outfile, level + 1, namespace_, name_) 2225 showIndent(outfile, level) 2226 outfile.write('</%s%s>\n' % (namespace_, name_)) 2227 else: 2228 outfile.write('/>\n')
2229 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectCollectionType'):
2230 if self.id is not None and 'id' not in already_processed: 2231 already_processed.append('id') 2232 outfile.write(' id=%s' % (quote_attrib(self.id), )) 2233 if self.name is not None and 'name' not in already_processed: 2234 already_processed.append('name') 2235 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
2236 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectCollectionType', fromsubclass_=False):
2237 if self.Affinity_Type is not None: 2238 showIndent(outfile, level) 2239 outfile.write('<%sAffinity_Type>%s</%sAffinity_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Type).encode(ExternalEncoding), input_name='Affinity_Type'), namespace_)) 2240 if self.Affinity_Degree is not None: 2241 showIndent(outfile, level) 2242 outfile.write('<%sAffinity_Degree>%s</%sAffinity_Degree>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Degree).encode(ExternalEncoding), input_name='Affinity_Degree'), namespace_)) 2243 if self.Description is not None: 2244 self.Description.export(outfile, level, namespace_, name_='Description') 2245 for Effect_Sub_Collection_ in self.Effect_Sub_Collection: 2246 Effect_Sub_Collection_.export(outfile, level, namespace_, name_='Effect_Sub_Collection') 2247 for Effect_ in self.Effect: 2248 Effect_.export(outfile, level, namespace_, name_='Effect') 2249 for Effect_Reference_ in self.Effect_Reference: 2250 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
2251 - def hasContent_(self):
2252 if ( 2253 self.Affinity_Type is not None or 2254 self.Affinity_Degree is not None or 2255 self.Description is not None or 2256 self.Effect_Sub_Collection or 2257 self.Effect or 2258 self.Effect_Reference 2259 ): 2260 return True 2261 else: 2262 return False
2263 - def exportLiteral(self, outfile, level, name_='EffectCollectionType'):
2264 level += 1 2265 self.exportLiteralAttributes(outfile, level, [], name_) 2266 if self.hasContent_(): 2267 self.exportLiteralChildren(outfile, level, name_)
2268 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2269 if self.id is not None and 'id' not in already_processed: 2270 already_processed.append('id') 2271 showIndent(outfile, level) 2272 outfile.write('id = %s,\n' % (self.id,)) 2273 if self.name is not None and 'name' not in already_processed: 2274 already_processed.append('name') 2275 showIndent(outfile, level) 2276 outfile.write('name = "%s",\n' % (self.name,))
2277 - def exportLiteralChildren(self, outfile, level, name_):
2278 if self.Affinity_Type is not None: 2279 showIndent(outfile, level) 2280 outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding)) 2281 if self.Affinity_Degree is not None: 2282 showIndent(outfile, level) 2283 outfile.write('Affinity_Degree=%s,\n' % quote_python(self.Affinity_Degree).encode(ExternalEncoding)) 2284 if self.Description is not None: 2285 showIndent(outfile, level) 2286 outfile.write('Description=model_.StructuredTextType(\n') 2287 self.Description.exportLiteral(outfile, level, name_='Description') 2288 showIndent(outfile, level) 2289 outfile.write('),\n') 2290 showIndent(outfile, level) 2291 outfile.write('Effect_Sub_Collection=[\n') 2292 level += 1 2293 for Effect_Sub_Collection_ in self.Effect_Sub_Collection: 2294 showIndent(outfile, level) 2295 outfile.write('model_.EffectCollectionType(\n') 2296 Effect_Sub_Collection_.exportLiteral(outfile, level, name_='EffectCollectionType') 2297 showIndent(outfile, level) 2298 outfile.write('),\n') 2299 level -= 1 2300 showIndent(outfile, level) 2301 outfile.write('],\n') 2302 showIndent(outfile, level) 2303 outfile.write('Effect=[\n') 2304 level += 1 2305 for Effect_ in self.Effect: 2306 showIndent(outfile, level) 2307 outfile.write('model_.EffectType(\n') 2308 Effect_.exportLiteral(outfile, level, name_='EffectType') 2309 showIndent(outfile, level) 2310 outfile.write('),\n') 2311 level -= 1 2312 showIndent(outfile, level) 2313 outfile.write('],\n') 2314 showIndent(outfile, level) 2315 outfile.write('Effect_Reference=[\n') 2316 level += 1 2317 for Effect_Reference_ in self.Effect_Reference: 2318 showIndent(outfile, level) 2319 outfile.write('model_.EffectReferenceType(\n') 2320 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType') 2321 showIndent(outfile, level) 2322 outfile.write('),\n') 2323 level -= 1 2324 showIndent(outfile, level) 2325 outfile.write('],\n')
2326 - def build(self, node):
2327 self.buildAttributes(node, node.attrib, []) 2328 for child in node: 2329 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2330 self.buildChildren(child, node, nodeName_)
2331 - def buildAttributes(self, node, attrs, already_processed):
2332 value = find_attr_value_('id', node) 2333 if value is not None and 'id' not in already_processed: 2334 already_processed.append('id') 2335 self.id = value 2336 value = find_attr_value_('name', node) 2337 if value is not None and 'name' not in already_processed: 2338 already_processed.append('name') 2339 self.name = value
2340 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2341 if nodeName_ == 'Affinity_Type': 2342 Affinity_Type_ = child_.text 2343 Affinity_Type_ = self.gds_validate_string(Affinity_Type_, node, 'Affinity_Type') 2344 self.Affinity_Type = Affinity_Type_ 2345 elif nodeName_ == 'Affinity_Degree': 2346 Affinity_Degree_ = child_.text 2347 Affinity_Degree_ = self.gds_validate_string(Affinity_Degree_, node, 'Affinity_Degree') 2348 self.Affinity_Degree = Affinity_Degree_ 2349 elif nodeName_ == 'Description': 2350 obj_ = StructuredTextType.factory() 2351 obj_.build(child_) 2352 self.set_Description(obj_) 2353 elif nodeName_ == 'Effect_Sub_Collection': 2354 obj_ = EffectCollectionType.factory() 2355 obj_.build(child_) 2356 self.Effect_Sub_Collection.append(obj_) 2357 elif nodeName_ == 'Effect': 2358 obj_ = EffectType.factory() 2359 obj_.build(child_) 2360 self.Effect.append(obj_) 2361 elif nodeName_ == 'Effect_Reference': 2362 obj_ = EffectReferenceType.factory() 2363 obj_.build(child_) 2364 self.Effect_Reference.append(obj_)
2365 # end class EffectCollectionType 2366 2367
2368 -class EffectReferenceType(GeneratedsSuper):
2369 """EffectReferenceType is intended to serve as a method for linking to 2370 effects.The effect_id attribute refers to the ID of the effect 2371 being referenced.The type attribute refers to the type of effect 2372 entity that is being referenced. Possible values: Effect, 2373 Effect_Collection.""" 2374 subclass = None 2375 superclass = None
2376 - def __init__(self, type_=None, effect_id=None):
2377 self.type_ = _cast(None, type_) 2378 self.effect_id = _cast(None, effect_id) 2379 pass
2380 - def factory(*args_, **kwargs_):
2381 if EffectReferenceType.subclass: 2382 return EffectReferenceType.subclass(*args_, **kwargs_) 2383 else: 2384 return EffectReferenceType(*args_, **kwargs_)
2385 factory = staticmethod(factory)
2386 - def get_type(self): return self.type_
2387 - def set_type(self, type_): self.type_ = type_
2388 - def get_effect_id(self): return self.effect_id
2389 - def set_effect_id(self, effect_id): self.effect_id = effect_id
2390 - def export(self, outfile, level, namespace_='maec:', name_='EffectReferenceType', namespacedef_=''):
2391 showIndent(outfile, level) 2392 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2393 already_processed = [] 2394 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectReferenceType') 2395 if self.hasContent_(): 2396 outfile.write('>\n') 2397 self.exportChildren(outfile, level + 1, namespace_, name_) 2398 outfile.write('</%s%s>\n' % (namespace_, name_)) 2399 else: 2400 outfile.write('/>\n')
2401 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectReferenceType'):
2402 if self.type_ is not None and 'type_' not in already_processed: 2403 already_processed.append('type_') 2404 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), )) 2405 if self.effect_id is not None and 'effect_id' not in already_processed: 2406 already_processed.append('effect_id') 2407 outfile.write(' effect_id=%s' % (quote_attrib(self.effect_id), ))
2408 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectReferenceType', fromsubclass_=False):
2409 pass
2410 - def hasContent_(self):
2411 if ( 2412 2413 ): 2414 return True 2415 else: 2416 return False
2417 - def exportLiteral(self, outfile, level, name_='EffectReferenceType'):
2418 level += 1 2419 self.exportLiteralAttributes(outfile, level, [], name_) 2420 if self.hasContent_(): 2421 self.exportLiteralChildren(outfile, level, name_)
2422 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2423 if self.type_ is not None and 'type_' not in already_processed: 2424 already_processed.append('type_') 2425 showIndent(outfile, level) 2426 outfile.write('type_ = "%s",\n' % (self.type_,)) 2427 if self.effect_id is not None and 'effect_id' not in already_processed: 2428 already_processed.append('effect_id') 2429 showIndent(outfile, level) 2430 outfile.write('effect_id = %s,\n' % (self.effect_id,))
2431 - def exportLiteralChildren(self, outfile, level, name_):
2432 pass
2433 - def build(self, node):
2434 self.buildAttributes(node, node.attrib, []) 2435 for child in node: 2436 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2437 self.buildChildren(child, node, nodeName_)
2438 - def buildAttributes(self, node, attrs, already_processed):
2439 value = find_attr_value_('type', node) 2440 if value is not None and 'type' not in already_processed: 2441 already_processed.append('type') 2442 self.type_ = value 2443 value = find_attr_value_('effect_id', node) 2444 if value is not None and 'effect_id' not in already_processed: 2445 already_processed.append('effect_id') 2446 self.effect_id = value
2447 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2448 pass
2449 # end class EffectReferenceType 2450 2451
2452 -class StructuredTextType(GeneratedsSuper):
2453 subclass = None 2454 superclass = None
2455 - def __init__(self, Text_Title=None, Text=None, Code_Example_Language=None, Code=None, Images=None, Block=None):
2456 if Text_Title is None: 2457 self.Text_Title = [] 2458 else: 2459 self.Text_Title = Text_Title 2460 if Text is None: 2461 self.Text = [] 2462 else: 2463 self.Text = Text 2464 if Code_Example_Language is None: 2465 self.Code_Example_Language = [] 2466 else: 2467 self.Code_Example_Language = Code_Example_Language 2468 if Code is None: 2469 self.Code = [] 2470 else: 2471 self.Code = Code 2472 self.Images = Images 2473 self.Block = Block
2474 - def factory(*args_, **kwargs_):
2475 if StructuredTextType.subclass: 2476 return StructuredTextType.subclass(*args_, **kwargs_) 2477 else: 2478 return StructuredTextType(*args_, **kwargs_)
2479 factory = staticmethod(factory)
2480 - def get_Text_Title(self): return self.Text_Title
2481 - def set_Text_Title(self, Text_Title): self.Text_Title = Text_Title
2482 - def add_Text_Title(self, value): self.Text_Title.append(value)
2483 - def insert_Text_Title(self, index, value): self.Text_Title[index] = value
2484 - def get_Text(self): return self.Text
2485 - def set_Text(self, Text): self.Text = Text
2486 - def add_Text(self, value): self.Text.append(value)
2487 - def insert_Text(self, index, value): self.Text[index] = value
2488 - def get_Code_Example_Language(self): return self.Code_Example_Language
2489 - def set_Code_Example_Language(self, Code_Example_Language): self.Code_Example_Language = Code_Example_Language
2490 - def add_Code_Example_Language(self, value): self.Code_Example_Language.append(value)
2491 - def insert_Code_Example_Language(self, index, value): self.Code_Example_Language[index] = value
2492 - def validate_LanguageEnum(self, value):
2493 # Validate type LanguageEnum, a restriction on xs:string. 2494 pass
2495 - def get_Code(self): return self.Code
2496 - def set_Code(self, Code): self.Code = Code
2497 - def add_Code(self, value): self.Code.append(value)
2498 - def insert_Code(self, index, value): self.Code[index] = value
2499 - def get_Images(self): return self.Images
2500 - def set_Images(self, Images): self.Images = Images
2501 - def get_Block(self): return self.Block
2502 - def set_Block(self, Block): self.Block = Block
2503 - def export(self, outfile, level, namespace_='maec:', name_='StructuredTextType', namespacedef_=''):
2504 showIndent(outfile, level) 2505 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2506 already_processed = [] 2507 self.exportAttributes(outfile, level, already_processed, namespace_, name_='StructuredTextType') 2508 if self.hasContent_(): 2509 outfile.write('>\n') 2510 self.exportChildren(outfile, level + 1, namespace_, name_) 2511 showIndent(outfile, level) 2512 outfile.write('</%s%s>\n' % (namespace_, name_)) 2513 else: 2514 outfile.write('/>\n')
2515 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='StructuredTextType'):
2516 pass
2517 - def exportChildren(self, outfile, level, namespace_='maec:', name_='StructuredTextType', fromsubclass_=False):
2518 for Text_Title_ in self.Text_Title: 2519 showIndent(outfile, level) 2520 outfile.write('<%sText_Title>%s</%sText_Title>\n' % (namespace_, self.gds_format_string(quote_xml(Text_Title_).encode(ExternalEncoding), input_name='Text_Title'), namespace_)) 2521 for Text_ in self.Text: 2522 showIndent(outfile, level) 2523 outfile.write('<%sText>%s</%sText>\n' % (namespace_, self.gds_format_string(quote_xml(Text_).encode(ExternalEncoding), input_name='Text'), namespace_)) 2524 for Code_Example_Language_ in self.Code_Example_Language: 2525 showIndent(outfile, level) 2526 outfile.write('<%sCode_Example_Language>%s</%sCode_Example_Language>\n' % (namespace_, self.gds_format_string(quote_xml(Code_Example_Language_).encode(ExternalEncoding), input_name='Code_Example_Language'), namespace_)) 2527 for Code_ in self.Code: 2528 showIndent(outfile, level) 2529 outfile.write('<%sCode>%s</%sCode>\n' % (namespace_, self.gds_format_string(quote_xml(Code_).encode(ExternalEncoding), input_name='Code'), namespace_)) 2530 if self.Images is not None: 2531 self.Images.export(outfile, level, namespace_, name_='Images') 2532 if self.Block is not None: 2533 self.Block.export(outfile, level, namespace_, name_='Block', )
2534 - def hasContent_(self):
2535 if ( 2536 self.Text_Title or 2537 self.Text or 2538 self.Code_Example_Language or 2539 self.Code or 2540 self.Images is not None or 2541 self.Block is not None 2542 ): 2543 return True 2544 else: 2545 return False
2546 - def exportLiteral(self, outfile, level, name_='StructuredTextType'):
2547 level += 1 2548 self.exportLiteralAttributes(outfile, level, [], name_) 2549 if self.hasContent_(): 2550 self.exportLiteralChildren(outfile, level, name_)
2551 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2552 pass
2553 - def exportLiteralChildren(self, outfile, level, name_):
2554 showIndent(outfile, level) 2555 outfile.write('Text_Title=[\n') 2556 level += 1 2557 for Text_Title_ in self.Text_Title: 2558 showIndent(outfile, level) 2559 outfile.write('%s,\n' % quote_python(Text_Title_).encode(ExternalEncoding)) 2560 level -= 1 2561 showIndent(outfile, level) 2562 outfile.write('],\n') 2563 showIndent(outfile, level) 2564 outfile.write('Text=[\n') 2565 level += 1 2566 for Text_ in self.Text: 2567 showIndent(outfile, level) 2568 outfile.write('%s,\n' % quote_python(Text_).encode(ExternalEncoding)) 2569 level -= 1 2570 showIndent(outfile, level) 2571 outfile.write('],\n') 2572 showIndent(outfile, level) 2573 outfile.write('Code_Example_Language=[\n') 2574 level += 1 2575 for Code_Example_Language_ in self.Code_Example_Language: 2576 showIndent(outfile, level) 2577 outfile.write('%s,\n' % quote_python(Code_Example_Language_).encode(ExternalEncoding)) 2578 level -= 1 2579 showIndent(outfile, level) 2580 outfile.write('],\n') 2581 showIndent(outfile, level) 2582 outfile.write('Code=[\n') 2583 level += 1 2584 for Code_ in self.Code: 2585 showIndent(outfile, level) 2586 outfile.write('%s,\n' % quote_python(Code_).encode(ExternalEncoding)) 2587 level -= 1 2588 showIndent(outfile, level) 2589 outfile.write('],\n') 2590 if self.Images is not None: 2591 showIndent(outfile, level) 2592 outfile.write('Images=model_.ImagesType(\n') 2593 self.Images.exportLiteral(outfile, level, name_='Images') 2594 showIndent(outfile, level) 2595 outfile.write('),\n') 2596 if self.Block is not None: 2597 showIndent(outfile, level) 2598 outfile.write('Block=model_.Block(\n') 2599 self.Block.exportLiteral(outfile, level) 2600 showIndent(outfile, level) 2601 outfile.write('),\n')
2602 - def build(self, node):
2603 self.buildAttributes(node, node.attrib, []) 2604 for child in node: 2605 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2606 self.buildChildren(child, node, nodeName_)
2607 - def buildAttributes(self, node, attrs, already_processed):
2608 pass
2609 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2610 if nodeName_ == 'Text_Title': 2611 Text_Title_ = child_.text 2612 Text_Title_ = self.gds_validate_string(Text_Title_, node, 'Text_Title') 2613 self.Text_Title.append(Text_Title_) 2614 elif nodeName_ == 'Text': 2615 Text_ = child_.text 2616 Text_ = self.gds_validate_string(Text_, node, 'Text') 2617 self.Text.append(Text_) 2618 elif nodeName_ == 'Code_Example_Language': 2619 Code_Example_Language_ = child_.text 2620 Code_Example_Language_ = self.gds_validate_string(Code_Example_Language_, node, 'Code_Example_Language') 2621 self.Code_Example_Language.append(Code_Example_Language_) 2622 self.validate_LanguageEnum(self.Code_Example_Language) # validate type LanguageEnum 2623 elif nodeName_ == 'Code': 2624 Code_ = child_.text 2625 Code_ = self.gds_validate_string(Code_, node, 'Code') 2626 self.Code.append(Code_) 2627 elif nodeName_ == 'Images': 2628 obj_ = ImagesType.factory() 2629 obj_.build(child_) 2630 self.set_Images(obj_) 2631 elif nodeName_ == 'Block': 2632 obj_ = Block.factory() 2633 obj_.build(child_) 2634 self.set_Block(obj_)
2635 # end class StructuredTextType 2636 2637
2638 -class Block(GeneratedsSuper):
2639 """Block is a Structured_Text element consisting of one of Text_Title, 2640 Text, Code_Example_Language, or Code followed by another Block 2641 element. Structured_Text elements help define whitespace and 2642 text segments. This attribute identifies the nature of the 2643 content containedwithin the Block.""" 2644 subclass = None 2645 superclass = None
2646 - def __init__(self, Block_Nature=None, Text_Title=None, Text=None, Code_Example_Language=None, Code=None, Images=None, Block=None):
2647 self.Block_Nature = _cast(None, Block_Nature) 2648 if Text_Title is None: 2649 self.Text_Title = [] 2650 else: 2651 self.Text_Title = Text_Title 2652 if Text is None: 2653 self.Text = [] 2654 else: 2655 self.Text = Text 2656 if Code_Example_Language is None: 2657 self.Code_Example_Language = [] 2658 else: 2659 self.Code_Example_Language = Code_Example_Language 2660 if Code is None: 2661 self.Code = [] 2662 else: 2663 self.Code = Code 2664 self.Images = Images 2665 self.Block = Block
2666 - def factory(*args_, **kwargs_):
2667 if Block.subclass: 2668 return Block.subclass(*args_, **kwargs_) 2669 else: 2670 return Block(*args_, **kwargs_)
2671 factory = staticmethod(factory)
2672 - def get_Text_Title(self): return self.Text_Title
2673 - def set_Text_Title(self, Text_Title): self.Text_Title = Text_Title
2674 - def add_Text_Title(self, value): self.Text_Title.append(value)
2675 - def insert_Text_Title(self, index, value): self.Text_Title[index] = value
2676 - def get_Text(self): return self.Text
2677 - def set_Text(self, Text): self.Text = Text
2678 - def add_Text(self, value): self.Text.append(value)
2679 - def insert_Text(self, index, value): self.Text[index] = value
2680 - def get_Code_Example_Language(self): return self.Code_Example_Language
2681 - def set_Code_Example_Language(self, Code_Example_Language): self.Code_Example_Language = Code_Example_Language
2682 - def add_Code_Example_Language(self, value): self.Code_Example_Language.append(value)
2683 - def insert_Code_Example_Language(self, index, value): self.Code_Example_Language[index] = value
2684 - def validate_LanguageEnum(self, value):
2685 # Validate type LanguageEnum, a restriction on xs:string. 2686 pass
2687 - def get_Code(self): return self.Code
2688 - def set_Code(self, Code): self.Code = Code
2689 - def add_Code(self, value): self.Code.append(value)
2690 - def insert_Code(self, index, value): self.Code[index] = value
2691 - def get_Images(self): return self.Images
2692 - def set_Images(self, Images): self.Images = Images
2693 - def get_Block(self): return self.Block
2694 - def set_Block(self, Block): self.Block = Block
2695 - def get_Block_Nature(self): return self.Block_Nature
2696 - def set_Block_Nature(self, Block_Nature): self.Block_Nature = Block_Nature
2697 - def export(self, outfile, level, namespace_='maec:', name_='Block', namespacedef_=''):
2698 showIndent(outfile, level) 2699 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2700 already_processed = [] 2701 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Block') 2702 if self.hasContent_(): 2703 outfile.write('>\n') 2704 self.exportChildren(outfile, level + 1, namespace_, name_) 2705 showIndent(outfile, level) 2706 outfile.write('</%s%s>\n' % (namespace_, name_)) 2707 else: 2708 outfile.write('/>\n')
2709 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Block'):
2710 if self.Block_Nature is not None and 'Block_Nature' not in already_processed: 2711 already_processed.append('Block_Nature') 2712 outfile.write(' Block_Nature=%s' % (self.gds_format_string(quote_attrib(self.Block_Nature).encode(ExternalEncoding), input_name='Block_Nature'), ))
2713 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Block', fromsubclass_=False):
2714 for Text_Title_ in self.Text_Title: 2715 showIndent(outfile, level) 2716 outfile.write('<%sText_Title>%s</%sText_Title>\n' % (namespace_, self.gds_format_string(quote_xml(Text_Title_).encode(ExternalEncoding), input_name='Text_Title'), namespace_)) 2717 for Text_ in self.Text: 2718 showIndent(outfile, level) 2719 outfile.write('<%sText>%s</%sText>\n' % (namespace_, self.gds_format_string(quote_xml(Text_).encode(ExternalEncoding), input_name='Text'), namespace_)) 2720 for Code_Example_Language_ in self.Code_Example_Language: 2721 showIndent(outfile, level) 2722 outfile.write('<%sCode_Example_Language>%s</%sCode_Example_Language>\n' % (namespace_, self.gds_format_string(quote_xml(Code_Example_Language_).encode(ExternalEncoding), input_name='Code_Example_Language'), namespace_)) 2723 for Code_ in self.Code: 2724 showIndent(outfile, level) 2725 outfile.write('<%sCode>%s</%sCode>\n' % (namespace_, self.gds_format_string(quote_xml(Code_).encode(ExternalEncoding), input_name='Code'), namespace_)) 2726 if self.Images is not None: 2727 self.Images.export(outfile, level, namespace_, name_='Images') 2728 if self.Block is not None: 2729 self.Block.export(outfile, level, namespace_, name_='Block', )
2730 - def hasContent_(self):
2731 if ( 2732 self.Text_Title or 2733 self.Text or 2734 self.Code_Example_Language or 2735 self.Code or 2736 self.Images is not None or 2737 self.Block is not None 2738 ): 2739 return True 2740 else: 2741 return False
2742 - def exportLiteral(self, outfile, level, name_='Block'):
2743 level += 1 2744 self.exportLiteralAttributes(outfile, level, [], name_) 2745 if self.hasContent_(): 2746 self.exportLiteralChildren(outfile, level, name_)
2747 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2748 if self.Block_Nature is not None and 'Block_Nature' not in already_processed: 2749 already_processed.append('Block_Nature') 2750 showIndent(outfile, level) 2751 outfile.write('Block_Nature = "%s",\n' % (self.Block_Nature,))
2752 - def exportLiteralChildren(self, outfile, level, name_):
2753 showIndent(outfile, level) 2754 outfile.write('Text_Title=[\n') 2755 level += 1 2756 for Text_Title_ in self.Text_Title: 2757 showIndent(outfile, level) 2758 outfile.write('%s,\n' % quote_python(Text_Title_).encode(ExternalEncoding)) 2759 level -= 1 2760 showIndent(outfile, level) 2761 outfile.write('],\n') 2762 showIndent(outfile, level) 2763 outfile.write('Text=[\n') 2764 level += 1 2765 for Text_ in self.Text: 2766 showIndent(outfile, level) 2767 outfile.write('%s,\n' % quote_python(Text_).encode(ExternalEncoding)) 2768 level -= 1 2769 showIndent(outfile, level) 2770 outfile.write('],\n') 2771 showIndent(outfile, level) 2772 outfile.write('Code_Example_Language=[\n') 2773 level += 1 2774 for Code_Example_Language_ in self.Code_Example_Language: 2775 showIndent(outfile, level) 2776 outfile.write('%s,\n' % quote_python(Code_Example_Language_).encode(ExternalEncoding)) 2777 level -= 1 2778 showIndent(outfile, level) 2779 outfile.write('],\n') 2780 showIndent(outfile, level) 2781 outfile.write('Code=[\n') 2782 level += 1 2783 for Code_ in self.Code: 2784 showIndent(outfile, level) 2785 outfile.write('%s,\n' % quote_python(Code_).encode(ExternalEncoding)) 2786 level -= 1 2787 showIndent(outfile, level) 2788 outfile.write('],\n') 2789 if self.Images is not None: 2790 showIndent(outfile, level) 2791 outfile.write('Images=model_.ImagesType2(\n') 2792 self.Images.exportLiteral(outfile, level, name_='Images') 2793 showIndent(outfile, level) 2794 outfile.write('),\n') 2795 if self.Block is not None: 2796 showIndent(outfile, level) 2797 outfile.write('Block=model_.Block(\n') 2798 self.Block.exportLiteral(outfile, level) 2799 showIndent(outfile, level) 2800 outfile.write('),\n')
2801 - def build(self, node):
2802 self.buildAttributes(node, node.attrib, []) 2803 for child in node: 2804 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 2805 self.buildChildren(child, node, nodeName_)
2806 - def buildAttributes(self, node, attrs, already_processed):
2807 value = find_attr_value_('Block_Nature', node) 2808 if value is not None and 'Block_Nature' not in already_processed: 2809 already_processed.append('Block_Nature') 2810 self.Block_Nature = value
2811 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2812 if nodeName_ == 'Text_Title': 2813 Text_Title_ = child_.text 2814 Text_Title_ = self.gds_validate_string(Text_Title_, node, 'Text_Title') 2815 self.Text_Title.append(Text_Title_) 2816 elif nodeName_ == 'Text': 2817 Text_ = child_.text 2818 Text_ = self.gds_validate_string(Text_, node, 'Text') 2819 self.Text.append(Text_) 2820 elif nodeName_ == 'Code_Example_Language': 2821 Code_Example_Language_ = child_.text 2822 Code_Example_Language_ = self.gds_validate_string(Code_Example_Language_, node, 'Code_Example_Language') 2823 self.Code_Example_Language.append(Code_Example_Language_) 2824 self.validate_LanguageEnum(self.Code_Example_Language) # validate type LanguageEnum 2825 elif nodeName_ == 'Code': 2826 Code_ = child_.text 2827 Code_ = self.gds_validate_string(Code_, node, 'Code') 2828 self.Code.append(Code_) 2829 elif nodeName_ == 'Images': 2830 obj_ = ImagesType2.factory() 2831 obj_.build(child_) 2832 self.set_Images(obj_) 2833 elif nodeName_ == 'Block': 2834 obj_ = Block.factory() 2835 obj_.build(child_) 2836 self.set_Block(obj_)
2837 # end class Block 2838 2839
2840 -class ActionImplementationType(GeneratedsSuper):
2841 """ActionImplementationType is intended to serve as a method for the 2842 characterization of action implementations. Currently supported 2843 are implementation achieved through API function calls and 2844 abstractly defined code. The type attribute refers to the type 2845 of action implementation being characterized. Possible values: 2846 API_Call, Code, Other.""" 2847 subclass = None 2848 superclass = None
2849 - def __init__(self, type_=None, id=None, API_Call=None, Code=None, Platform=None, Data_Read=None, Data_Written=None, File_System_Action_Attributes=None, IPC_Action_Attributes=None, Process_Action_Attributes=None, Memory_Action_Attributes=None, Registry_Action_Attributes=None, Network_Action_Attributes=None, Module_Action_Attributes=None, Daemon_Action_Attributes=None, System_Action_Attributes=None, Internet_Action_Attributes=None):
2850 self.type_ = _cast(None, type_) 2851 self.id = _cast(None, id) 2852 self.API_Call = API_Call 2853 if Code is None: 2854 self.Code = [] 2855 else: 2856 self.Code = Code 2857 self.Platform = Platform 2858 self.Data_Read = Data_Read 2859 self.Data_Written = Data_Written 2860 self.File_System_Action_Attributes = File_System_Action_Attributes 2861 self.IPC_Action_Attributes = IPC_Action_Attributes 2862 self.Process_Action_Attributes = Process_Action_Attributes 2863 self.Memory_Action_Attributes = Memory_Action_Attributes 2864 self.Registry_Action_Attributes = Registry_Action_Attributes 2865 self.Network_Action_Attributes = Network_Action_Attributes 2866 self.Module_Action_Attributes = Module_Action_Attributes 2867 self.Daemon_Action_Attributes = Daemon_Action_Attributes 2868 self.System_Action_Attributes = System_Action_Attributes 2869 self.Internet_Action_Attributes = Internet_Action_Attributes
2870 - def factory(*args_, **kwargs_):
2871 if ActionImplementationType.subclass: 2872 return ActionImplementationType.subclass(*args_, **kwargs_) 2873 else: 2874 return ActionImplementationType(*args_, **kwargs_)
2875 factory = staticmethod(factory)
2876 - def get_API_Call(self): return self.API_Call
2877 - def set_API_Call(self, API_Call): self.API_Call = API_Call
2878 - def get_Code(self): return self.Code
2879 - def set_Code(self, Code): self.Code = Code
2880 - def add_Code(self, value): self.Code.append(value)
2881 - def insert_Code(self, index, value): self.Code[index] = value
2882 - def get_Platform(self): return self.Platform
2883 - def set_Platform(self, Platform): self.Platform = Platform
2884 - def get_Data_Read(self): return self.Data_Read
2885 - def set_Data_Read(self, Data_Read): self.Data_Read = Data_Read
2886 - def get_Data_Written(self): return self.Data_Written
2887 - def set_Data_Written(self, Data_Written): self.Data_Written = Data_Written
2888 - def get_File_System_Action_Attributes(self): return self.File_System_Action_Attributes
2889 - def set_File_System_Action_Attributes(self, File_System_Action_Attributes): self.File_System_Action_Attributes = File_System_Action_Attributes
2890 - def get_IPC_Action_Attributes(self): return self.IPC_Action_Attributes
2891 - def set_IPC_Action_Attributes(self, IPC_Action_Attributes): self.IPC_Action_Attributes = IPC_Action_Attributes
2892 - def get_Process_Action_Attributes(self): return self.Process_Action_Attributes
2893 - def set_Process_Action_Attributes(self, Process_Action_Attributes): self.Process_Action_Attributes = Process_Action_Attributes
2894 - def get_Memory_Action_Attributes(self): return self.Memory_Action_Attributes
2895 - def set_Memory_Action_Attributes(self, Memory_Action_Attributes): self.Memory_Action_Attributes = Memory_Action_Attributes
2896 - def get_Registry_Action_Attributes(self): return self.Registry_Action_Attributes
2897 - def set_Registry_Action_Attributes(self, Registry_Action_Attributes): self.Registry_Action_Attributes = Registry_Action_Attributes
2898 - def get_Network_Action_Attributes(self): return self.Network_Action_Attributes
2899 - def set_Network_Action_Attributes(self, Network_Action_Attributes): self.Network_Action_Attributes = Network_Action_Attributes
2900 - def get_Module_Action_Attributes(self): return self.Module_Action_Attributes
2901 - def set_Module_Action_Attributes(self, Module_Action_Attributes): self.Module_Action_Attributes = Module_Action_Attributes
2902 - def get_Daemon_Action_Attributes(self): return self.Daemon_Action_Attributes
2903 - def set_Daemon_Action_Attributes(self, Daemon_Action_Attributes): self.Daemon_Action_Attributes = Daemon_Action_Attributes
2904 - def get_System_Action_Attributes(self): return self.System_Action_Attributes
2905 - def set_System_Action_Attributes(self, System_Action_Attributes): self.System_Action_Attributes = System_Action_Attributes
2906 - def get_Internet_Action_Attributes(self): return self.Internet_Action_Attributes
2907 - def set_Internet_Action_Attributes(self, Internet_Action_Attributes): self.Internet_Action_Attributes = Internet_Action_Attributes
2908 - def get_type(self): return self.type_
2909 - def set_type(self, type_): self.type_ = type_
2910 - def get_id(self): return self.id
2911 - def set_id(self, id): self.id = id
2912 - def export(self, outfile, level, namespace_='maec:', name_='ActionImplementationType', namespacedef_=''):
2913 showIndent(outfile, level) 2914 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 2915 already_processed = [] 2916 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionImplementationType') 2917 if self.hasContent_(): 2918 outfile.write('>\n') 2919 self.exportChildren(outfile, level + 1, namespace_, name_) 2920 showIndent(outfile, level) 2921 outfile.write('</%s%s>\n' % (namespace_, name_)) 2922 else: 2923 outfile.write('/>\n')
2924 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionImplementationType'):
2925 if self.type_ is not None and 'type_' not in already_processed: 2926 already_processed.append('type_') 2927 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), )) 2928 if self.id is not None and 'id' not in already_processed: 2929 already_processed.append('id') 2930 outfile.write(' id=%s' % (quote_attrib(self.id), ))
2931 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionImplementationType', fromsubclass_=False):
2932 if self.API_Call is not None: 2933 self.API_Call.export(outfile, level, namespace_, name_='API_Call') 2934 for Code_ in self.Code: 2935 Code_.export(outfile, level, namespace_, name_='Code') 2936 if self.Platform is not None: 2937 self.Platform.export(outfile, level, namespace_, name_='Platform') 2938 if self.Data_Read is not None: 2939 self.Data_Read.export(outfile, level, namespace_, name_='Data_Read') 2940 if self.Data_Written is not None: 2941 self.Data_Written.export(outfile, level, namespace_, name_='Data_Written') 2942 if self.File_System_Action_Attributes is not None: 2943 self.File_System_Action_Attributes.export(outfile, level, namespace_, name_='File_System_Action_Attributes') 2944 if self.IPC_Action_Attributes is not None: 2945 self.IPC_Action_Attributes.export(outfile, level, namespace_, name_='IPC_Action_Attributes') 2946 if self.Process_Action_Attributes is not None: 2947 self.Process_Action_Attributes.export(outfile, level, namespace_, name_='Process_Action_Attributes') 2948 if self.Memory_Action_Attributes is not None: 2949 self.Memory_Action_Attributes.export(outfile, level, namespace_, name_='Memory_Action_Attributes') 2950 if self.Registry_Action_Attributes is not None: 2951 self.Registry_Action_Attributes.export(outfile, level, namespace_, name_='Registry_Action_Attributes') 2952 if self.Network_Action_Attributes is not None: 2953 self.Network_Action_Attributes.export(outfile, level, namespace_, name_='Network_Action_Attributes') 2954 if self.Module_Action_Attributes is not None: 2955 self.Module_Action_Attributes.export(outfile, level, namespace_, name_='Module_Action_Attributes') 2956 if self.Daemon_Action_Attributes is not None: 2957 self.Daemon_Action_Attributes.export(outfile, level, namespace_, name_='Daemon_Action_Attributes') 2958 if self.System_Action_Attributes is not None: 2959 self.System_Action_Attributes.export(outfile, level, namespace_, name_='System_Action_Attributes') 2960 if self.Internet_Action_Attributes is not None: 2961 self.Internet_Action_Attributes.export(outfile, level, namespace_, name_='Internet_Action_Attributes')
2962 - def hasContent_(self):
2963 if ( 2964 self.API_Call is not None or 2965 self.Code or 2966 self.Platform is not None or 2967 self.Data_Read is not None or 2968 self.Data_Written is not None or 2969 self.File_System_Action_Attributes is not None or 2970 self.IPC_Action_Attributes is not None or 2971 self.Process_Action_Attributes is not None or 2972 self.Memory_Action_Attributes is not None or 2973 self.Registry_Action_Attributes is not None or 2974 self.Network_Action_Attributes is not None or 2975 self.Module_Action_Attributes is not None or 2976 self.Daemon_Action_Attributes is not None or 2977 self.System_Action_Attributes is not None or 2978 self.Internet_Action_Attributes is not None 2979 ): 2980 return True 2981 else: 2982 return False
2983 - def exportLiteral(self, outfile, level, name_='ActionImplementationType'):
2984 level += 1 2985 self.exportLiteralAttributes(outfile, level, [], name_) 2986 if self.hasContent_(): 2987 self.exportLiteralChildren(outfile, level, name_)
2988 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2989 if self.type_ is not None and 'type_' not in already_processed: 2990 already_processed.append('type_') 2991 showIndent(outfile, level) 2992 outfile.write('type_ = "%s",\n' % (self.type_,)) 2993 if self.id is not None and 'id' not in already_processed: 2994 already_processed.append('id') 2995 showIndent(outfile, level) 2996 outfile.write('id = %s,\n' % (self.id,))
2997 - def exportLiteralChildren(self, outfile, level, name_):
2998 if self.API_Call is not None: 2999 showIndent(outfile, level) 3000 outfile.write('API_Call=model_.APICallType(\n') 3001 self.API_Call.exportLiteral(outfile, level, name_='API_Call') 3002 showIndent(outfile, level) 3003 outfile.write('),\n') 3004 showIndent(outfile, level) 3005 outfile.write('Code=[\n') 3006 level += 1 3007 for Code_ in self.Code: 3008 showIndent(outfile, level) 3009 outfile.write('model_.CodeType(\n') 3010 Code_.exportLiteral(outfile, level, name_='CodeType') 3011 showIndent(outfile, level) 3012 outfile.write('),\n') 3013 level -= 1 3014 showIndent(outfile, level) 3015 outfile.write('],\n') 3016 if self.Platform is not None: 3017 showIndent(outfile, level) 3018 outfile.write('Platform=model_.CPESpecificationType(\n') 3019 self.Platform.exportLiteral(outfile, level, name_='Platform') 3020 showIndent(outfile, level) 3021 outfile.write('),\n') 3022 if self.Data_Read is not None: 3023 showIndent(outfile, level) 3024 outfile.write('Data_Read=model_.DataType(\n') 3025 self.Data_Read.exportLiteral(outfile, level, name_='Data_Read') 3026 showIndent(outfile, level) 3027 outfile.write('),\n') 3028 if self.Data_Written is not None: 3029 showIndent(outfile, level) 3030 outfile.write('Data_Written=model_.DataType(\n') 3031 self.Data_Written.exportLiteral(outfile, level, name_='Data_Written') 3032 showIndent(outfile, level) 3033 outfile.write('),\n') 3034 if self.File_System_Action_Attributes is not None: 3035 showIndent(outfile, level) 3036 outfile.write('File_System_Action_Attributes=model_.File_System_Action_AttributesType(\n') 3037 self.File_System_Action_Attributes.exportLiteral(outfile, level, name_='File_System_Action_Attributes') 3038 showIndent(outfile, level) 3039 outfile.write('),\n') 3040 if self.IPC_Action_Attributes is not None: 3041 showIndent(outfile, level) 3042 outfile.write('IPC_Action_Attributes=model_.IPC_Action_AttributesType(\n') 3043 self.IPC_Action_Attributes.exportLiteral(outfile, level, name_='IPC_Action_Attributes') 3044 showIndent(outfile, level) 3045 outfile.write('),\n') 3046 if self.Process_Action_Attributes is not None: 3047 showIndent(outfile, level) 3048 outfile.write('Process_Action_Attributes=model_.Process_Action_AttributesType(\n') 3049 self.Process_Action_Attributes.exportLiteral(outfile, level, name_='Process_Action_Attributes') 3050 showIndent(outfile, level) 3051 outfile.write('),\n') 3052 if self.Memory_Action_Attributes is not None: 3053 showIndent(outfile, level) 3054 outfile.write('Memory_Action_Attributes=model_.Memory_Action_AttributesType(\n') 3055 self.Memory_Action_Attributes.exportLiteral(outfile, level, name_='Memory_Action_Attributes') 3056 showIndent(outfile, level) 3057 outfile.write('),\n') 3058 if self.Registry_Action_Attributes is not None: 3059 showIndent(outfile, level) 3060 outfile.write('Registry_Action_Attributes=model_.Registry_Action_AttributesType(\n') 3061 self.Registry_Action_Attributes.exportLiteral(outfile, level, name_='Registry_Action_Attributes') 3062 showIndent(outfile, level) 3063 outfile.write('),\n') 3064 if self.Network_Action_Attributes is not None: 3065 showIndent(outfile, level) 3066 outfile.write('Network_Action_Attributes=model_.Network_Action_AttributesType(\n') 3067 self.Network_Action_Attributes.exportLiteral(outfile, level, name_='Network_Action_Attributes') 3068 showIndent(outfile, level) 3069 outfile.write('),\n') 3070 if self.Module_Action_Attributes is not None: 3071 showIndent(outfile, level) 3072 outfile.write('Module_Action_Attributes=model_.Module_Action_AttributesType(\n') 3073 self.Module_Action_Attributes.exportLiteral(outfile, level, name_='Module_Action_Attributes') 3074 showIndent(outfile, level) 3075 outfile.write('),\n') 3076 if self.Daemon_Action_Attributes is not None: 3077 showIndent(outfile, level) 3078 outfile.write('Daemon_Action_Attributes=model_.Daemon_Action_AttributesType(\n') 3079 self.Daemon_Action_Attributes.exportLiteral(outfile, level, name_='Daemon_Action_Attributes') 3080 showIndent(outfile, level) 3081 outfile.write('),\n') 3082 if self.System_Action_Attributes is not None: 3083 showIndent(outfile, level) 3084 outfile.write('System_Action_Attributes=model_.System_Action_AttributesType(\n') 3085 self.System_Action_Attributes.exportLiteral(outfile, level, name_='System_Action_Attributes') 3086 showIndent(outfile, level) 3087 outfile.write('),\n') 3088 if self.Internet_Action_Attributes is not None: 3089 showIndent(outfile, level) 3090 outfile.write('Internet_Action_Attributes=model_.Internet_Action_AttributesType(\n') 3091 self.Internet_Action_Attributes.exportLiteral(outfile, level, name_='Internet_Action_Attributes') 3092 showIndent(outfile, level) 3093 outfile.write('),\n')
3094 - def build(self, node):
3095 self.buildAttributes(node, node.attrib, []) 3096 for child in node: 3097 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3098 self.buildChildren(child, node, nodeName_)
3099 - def buildAttributes(self, node, attrs, already_processed):
3100 value = find_attr_value_('type', node) 3101 if value is not None and 'type' not in already_processed: 3102 already_processed.append('type') 3103 self.type_ = value 3104 value = find_attr_value_('id', node) 3105 if value is not None and 'id' not in already_processed: 3106 already_processed.append('id') 3107 self.id = value
3108 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3109 if nodeName_ == 'API_Call': 3110 obj_ = APICallType.factory() 3111 obj_.build(child_) 3112 self.set_API_Call(obj_) 3113 elif nodeName_ == 'Code': 3114 obj_ = CodeType.factory() 3115 obj_.build(child_) 3116 self.Code.append(obj_) 3117 elif nodeName_ == 'Platform': 3118 obj_ = CPESpecificationType.factory() 3119 obj_.build(child_) 3120 self.set_Platform(obj_) 3121 elif nodeName_ == 'Data_Read': 3122 obj_ = DataType.factory() 3123 obj_.build(child_) 3124 self.set_Data_Read(obj_) 3125 elif nodeName_ == 'Data_Written': 3126 obj_ = DataType.factory() 3127 obj_.build(child_) 3128 self.set_Data_Written(obj_) 3129 elif nodeName_ == 'File_System_Action_Attributes': 3130 obj_ = File_System_Action_AttributesType.factory() 3131 obj_.build(child_) 3132 self.set_File_System_Action_Attributes(obj_) 3133 elif nodeName_ == 'IPC_Action_Attributes': 3134 obj_ = IPC_Action_AttributesType.factory() 3135 obj_.build(child_) 3136 self.set_IPC_Action_Attributes(obj_) 3137 elif nodeName_ == 'Process_Action_Attributes': 3138 obj_ = Process_Action_AttributesType.factory() 3139 obj_.build(child_) 3140 self.set_Process_Action_Attributes(obj_) 3141 elif nodeName_ == 'Memory_Action_Attributes': 3142 obj_ = Memory_Action_AttributesType.factory() 3143 obj_.build(child_) 3144 self.set_Memory_Action_Attributes(obj_) 3145 elif nodeName_ == 'Registry_Action_Attributes': 3146 obj_ = Registry_Action_AttributesType.factory() 3147 obj_.build(child_) 3148 self.set_Registry_Action_Attributes(obj_) 3149 elif nodeName_ == 'Network_Action_Attributes': 3150 obj_ = Network_Action_AttributesType.factory() 3151 obj_.build(child_) 3152 self.set_Network_Action_Attributes(obj_) 3153 elif nodeName_ == 'Module_Action_Attributes': 3154 obj_ = Module_Action_AttributesType.factory() 3155 obj_.build(child_) 3156 self.set_Module_Action_Attributes(obj_) 3157 elif nodeName_ == 'Daemon_Action_Attributes': 3158 obj_ = Daemon_Action_AttributesType.factory() 3159 obj_.build(child_) 3160 self.set_Daemon_Action_Attributes(obj_) 3161 elif nodeName_ == 'System_Action_Attributes': 3162 obj_ = System_Action_AttributesType.factory() 3163 obj_.build(child_) 3164 self.set_System_Action_Attributes(obj_) 3165 elif nodeName_ == 'Internet_Action_Attributes': 3166 obj_ = Internet_Action_AttributesType.factory() 3167 obj_.build(child_) 3168 self.set_Internet_Action_Attributes(obj_)
3169 # end class ActionImplementationType 3170 3171
3172 -class CPESpecificationType(GeneratedsSuper):
3173 """CPESpecificationType is a modularized data type intended for 3174 providing a consistent approach to uniquely specifying the 3175 identity of a specific platform using the Common Platform 3176 Enumeration (CPE) naming standard. http://cpe.mitre.org/The 3177 cpe_name attribute contains the CPE Name value for the relevant 3178 platform. A CPE Name is a percent-encoded URI with each name 3179 starting with the prefix (the URI scheme name) "cpe:". The 3180 remainder of the name consists of colon separated values 3181 representing the CPE part, vendor, product, version, update, 3182 edition and language (i.e. cpe:/ {part} : {vendor} : {product} : 3183 {version} : {update} : {edition} : {language}).The xmlns_value 3184 attribute contains the XML namespace descriptor for the CPE 3185 namespace relevant to this CPE Name use.""" 3186 subclass = None 3187 superclass = None
3188 - def __init__(self, cpe_name=None, xmlns_value=None, Title=None, meta_item_metadata=None):
3189 self.cpe_name = _cast(None, cpe_name) 3190 self.xmlns_value = _cast(None, xmlns_value) 3191 self.Title = Title 3192 self.meta_item_metadata = meta_item_metadata
3193 - def factory(*args_, **kwargs_):
3194 if CPESpecificationType.subclass: 3195 return CPESpecificationType.subclass(*args_, **kwargs_) 3196 else: 3197 return CPESpecificationType(*args_, **kwargs_)
3198 factory = staticmethod(factory)
3199 - def get_Title(self): return self.Title
3200 - def set_Title(self, Title): self.Title = Title
3201 - def get_meta_item_metadata(self): return self.meta_item_metadata
3202 - def set_meta_item_metadata(self, meta_item_metadata): self.meta_item_metadata = meta_item_metadata
3203 - def get_cpe_name(self): return self.cpe_name
3204 - def set_cpe_name(self, cpe_name): self.cpe_name = cpe_name
3205 - def get_xmlns_value(self): return self.xmlns_value
3206 - def set_xmlns_value(self, xmlns_value): self.xmlns_value = xmlns_value
3207 - def export(self, outfile, level, namespace_='maec:', name_='CPESpecificationType', namespacedef_=''):
3208 showIndent(outfile, level) 3209 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3210 already_processed = [] 3211 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CPESpecificationType') 3212 if self.hasContent_(): 3213 outfile.write('>\n') 3214 self.exportChildren(outfile, level + 1, namespace_, name_) 3215 showIndent(outfile, level) 3216 outfile.write('</%s%s>\n' % (namespace_, name_)) 3217 else: 3218 outfile.write('/>\n')
3219 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='CPESpecificationType'):
3220 if self.cpe_name is not None and 'cpe_name' not in already_processed: 3221 already_processed.append('cpe_name') 3222 outfile.write(' cpe_name=%s' % (self.gds_format_string(quote_attrib(self.cpe_name).encode(ExternalEncoding), input_name='cpe_name'), )) 3223 if self.xmlns_value is not None and 'xmlns_value' not in already_processed: 3224 already_processed.append('xmlns_value') 3225 outfile.write(' xmlns_value=%s' % (self.gds_format_string(quote_attrib(self.xmlns_value).encode(ExternalEncoding), input_name='xmlns_value'), ))
3226 - def exportChildren(self, outfile, level, namespace_='maec:', name_='CPESpecificationType', fromsubclass_=False):
3227 if self.Title is not None: 3228 self.Title.export(outfile, level, namespace_, name_='Title') 3229 if self.meta_item_metadata is not None: 3230 self.meta_item_metadata.export(outfile, level, namespace_, name_='meta-item-metadata')
3231 - def hasContent_(self):
3232 if ( 3233 self.Title is not None or 3234 self.meta_item_metadata is not None 3235 ): 3236 return True 3237 else: 3238 return False
3239 - def exportLiteral(self, outfile, level, name_='CPESpecificationType'):
3240 level += 1 3241 self.exportLiteralAttributes(outfile, level, [], name_) 3242 if self.hasContent_(): 3243 self.exportLiteralChildren(outfile, level, name_)
3244 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3245 if self.cpe_name is not None and 'cpe_name' not in already_processed: 3246 already_processed.append('cpe_name') 3247 showIndent(outfile, level) 3248 outfile.write('cpe_name = "%s",\n' % (self.cpe_name,)) 3249 if self.xmlns_value is not None and 'xmlns_value' not in already_processed: 3250 already_processed.append('xmlns_value') 3251 showIndent(outfile, level) 3252 outfile.write('xmlns_value = "%s",\n' % (self.xmlns_value,))
3253 - def exportLiteralChildren(self, outfile, level, name_):
3254 if self.Title is not None: 3255 showIndent(outfile, level) 3256 outfile.write('Title=model_.TitleType(\n') 3257 self.Title.exportLiteral(outfile, level, name_='Title') 3258 showIndent(outfile, level) 3259 outfile.write('),\n') 3260 if self.meta_item_metadata is not None: 3261 showIndent(outfile, level) 3262 outfile.write('meta_item_metadata=model_.meta_item_metadataType(\n') 3263 self.meta_item_metadata.exportLiteral(outfile, level, name_='meta_item_metadata') 3264 showIndent(outfile, level) 3265 outfile.write('),\n')
3266 - def build(self, node):
3267 self.buildAttributes(node, node.attrib, []) 3268 for child in node: 3269 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3270 self.buildChildren(child, node, nodeName_)
3271 - def buildAttributes(self, node, attrs, already_processed):
3272 value = find_attr_value_('cpe_name', node) 3273 if value is not None and 'cpe_name' not in already_processed: 3274 already_processed.append('cpe_name') 3275 self.cpe_name = value 3276 value = find_attr_value_('xmlns_value', node) 3277 if value is not None and 'xmlns_value' not in already_processed: 3278 already_processed.append('xmlns_value') 3279 self.xmlns_value = value
3280 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3281 if nodeName_ == 'Title': 3282 obj_ = TitleType.factory() 3283 obj_.build(child_) 3284 self.set_Title(obj_) 3285 elif nodeName_ == 'meta-item-metadata': 3286 obj_ = meta_item_metadataType.factory() 3287 obj_.build(child_) 3288 self.set_meta_item_metadata(obj_)
3289 # end class CPESpecificationType 3290 3291
3292 -class APICallType(GeneratedsSuper):
3293 """APICall_ParameterType is intended provide a method for the 3294 characterization of API calls, namely functions and their 3295 parameters.The apifunction_name attribute contains the exact 3296 name of the API function called. E.g. CreateFileW.""" 3297 subclass = None 3298 superclass = None
3299 - def __init__(self, apifunction_name=None, id=None, Address=None, ReturnValue=None, APICall_Parameter=None):
3300 self.apifunction_name = _cast(None, apifunction_name) 3301 self.id = _cast(None, id) 3302 self.Address = Address 3303 self.ReturnValue = ReturnValue 3304 if APICall_Parameter is None: 3305 self.APICall_Parameter = [] 3306 else: 3307 self.APICall_Parameter = APICall_Parameter
3308 - def factory(*args_, **kwargs_):
3309 if APICallType.subclass: 3310 return APICallType.subclass(*args_, **kwargs_) 3311 else: 3312 return APICallType(*args_, **kwargs_)
3313 factory = staticmethod(factory)
3314 - def get_Address(self): return self.Address
3315 - def set_Address(self, Address): self.Address = Address
3316 - def get_ReturnValue(self): return self.ReturnValue
3317 - def set_ReturnValue(self, ReturnValue): self.ReturnValue = ReturnValue
3318 - def get_APICall_Parameter(self): return self.APICall_Parameter
3319 - def set_APICall_Parameter(self, APICall_Parameter): self.APICall_Parameter = APICall_Parameter
3320 - def add_APICall_Parameter(self, value): self.APICall_Parameter.append(value)
3321 - def insert_APICall_Parameter(self, index, value): self.APICall_Parameter[index] = value
3322 - def get_apifunction_name(self): return self.apifunction_name
3323 - def set_apifunction_name(self, apifunction_name): self.apifunction_name = apifunction_name
3324 - def get_id(self): return self.id
3325 - def set_id(self, id): self.id = id
3326 - def export(self, outfile, level, namespace_='maec:', name_='APICallType', namespacedef_=''):
3327 showIndent(outfile, level) 3328 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3329 already_processed = [] 3330 self.exportAttributes(outfile, level, already_processed, namespace_, name_='APICallType') 3331 if self.hasContent_(): 3332 outfile.write('>\n') 3333 self.exportChildren(outfile, level + 1, namespace_, name_) 3334 showIndent(outfile, level) 3335 outfile.write('</%s%s>\n' % (namespace_, name_)) 3336 else: 3337 outfile.write('/>\n')
3338 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='APICallType'):
3339 if self.apifunction_name is not None and 'apifunction_name' not in already_processed: 3340 already_processed.append('apifunction_name') 3341 outfile.write(' apifunction_name=%s' % (self.gds_format_string(quote_attrib(self.apifunction_name).encode(ExternalEncoding), input_name='apifunction_name'), )) 3342 if self.id is not None and 'id' not in already_processed: 3343 already_processed.append('id') 3344 outfile.write(' id=%s' % (quote_attrib(self.id), ))
3345 - def exportChildren(self, outfile, level, namespace_='maec:', name_='APICallType', fromsubclass_=False):
3346 if self.Address is not None: 3347 self.Address.export(outfile, level, namespace_, name_='Address') 3348 if self.ReturnValue is not None: 3349 showIndent(outfile, level) 3350 outfile.write('<%sReturnValue>%s</%sReturnValue>\n' % (namespace_, self.gds_format_string(quote_xml(self.ReturnValue).encode(ExternalEncoding), input_name='ReturnValue'), namespace_)) 3351 for APICall_Parameter_ in self.APICall_Parameter: 3352 APICall_Parameter_.export(outfile, level, namespace_, name_='APICall_Parameter')
3353 - def hasContent_(self):
3354 if ( 3355 self.Address is not None or 3356 self.ReturnValue is not None or 3357 self.APICall_Parameter 3358 ): 3359 return True 3360 else: 3361 return False
3362 - def exportLiteral(self, outfile, level, name_='APICallType'):
3363 level += 1 3364 self.exportLiteralAttributes(outfile, level, [], name_) 3365 if self.hasContent_(): 3366 self.exportLiteralChildren(outfile, level, name_)
3367 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3368 if self.apifunction_name is not None and 'apifunction_name' not in already_processed: 3369 already_processed.append('apifunction_name') 3370 showIndent(outfile, level) 3371 outfile.write('apifunction_name = "%s",\n' % (self.apifunction_name,)) 3372 if self.id is not None and 'id' not in already_processed: 3373 already_processed.append('id') 3374 showIndent(outfile, level) 3375 outfile.write('id = %s,\n' % (self.id,))
3376 - def exportLiteralChildren(self, outfile, level, name_):
3377 if self.Address is not None: 3378 showIndent(outfile, level) 3379 outfile.write('Address=model_.xs_hexBinary(\n') 3380 self.Address.exportLiteral(outfile, level, name_='Address') 3381 showIndent(outfile, level) 3382 outfile.write('),\n') 3383 if self.ReturnValue is not None: 3384 showIndent(outfile, level) 3385 outfile.write('ReturnValue=%s,\n' % quote_python(self.ReturnValue).encode(ExternalEncoding)) 3386 showIndent(outfile, level) 3387 outfile.write('APICall_Parameter=[\n') 3388 level += 1 3389 for APICall_Parameter_ in self.APICall_Parameter: 3390 showIndent(outfile, level) 3391 outfile.write('model_.APICall_ParameterType(\n') 3392 APICall_Parameter_.exportLiteral(outfile, level, name_='APICall_ParameterType') 3393 showIndent(outfile, level) 3394 outfile.write('),\n') 3395 level -= 1 3396 showIndent(outfile, level) 3397 outfile.write('],\n')
3398 - def build(self, node):
3399 self.buildAttributes(node, node.attrib, []) 3400 for child in node: 3401 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3402 self.buildChildren(child, node, nodeName_)
3403 - def buildAttributes(self, node, attrs, already_processed):
3404 value = find_attr_value_('apifunction_name', node) 3405 if value is not None and 'apifunction_name' not in already_processed: 3406 already_processed.append('apifunction_name') 3407 self.apifunction_name = value 3408 value = find_attr_value_('id', node) 3409 if value is not None and 'id' not in already_processed: 3410 already_processed.append('id') 3411 self.id = value
3412 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3413 if nodeName_ == 'Address': 3414 obj_ = xs_hexBinary.factory() 3415 obj_.build(child_) 3416 self.set_Address(obj_) 3417 elif nodeName_ == 'ReturnValue': 3418 ReturnValue_ = child_.text 3419 ReturnValue_ = self.gds_validate_string(ReturnValue_, node, 'ReturnValue') 3420 self.ReturnValue = ReturnValue_ 3421 elif nodeName_ == 'APICall_Parameter': 3422 obj_ = APICall_ParameterType.factory() 3423 obj_.build(child_) 3424 self.APICall_Parameter.append(obj_)
3425 # end class APICallType 3426 3427
3428 -class ToolType(GeneratedsSuper):
3429 """ToolType is intended to provide a way of characterizing any tools 3430 used in the analysis of malware.""" 3431 subclass = None 3432 superclass = None
3433 - def __init__(self, id=None, Name=None, Version=None, Vendor=None, Organization=None):
3434 self.id = _cast(None, id) 3435 self.Name = Name 3436 self.Version = Version 3437 self.Vendor = Vendor 3438 self.Organization = Organization
3439 - def factory(*args_, **kwargs_):
3440 if ToolType.subclass: 3441 return ToolType.subclass(*args_, **kwargs_) 3442 else: 3443 return ToolType(*args_, **kwargs_)
3444 factory = staticmethod(factory)
3445 - def get_Name(self): return self.Name
3446 - def set_Name(self, Name): self.Name = Name
3447 - def get_Version(self): return self.Version
3448 - def set_Version(self, Version): self.Version = Version
3449 - def get_Vendor(self): return self.Vendor
3450 - def set_Vendor(self, Vendor): self.Vendor = Vendor
3451 - def get_Organization(self): return self.Organization
3452 - def set_Organization(self, Organization): self.Organization = Organization
3453 - def get_id(self): return self.id
3454 - def set_id(self, id): self.id = id
3455 - def export(self, outfile, level, namespace_='maec:', name_='ToolType', namespacedef_=''):
3456 showIndent(outfile, level) 3457 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3458 already_processed = [] 3459 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ToolType') 3460 if self.hasContent_(): 3461 outfile.write('>\n') 3462 self.exportChildren(outfile, level + 1, namespace_, name_) 3463 showIndent(outfile, level) 3464 outfile.write('</%s%s>\n' % (namespace_, name_)) 3465 else: 3466 outfile.write('/>\n')
3467 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ToolType'):
3468 if self.id is not None and 'id' not in already_processed: 3469 already_processed.append('id') 3470 outfile.write(' id=%s' % (quote_attrib(self.id), ))
3471 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ToolType', fromsubclass_=False):
3472 if self.Name is not None: 3473 showIndent(outfile, level) 3474 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) 3475 if self.Version is not None: 3476 showIndent(outfile, level) 3477 outfile.write('<%sVersion>%s</%sVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.Version).encode(ExternalEncoding), input_name='Version'), namespace_)) 3478 if self.Vendor is not None: 3479 showIndent(outfile, level) 3480 outfile.write('<%sVendor>%s</%sVendor>\n' % (namespace_, self.gds_format_string(quote_xml(self.Vendor).encode(ExternalEncoding), input_name='Vendor'), namespace_)) 3481 if self.Organization is not None: 3482 showIndent(outfile, level) 3483 outfile.write('<%sOrganization>%s</%sOrganization>\n' % (namespace_, self.gds_format_string(quote_xml(self.Organization).encode(ExternalEncoding), input_name='Organization'), namespace_))
3484 - def hasContent_(self):
3485 if ( 3486 self.Name is not None or 3487 self.Version is not None or 3488 self.Vendor is not None or 3489 self.Organization is not None 3490 ): 3491 return True 3492 else: 3493 return False
3494 - def exportLiteral(self, outfile, level, name_='ToolType'):
3495 level += 1 3496 self.exportLiteralAttributes(outfile, level, [], name_) 3497 if self.hasContent_(): 3498 self.exportLiteralChildren(outfile, level, name_)
3499 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3500 if self.id is not None and 'id' not in already_processed: 3501 already_processed.append('id') 3502 showIndent(outfile, level) 3503 outfile.write('id = %s,\n' % (self.id,))
3504 - def exportLiteralChildren(self, outfile, level, name_):
3505 if self.Name is not None: 3506 showIndent(outfile, level) 3507 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) 3508 if self.Version is not None: 3509 showIndent(outfile, level) 3510 outfile.write('Version=%s,\n' % quote_python(self.Version).encode(ExternalEncoding)) 3511 if self.Vendor is not None: 3512 showIndent(outfile, level) 3513 outfile.write('Vendor=%s,\n' % quote_python(self.Vendor).encode(ExternalEncoding)) 3514 if self.Organization is not None: 3515 showIndent(outfile, level) 3516 outfile.write('Organization=%s,\n' % quote_python(self.Organization).encode(ExternalEncoding))
3517 - def build(self, node):
3518 self.buildAttributes(node, node.attrib, []) 3519 for child in node: 3520 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3521 self.buildChildren(child, node, nodeName_)
3522 - def buildAttributes(self, node, attrs, already_processed):
3523 value = find_attr_value_('id', node) 3524 if value is not None and 'id' not in already_processed: 3525 already_processed.append('id') 3526 self.id = value
3527 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3528 if nodeName_ == 'Name': 3529 Name_ = child_.text 3530 Name_ = self.gds_validate_string(Name_, node, 'Name') 3531 self.Name = Name_ 3532 elif nodeName_ == 'Version': 3533 Version_ = child_.text 3534 Version_ = self.gds_validate_string(Version_, node, 'Version') 3535 self.Version = Version_ 3536 elif nodeName_ == 'Vendor': 3537 Vendor_ = child_.text 3538 Vendor_ = self.gds_validate_string(Vendor_, node, 'Vendor') 3539 self.Vendor = Vendor_ 3540 elif nodeName_ == 'Organization': 3541 Organization_ = child_.text 3542 Organization_ = self.gds_validate_string(Organization_, node, 'Organization') 3543 self.Organization = Organization_
3544 # end class ToolType 3545 3546
3547 -class AnalysisType(GeneratedsSuper):
3548 """AnalysisType is intended to provide a way of characterizing typical 3549 malware analysis-related metadata, such as the subject of the 3550 analysis and when it was started.The analysis_method attribute 3551 is intended to provide a way of characterizing the type of 3552 analysis method used in the analysis element. Possible values: 3553 Static, Dynamic, Combinatorial, Other.The start_datetime 3554 attribute contains the date/time the analysis was started.The 3555 complete_datetime attribute contains the date/time the analysis 3556 was completed.The lastupdate_datetime attribute contains the 3557 date/time the analysis was last updated.""" 3558 subclass = None 3559 superclass = None
3560 - def __init__(self, start_datetime=None, lastupdate_datetime=None, id=None, complete_datetime=None, analysis_method=None, Subject=None, Description=None, Analysts=None, Source=None, Analysis_Environment=None, Tools_Used=None, Notes=None):
3561 self.start_datetime = _cast(None, start_datetime) 3562 self.lastupdate_datetime = _cast(None, lastupdate_datetime) 3563 self.id = _cast(None, id) 3564 self.complete_datetime = _cast(None, complete_datetime) 3565 self.analysis_method = _cast(None, analysis_method) 3566 if Subject is None: 3567 self.Subject = [] 3568 else: 3569 self.Subject = Subject 3570 self.Description = Description 3571 self.Analysts = Analysts 3572 self.Source = Source 3573 self.Analysis_Environment = Analysis_Environment 3574 self.Tools_Used = Tools_Used 3575 self.Notes = Notes
3576 - def factory(*args_, **kwargs_):
3577 if AnalysisType.subclass: 3578 return AnalysisType.subclass(*args_, **kwargs_) 3579 else: 3580 return AnalysisType(*args_, **kwargs_)
3581 factory = staticmethod(factory)
3582 - def get_Subject(self): return self.Subject
3583 - def set_Subject(self, Subject): self.Subject = Subject
3584 - def add_Subject(self, value): self.Subject.append(value)
3585 - def insert_Subject(self, index, value): self.Subject[index] = value
3586 - def get_Description(self): return self.Description
3587 - def set_Description(self, Description): self.Description = Description
3588 - def get_Analysts(self): return self.Analysts
3589 - def set_Analysts(self, Analysts): self.Analysts = Analysts
3590 - def get_Source(self): return self.Source
3591 - def set_Source(self, Source): self.Source = Source
3592 - def get_Analysis_Environment(self): return self.Analysis_Environment
3593 - def set_Analysis_Environment(self, Analysis_Environment): self.Analysis_Environment = Analysis_Environment
3594 - def get_Tools_Used(self): return self.Tools_Used
3595 - def set_Tools_Used(self, Tools_Used): self.Tools_Used = Tools_Used
3596 - def get_Notes(self): return self.Notes
3597 - def set_Notes(self, Notes): self.Notes = Notes
3598 - def get_start_datetime(self): return self.start_datetime
3599 - def set_start_datetime(self, start_datetime): self.start_datetime = start_datetime
3600 - def get_lastupdate_datetime(self): return self.lastupdate_datetime
3601 - def set_lastupdate_datetime(self, lastupdate_datetime): self.lastupdate_datetime = lastupdate_datetime
3602 - def get_id(self): return self.id
3603 - def set_id(self, id): self.id = id
3604 - def get_complete_datetime(self): return self.complete_datetime
3605 - def set_complete_datetime(self, complete_datetime): self.complete_datetime = complete_datetime
3606 - def get_analysis_method(self): return self.analysis_method
3607 - def set_analysis_method(self, analysis_method): self.analysis_method = analysis_method
3608 - def export(self, outfile, level, namespace_='maec:', name_='AnalysisType', namespacedef_=''):
3609 showIndent(outfile, level) 3610 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3611 already_processed = [] 3612 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AnalysisType') 3613 if self.hasContent_(): 3614 outfile.write('>\n') 3615 self.exportChildren(outfile, level + 1, namespace_, name_) 3616 showIndent(outfile, level) 3617 outfile.write('</%s%s>\n' % (namespace_, name_)) 3618 else: 3619 outfile.write('/>\n')
3620 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='AnalysisType'):
3621 if self.start_datetime is not None and 'start_datetime' not in already_processed: 3622 already_processed.append('start_datetime') 3623 outfile.write(' start_datetime=%s' % (self.gds_format_string(quote_attrib(self.start_datetime).encode(ExternalEncoding), input_name='start_datetime'), )) 3624 if self.lastupdate_datetime is not None and 'lastupdate_datetime' not in already_processed: 3625 already_processed.append('lastupdate_datetime') 3626 outfile.write(' lastupdate_datetime=%s' % (self.gds_format_string(quote_attrib(self.lastupdate_datetime).encode(ExternalEncoding), input_name='lastupdate_datetime'), )) 3627 if self.id is not None and 'id' not in already_processed: 3628 already_processed.append('id') 3629 outfile.write(' id=%s' % (quote_attrib(self.id), )) 3630 if self.complete_datetime is not None and 'complete_datetime' not in already_processed: 3631 already_processed.append('complete_datetime') 3632 outfile.write(' complete_datetime=%s' % (self.gds_format_string(quote_attrib(self.complete_datetime).encode(ExternalEncoding), input_name='complete_datetime'), )) 3633 if self.analysis_method is not None and 'analysis_method' not in already_processed: 3634 already_processed.append('analysis_method') 3635 outfile.write(' analysis_method=%s' % (self.gds_format_string(quote_attrib(self.analysis_method).encode(ExternalEncoding), input_name='analysis_method'), ))
3636 - def exportChildren(self, outfile, level, namespace_='maec:', name_='AnalysisType', fromsubclass_=False):
3637 for Subject_ in self.Subject: 3638 Subject_.export(outfile, level, namespace_, name_='Subject') 3639 if self.Description is not None: 3640 self.Description.export(outfile, level, namespace_, name_='Description') 3641 if self.Analysts is not None: 3642 self.Analysts.export(outfile, level, namespace_, name_='Analysts') 3643 if self.Source is not None: 3644 self.Source.export(outfile, level, namespace_, name_='Source') 3645 if self.Analysis_Environment is not None: 3646 self.Analysis_Environment.export(outfile, level, namespace_, name_='Analysis_Environment') 3647 if self.Tools_Used is not None: 3648 self.Tools_Used.export(outfile, level, namespace_, name_='Tools_Used') 3649 if self.Notes is not None: 3650 self.Notes.export(outfile, level, namespace_, name_='Notes')
3651 - def hasContent_(self):
3652 if ( 3653 self.Subject or 3654 self.Description is not None or 3655 self.Analysts is not None or 3656 self.Source is not None or 3657 self.Analysis_Environment is not None or 3658 self.Tools_Used is not None or 3659 self.Notes is not None 3660 ): 3661 return True 3662 else: 3663 return False
3664 - def exportLiteral(self, outfile, level, name_='AnalysisType'):
3665 level += 1 3666 self.exportLiteralAttributes(outfile, level, [], name_) 3667 if self.hasContent_(): 3668 self.exportLiteralChildren(outfile, level, name_)
3669 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3670 if self.start_datetime is not None and 'start_datetime' not in already_processed: 3671 already_processed.append('start_datetime') 3672 showIndent(outfile, level) 3673 outfile.write('start_datetime = "%s",\n' % (self.start_datetime,)) 3674 if self.lastupdate_datetime is not None and 'lastupdate_datetime' not in already_processed: 3675 already_processed.append('lastupdate_datetime') 3676 showIndent(outfile, level) 3677 outfile.write('lastupdate_datetime = "%s",\n' % (self.lastupdate_datetime,)) 3678 if self.id is not None and 'id' not in already_processed: 3679 already_processed.append('id') 3680 showIndent(outfile, level) 3681 outfile.write('id = %s,\n' % (self.id,)) 3682 if self.complete_datetime is not None and 'complete_datetime' not in already_processed: 3683 already_processed.append('complete_datetime') 3684 showIndent(outfile, level) 3685 outfile.write('complete_datetime = "%s",\n' % (self.complete_datetime,)) 3686 if self.analysis_method is not None and 'analysis_method' not in already_processed: 3687 already_processed.append('analysis_method') 3688 showIndent(outfile, level) 3689 outfile.write('analysis_method = "%s",\n' % (self.analysis_method,))
3690 - def exportLiteralChildren(self, outfile, level, name_):
3691 showIndent(outfile, level) 3692 outfile.write('Subject=[\n') 3693 level += 1 3694 for Subject_ in self.Subject: 3695 showIndent(outfile, level) 3696 outfile.write('model_.SubjectType(\n') 3697 Subject_.exportLiteral(outfile, level, name_='SubjectType') 3698 showIndent(outfile, level) 3699 outfile.write('),\n') 3700 level -= 1 3701 showIndent(outfile, level) 3702 outfile.write('],\n') 3703 if self.Description is not None: 3704 showIndent(outfile, level) 3705 outfile.write('Description=model_.StructuredTextType(\n') 3706 self.Description.exportLiteral(outfile, level, name_='Description') 3707 showIndent(outfile, level) 3708 outfile.write('),\n') 3709 if self.Analysts is not None: 3710 showIndent(outfile, level) 3711 outfile.write('Analysts=model_.AnalystsType(\n') 3712 self.Analysts.exportLiteral(outfile, level, name_='Analysts') 3713 showIndent(outfile, level) 3714 outfile.write('),\n') 3715 if self.Source is not None: 3716 showIndent(outfile, level) 3717 outfile.write('Source=model_.SourceType(\n') 3718 self.Source.exportLiteral(outfile, level, name_='Source') 3719 showIndent(outfile, level) 3720 outfile.write('),\n') 3721 if self.Analysis_Environment is not None: 3722 showIndent(outfile, level) 3723 outfile.write('Analysis_Environment=model_.Analysis_EnvironmentType(\n') 3724 self.Analysis_Environment.exportLiteral(outfile, level, name_='Analysis_Environment') 3725 showIndent(outfile, level) 3726 outfile.write('),\n') 3727 if self.Tools_Used is not None: 3728 showIndent(outfile, level) 3729 outfile.write('Tools_Used=model_.Tools_UsedType(\n') 3730 self.Tools_Used.exportLiteral(outfile, level, name_='Tools_Used') 3731 showIndent(outfile, level) 3732 outfile.write('),\n') 3733 if self.Notes is not None: 3734 showIndent(outfile, level) 3735 outfile.write('Notes=model_.NotesType(\n') 3736 self.Notes.exportLiteral(outfile, level, name_='Notes') 3737 showIndent(outfile, level) 3738 outfile.write('),\n')
3739 - def build(self, node):
3740 self.buildAttributes(node, node.attrib, []) 3741 for child in node: 3742 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3743 self.buildChildren(child, node, nodeName_)
3744 - def buildAttributes(self, node, attrs, already_processed):
3745 value = find_attr_value_('start_datetime', node) 3746 if value is not None and 'start_datetime' not in already_processed: 3747 already_processed.append('start_datetime') 3748 self.start_datetime = value 3749 value = find_attr_value_('lastupdate_datetime', node) 3750 if value is not None and 'lastupdate_datetime' not in already_processed: 3751 already_processed.append('lastupdate_datetime') 3752 self.lastupdate_datetime = value 3753 value = find_attr_value_('id', node) 3754 if value is not None and 'id' not in already_processed: 3755 already_processed.append('id') 3756 self.id = value 3757 value = find_attr_value_('complete_datetime', node) 3758 if value is not None and 'complete_datetime' not in already_processed: 3759 already_processed.append('complete_datetime') 3760 self.complete_datetime = value 3761 value = find_attr_value_('analysis_method', node) 3762 if value is not None and 'analysis_method' not in already_processed: 3763 already_processed.append('analysis_method') 3764 self.analysis_method = value
3765 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3766 if nodeName_ == 'Subject': 3767 obj_ = SubjectType.factory() 3768 obj_.build(child_) 3769 self.Subject.append(obj_) 3770 elif nodeName_ == 'Description': 3771 obj_ = StructuredTextType.factory() 3772 obj_.build(child_) 3773 self.set_Description(obj_) 3774 elif nodeName_ == 'Analysts': 3775 obj_ = AnalystsType.factory() 3776 obj_.build(child_) 3777 self.set_Analysts(obj_) 3778 elif nodeName_ == 'Source': 3779 obj_ = SourceType.factory() 3780 obj_.build(child_) 3781 self.set_Source(obj_) 3782 elif nodeName_ == 'Analysis_Environment': 3783 obj_ = Analysis_EnvironmentType.factory() 3784 obj_.build(child_) 3785 self.set_Analysis_Environment(obj_) 3786 elif nodeName_ == 'Tools_Used': 3787 obj_ = Tools_UsedType.factory() 3788 obj_.build(child_) 3789 self.set_Tools_Used(obj_) 3790 elif nodeName_ == 'Notes': 3791 obj_ = NotesType.factory() 3792 obj_.build(child_) 3793 self.set_Notes(obj_)
3794 # end class AnalysisType 3795 3796
3797 -class ObjectReferenceType(GeneratedsSuper):
3798 """ObjectReferenceType is intended to serve as a method for linking to 3799 objects.The object_id attribute refers to the ID of the object 3800 being referenced.This attribute refers to the type of object 3801 entity being referenced. Possible values: Object, Object 3802 Collection.""" 3803 subclass = None 3804 superclass = None
3805 - def __init__(self, type_=None, object_id=None):
3806 self.type_ = _cast(None, type_) 3807 self.object_id = _cast(None, object_id) 3808 pass
3809 - def factory(*args_, **kwargs_):
3810 if ObjectReferenceType.subclass: 3811 return ObjectReferenceType.subclass(*args_, **kwargs_) 3812 else: 3813 return ObjectReferenceType(*args_, **kwargs_)
3814 factory = staticmethod(factory)
3815 - def get_type(self): return self.type_
3816 - def set_type(self, type_): self.type_ = type_
3817 - def get_object_id(self): return self.object_id
3818 - def set_object_id(self, object_id): self.object_id = object_id
3819 - def export(self, outfile, level, namespace_='maec:', name_='ObjectReferenceType', namespacedef_=''):
3820 showIndent(outfile, level) 3821 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3822 already_processed = [] 3823 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectReferenceType') 3824 if self.hasContent_(): 3825 outfile.write('>\n') 3826 self.exportChildren(outfile, level + 1, namespace_, name_) 3827 outfile.write('</%s%s>\n' % (namespace_, name_)) 3828 else: 3829 outfile.write('/>\n')
3830 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectReferenceType'):
3831 if self.type_ is not None and 'type_' not in already_processed: 3832 already_processed.append('type_') 3833 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), )) 3834 if self.object_id is not None and 'object_id' not in already_processed: 3835 already_processed.append('object_id') 3836 outfile.write(' object_id=%s' % (quote_attrib(self.object_id), ))
3837 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectReferenceType', fromsubclass_=False):
3838 pass
3839 - def hasContent_(self):
3840 if ( 3841 3842 ): 3843 return True 3844 else: 3845 return False
3846 - def exportLiteral(self, outfile, level, name_='ObjectReferenceType'):
3847 level += 1 3848 self.exportLiteralAttributes(outfile, level, [], name_) 3849 if self.hasContent_(): 3850 self.exportLiteralChildren(outfile, level, name_)
3851 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3852 if self.type_ is not None and 'type_' not in already_processed: 3853 already_processed.append('type_') 3854 showIndent(outfile, level) 3855 outfile.write('type_ = "%s",\n' % (self.type_,)) 3856 if self.object_id is not None and 'object_id' not in already_processed: 3857 already_processed.append('object_id') 3858 showIndent(outfile, level) 3859 outfile.write('object_id = %s,\n' % (self.object_id,))
3860 - def exportLiteralChildren(self, outfile, level, name_):
3861 pass
3862 - def build(self, node):
3863 self.buildAttributes(node, node.attrib, []) 3864 for child in node: 3865 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3866 self.buildChildren(child, node, nodeName_)
3867 - def buildAttributes(self, node, attrs, already_processed):
3868 value = find_attr_value_('type', node) 3869 if value is not None and 'type' not in already_processed: 3870 already_processed.append('type') 3871 self.type_ = value 3872 value = find_attr_value_('object_id', node) 3873 if value is not None and 'object_id' not in already_processed: 3874 already_processed.append('object_id') 3875 self.object_id = value
3876 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3877 pass
3878 # end class ObjectReferenceType 3879 3880
3881 -class CVEVulnerabilityType(GeneratedsSuper):
3882 """CVEVulnerabilityType is intended to provide a way of referencing 3883 specific vulnerabilities that malware exploits or attempts to 3884 exploit via a Common Vulnerabilities and Exposures (CPE) 3885 identifier. For more information on CPE please see 3886 http://cpe.mitre.org. The cve_id attribute contains the ID of 3887 the CVE that is being referenced. E.g. CVE-1999-0002.""" 3888 subclass = None 3889 superclass = None
3890 - def __init__(self, cve_id=None, CVE_Description=None):
3891 self.cve_id = _cast(None, cve_id) 3892 self.CVE_Description = CVE_Description
3893 - def factory(*args_, **kwargs_):
3894 if CVEVulnerabilityType.subclass: 3895 return CVEVulnerabilityType.subclass(*args_, **kwargs_) 3896 else: 3897 return CVEVulnerabilityType(*args_, **kwargs_)
3898 factory = staticmethod(factory)
3899 - def get_CVE_Description(self): return self.CVE_Description
3900 - def set_CVE_Description(self, CVE_Description): self.CVE_Description = CVE_Description
3901 - def get_cve_id(self): return self.cve_id
3902 - def set_cve_id(self, cve_id): self.cve_id = cve_id
3903 - def export(self, outfile, level, namespace_='maec:', name_='CVEVulnerabilityType', namespacedef_=''):
3904 showIndent(outfile, level) 3905 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 3906 already_processed = [] 3907 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CVEVulnerabilityType') 3908 if self.hasContent_(): 3909 outfile.write('>\n') 3910 self.exportChildren(outfile, level + 1, namespace_, name_) 3911 showIndent(outfile, level) 3912 outfile.write('</%s%s>\n' % (namespace_, name_)) 3913 else: 3914 outfile.write('/>\n')
3915 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='CVEVulnerabilityType'):
3916 if self.cve_id is not None and 'cve_id' not in already_processed: 3917 already_processed.append('cve_id') 3918 outfile.write(' cve_id=%s' % (self.gds_format_string(quote_attrib(self.cve_id).encode(ExternalEncoding), input_name='cve_id'), ))
3919 - def exportChildren(self, outfile, level, namespace_='maec:', name_='CVEVulnerabilityType', fromsubclass_=False):
3920 if self.CVE_Description is not None: 3921 showIndent(outfile, level) 3922 outfile.write('<%sCVE_Description>%s</%sCVE_Description>\n' % (namespace_, self.gds_format_string(quote_xml(self.CVE_Description).encode(ExternalEncoding), input_name='CVE_Description'), namespace_))
3923 - def hasContent_(self):
3924 if ( 3925 self.CVE_Description is not None 3926 ): 3927 return True 3928 else: 3929 return False
3930 - def exportLiteral(self, outfile, level, name_='CVEVulnerabilityType'):
3931 level += 1 3932 self.exportLiteralAttributes(outfile, level, [], name_) 3933 if self.hasContent_(): 3934 self.exportLiteralChildren(outfile, level, name_)
3935 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
3936 if self.cve_id is not None and 'cve_id' not in already_processed: 3937 already_processed.append('cve_id') 3938 showIndent(outfile, level) 3939 outfile.write('cve_id = "%s",\n' % (self.cve_id,))
3940 - def exportLiteralChildren(self, outfile, level, name_):
3941 if self.CVE_Description is not None: 3942 showIndent(outfile, level) 3943 outfile.write('CVE_Description=%s,\n' % quote_python(self.CVE_Description).encode(ExternalEncoding))
3944 - def build(self, node):
3945 self.buildAttributes(node, node.attrib, []) 3946 for child in node: 3947 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 3948 self.buildChildren(child, node, nodeName_)
3949 - def buildAttributes(self, node, attrs, already_processed):
3950 value = find_attr_value_('cve_id', node) 3951 if value is not None and 'cve_id' not in already_processed: 3952 already_processed.append('cve_id') 3953 self.cve_id = value
3954 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3955 if nodeName_ == 'CVE_Description': 3956 CVE_Description_ = child_.text 3957 CVE_Description_ = self.gds_validate_string(CVE_Description_, node, 'CVE_Description') 3958 self.CVE_Description = CVE_Description_
3959 # end class CVEVulnerabilityType 3960 3961
3962 -class ObjectCollectionType(GeneratedsSuper):
3963 """ObjectCollectionType is intended to provide a mechanism for 3964 characterizing collections of effects. For instance, it can be 3965 used to group all of the actions that are associated with a 3966 specific behavior.The name attribute contains the name of the 3967 object collection, if applicable.""" 3968 subclass = None 3969 superclass = None
3970 - def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Object_Sub_Collection=None, Object=None, Object_Reference=None):
3971 self.id = _cast(None, id) 3972 self.name = _cast(None, name) 3973 self.Affinity_Type = Affinity_Type 3974 self.Affinity_Degree = Affinity_Degree 3975 if Object_Sub_Collection is None: 3976 self.Object_Sub_Collection = [] 3977 else: 3978 self.Object_Sub_Collection = Object_Sub_Collection 3979 if Object is None: 3980 self.Object = [] 3981 else: 3982 self.Object = Object 3983 if Object_Reference is None: 3984 self.Object_Reference = [] 3985 else: 3986 self.Object_Reference = Object_Reference
3987 - def factory(*args_, **kwargs_):
3988 if ObjectCollectionType.subclass: 3989 return ObjectCollectionType.subclass(*args_, **kwargs_) 3990 else: 3991 return ObjectCollectionType(*args_, **kwargs_)
3992 factory = staticmethod(factory)
3993 - def get_Affinity_Type(self): return self.Affinity_Type
3994 - def set_Affinity_Type(self, Affinity_Type): self.Affinity_Type = Affinity_Type
3995 - def get_Affinity_Degree(self): return self.Affinity_Degree
3996 - def set_Affinity_Degree(self, Affinity_Degree): self.Affinity_Degree = Affinity_Degree
3997 - def get_Object_Sub_Collection(self): return self.Object_Sub_Collection
3998 - def set_Object_Sub_Collection(self, Object_Sub_Collection): self.Object_Sub_Collection = Object_Sub_Collection
3999 - def add_Object_Sub_Collection(self, value): self.Object_Sub_Collection.append(value)
4000 - def insert_Object_Sub_Collection(self, index, value): self.Object_Sub_Collection[index] = value
4001 - def get_Object(self): return self.Object
4002 - def set_Object(self, Object): self.Object = Object
4003 - def add_Object(self, value): self.Object.append(value)
4004 - def insert_Object(self, index, value): self.Object[index] = value
4005 - def get_Object_Reference(self): return self.Object_Reference
4006 - def set_Object_Reference(self, Object_Reference): self.Object_Reference = Object_Reference
4007 - def add_Object_Reference(self, value): self.Object_Reference.append(value)
4008 - def insert_Object_Reference(self, index, value): self.Object_Reference[index] = value
4009 - def get_id(self): return self.id
4010 - def set_id(self, id): self.id = id
4011 - def get_name(self): return self.name
4012 - def set_name(self, name): self.name = name
4013 - def export(self, outfile, level, namespace_='maec:', name_='ObjectCollectionType', namespacedef_=''):
4014 showIndent(outfile, level) 4015 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4016 already_processed = [] 4017 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectCollectionType') 4018 if self.hasContent_(): 4019 outfile.write('>\n') 4020 self.exportChildren(outfile, level + 1, namespace_, name_) 4021 showIndent(outfile, level) 4022 outfile.write('</%s%s>\n' % (namespace_, name_)) 4023 else: 4024 outfile.write('/>\n')
4025 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectCollectionType'):
4026 if self.id is not None and 'id' not in already_processed: 4027 already_processed.append('id') 4028 outfile.write(' id=%s' % (quote_attrib(self.id), )) 4029 if self.name is not None and 'name' not in already_processed: 4030 already_processed.append('name') 4031 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
4032 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectCollectionType', fromsubclass_=False):
4033 if self.Affinity_Type is not None: 4034 showIndent(outfile, level) 4035 outfile.write('<%sAffinity_Type>%s</%sAffinity_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Type).encode(ExternalEncoding), input_name='Affinity_Type'), namespace_)) 4036 if self.Affinity_Degree is not None: 4037 showIndent(outfile, level) 4038 outfile.write('<%sAffinity_Degree>%s</%sAffinity_Degree>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Degree).encode(ExternalEncoding), input_name='Affinity_Degree'), namespace_)) 4039 for Object_Sub_Collection_ in self.Object_Sub_Collection: 4040 Object_Sub_Collection_.export(outfile, level, namespace_, name_='Object_Sub_Collection') 4041 for Object_ in self.Object: 4042 Object_.export(outfile, level, namespace_, name_='Object') 4043 for Object_Reference_ in self.Object_Reference: 4044 Object_Reference_.export(outfile, level, namespace_, name_='Object_Reference')
4045 - def hasContent_(self):
4046 if ( 4047 self.Affinity_Type is not None or 4048 self.Affinity_Degree is not None or 4049 self.Object_Sub_Collection or 4050 self.Object or 4051 self.Object_Reference 4052 ): 4053 return True 4054 else: 4055 return False
4056 - def exportLiteral(self, outfile, level, name_='ObjectCollectionType'):
4057 level += 1 4058 self.exportLiteralAttributes(outfile, level, [], name_) 4059 if self.hasContent_(): 4060 self.exportLiteralChildren(outfile, level, name_)
4061 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4062 if self.id is not None and 'id' not in already_processed: 4063 already_processed.append('id') 4064 showIndent(outfile, level) 4065 outfile.write('id = %s,\n' % (self.id,)) 4066 if self.name is not None and 'name' not in already_processed: 4067 already_processed.append('name') 4068 showIndent(outfile, level) 4069 outfile.write('name = "%s",\n' % (self.name,))
4070 - def exportLiteralChildren(self, outfile, level, name_):
4071 if self.Affinity_Type is not None: 4072 showIndent(outfile, level) 4073 outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding)) 4074 if self.Affinity_Degree is not None: 4075 showIndent(outfile, level) 4076 outfile.write('Affinity_Degree=%s,\n' % quote_python(self.Affinity_Degree).encode(ExternalEncoding)) 4077 showIndent(outfile, level) 4078 outfile.write('Object_Sub_Collection=[\n') 4079 level += 1 4080 for Object_Sub_Collection_ in self.Object_Sub_Collection: 4081 showIndent(outfile, level) 4082 outfile.write('model_.ObjectCollectionType(\n') 4083 Object_Sub_Collection_.exportLiteral(outfile, level, name_='ObjectCollectionType') 4084 showIndent(outfile, level) 4085 outfile.write('),\n') 4086 level -= 1 4087 showIndent(outfile, level) 4088 outfile.write('],\n') 4089 showIndent(outfile, level) 4090 outfile.write('Object=[\n') 4091 level += 1 4092 for Object_ in self.Object: 4093 showIndent(outfile, level) 4094 outfile.write('model_.ObjectType(\n') 4095 Object_.exportLiteral(outfile, level, name_='ObjectType') 4096 showIndent(outfile, level) 4097 outfile.write('),\n') 4098 level -= 1 4099 showIndent(outfile, level) 4100 outfile.write('],\n') 4101 showIndent(outfile, level) 4102 outfile.write('Object_Reference=[\n') 4103 level += 1 4104 for Object_Reference_ in self.Object_Reference: 4105 showIndent(outfile, level) 4106 outfile.write('model_.ObjectReferenceType(\n') 4107 Object_Reference_.exportLiteral(outfile, level, name_='ObjectReferenceType') 4108 showIndent(outfile, level) 4109 outfile.write('),\n') 4110 level -= 1 4111 showIndent(outfile, level) 4112 outfile.write('],\n')
4113 - def build(self, node):
4114 self.buildAttributes(node, node.attrib, []) 4115 for child in node: 4116 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4117 self.buildChildren(child, node, nodeName_)
4118 - def buildAttributes(self, node, attrs, already_processed):
4119 value = find_attr_value_('id', node) 4120 if value is not None and 'id' not in already_processed: 4121 already_processed.append('id') 4122 self.id = value 4123 value = find_attr_value_('name', node) 4124 if value is not None and 'name' not in already_processed: 4125 already_processed.append('name') 4126 self.name = value
4127 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4128 if nodeName_ == 'Affinity_Type': 4129 Affinity_Type_ = child_.text 4130 Affinity_Type_ = self.gds_validate_string(Affinity_Type_, node, 'Affinity_Type') 4131 self.Affinity_Type = Affinity_Type_ 4132 elif nodeName_ == 'Affinity_Degree': 4133 Affinity_Degree_ = child_.text 4134 Affinity_Degree_ = self.gds_validate_string(Affinity_Degree_, node, 'Affinity_Degree') 4135 self.Affinity_Degree = Affinity_Degree_ 4136 elif nodeName_ == 'Object_Sub_Collection': 4137 obj_ = ObjectCollectionType.factory() 4138 obj_.build(child_) 4139 self.Object_Sub_Collection.append(obj_) 4140 elif nodeName_ == 'Object': 4141 obj_ = ObjectType.factory() 4142 obj_.build(child_) 4143 self.Object.append(obj_) 4144 elif nodeName_ == 'Object_Reference': 4145 obj_ = ObjectReferenceType.factory() 4146 obj_.build(child_) 4147 self.Object_Reference.append(obj_)
4148 # end class ObjectCollectionType 4149 4150
4151 -class DataType(GeneratedsSuper):
4152 """DataType is intended to provide a relatively abstract way of 4153 characterizing data segments that may be 4154 written/read/transmitted or otherwise utilized in actions or 4155 behaviors. The format attribute refers to the type of data 4156 contained in this element. Possible values: Binary, Hexadecimal, 4157 Text, Other.""" 4158 subclass = None 4159 superclass = None
4160 - def __init__(self, id=None, format=None, Data_Size=None, Discovery_Method=None, Data_Segment=None):
4161 self.id = _cast(None, id) 4162 self.format = _cast(None, format) 4163 self.Data_Size = Data_Size 4164 self.Discovery_Method = Discovery_Method 4165 self.Data_Segment = Data_Segment
4166 - def factory(*args_, **kwargs_):
4167 if DataType.subclass: 4168 return DataType.subclass(*args_, **kwargs_) 4169 else: 4170 return DataType(*args_, **kwargs_)
4171 factory = staticmethod(factory)
4172 - def get_Data_Size(self): return self.Data_Size
4173 - def set_Data_Size(self, Data_Size): self.Data_Size = Data_Size
4174 - def get_Discovery_Method(self): return self.Discovery_Method
4175 - def set_Discovery_Method(self, Discovery_Method): self.Discovery_Method = Discovery_Method
4176 - def get_Data_Segment(self): return self.Data_Segment
4177 - def set_Data_Segment(self, Data_Segment): self.Data_Segment = Data_Segment
4178 - def get_id(self): return self.id
4179 - def set_id(self, id): self.id = id
4180 - def get_format(self): return self.format
4181 - def set_format(self, format): self.format = format
4182 - def export(self, outfile, level, namespace_='maec:', name_='DataType', namespacedef_=''):
4183 showIndent(outfile, level) 4184 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4185 already_processed = [] 4186 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DataType') 4187 if self.hasContent_(): 4188 outfile.write('>\n') 4189 self.exportChildren(outfile, level + 1, namespace_, name_) 4190 showIndent(outfile, level) 4191 outfile.write('</%s%s>\n' % (namespace_, name_)) 4192 else: 4193 outfile.write('/>\n')
4194 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='DataType'):
4195 if self.id is not None and 'id' not in already_processed: 4196 already_processed.append('id') 4197 outfile.write(' id=%s' % (quote_attrib(self.id), )) 4198 if self.format is not None and 'format' not in already_processed: 4199 already_processed.append('format') 4200 outfile.write(' format=%s' % (self.gds_format_string(quote_attrib(self.format).encode(ExternalEncoding), input_name='format'), ))
4201 - def exportChildren(self, outfile, level, namespace_='maec:', name_='DataType', fromsubclass_=False):
4202 if self.Data_Size is not None: 4203 self.Data_Size.export(outfile, level, namespace_, name_='Data_Size', ) 4204 if self.Discovery_Method is not None: 4205 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method') 4206 if self.Data_Segment is not None: 4207 showIndent(outfile, level) 4208 outfile.write('<%sData_Segment>%s</%sData_Segment>\n' % (namespace_, self.gds_format_string(quote_xml(self.Data_Segment).encode(ExternalEncoding), input_name='Data_Segment'), namespace_))
4209 - def hasContent_(self):
4210 if ( 4211 self.Data_Size is not None or 4212 self.Discovery_Method is not None or 4213 self.Data_Segment is not None 4214 ): 4215 return True 4216 else: 4217 return False
4218 - def exportLiteral(self, outfile, level, name_='DataType'):
4219 level += 1 4220 self.exportLiteralAttributes(outfile, level, [], name_) 4221 if self.hasContent_(): 4222 self.exportLiteralChildren(outfile, level, name_)
4223 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4224 if self.id is not None and 'id' not in already_processed: 4225 already_processed.append('id') 4226 showIndent(outfile, level) 4227 outfile.write('id = %s,\n' % (self.id,)) 4228 if self.format is not None and 'format' not in already_processed: 4229 already_processed.append('format') 4230 showIndent(outfile, level) 4231 outfile.write('format = "%s",\n' % (self.format,))
4232 - def exportLiteralChildren(self, outfile, level, name_):
4233 if self.Data_Size is not None: 4234 showIndent(outfile, level) 4235 outfile.write('Data_Size=model_.Data_SizeType(\n') 4236 self.Data_Size.exportLiteral(outfile, level, name_='Data_Size') 4237 showIndent(outfile, level) 4238 outfile.write('),\n') 4239 if self.Discovery_Method is not None: 4240 showIndent(outfile, level) 4241 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n') 4242 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method') 4243 showIndent(outfile, level) 4244 outfile.write('),\n') 4245 if self.Data_Segment is not None: 4246 showIndent(outfile, level) 4247 outfile.write('Data_Segment=%s,\n' % quote_python(self.Data_Segment).encode(ExternalEncoding))
4248 - def build(self, node):
4249 self.buildAttributes(node, node.attrib, []) 4250 for child in node: 4251 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4252 self.buildChildren(child, node, nodeName_)
4253 - def buildAttributes(self, node, attrs, already_processed):
4254 value = find_attr_value_('id', node) 4255 if value is not None and 'id' not in already_processed: 4256 already_processed.append('id') 4257 self.id = value 4258 value = find_attr_value_('format', node) 4259 if value is not None and 'format' not in already_processed: 4260 already_processed.append('format') 4261 self.format = value
4262 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4263 if nodeName_ == 'Data_Size': 4264 obj_ = Data_SizeType.factory() 4265 obj_.build(child_) 4266 self.set_Data_Size(obj_) 4267 elif nodeName_ == 'Discovery_Method': 4268 obj_ = DiscoveryMethod.factory() 4269 obj_.build(child_) 4270 self.set_Discovery_Method(obj_) 4271 elif nodeName_ == 'Data_Segment': 4272 Data_Segment_ = child_.text 4273 Data_Segment_ = self.gds_validate_string(Data_Segment_, node, 'Data_Segment') 4274 self.Data_Segment = Data_Segment_
4275 # end class DataType 4276 4277
4278 -class CodeType(GeneratedsSuper):
4279 """CodeType is intended to provide a way of characterizing segments of 4280 malicious code that is extracted or otherwise retrieved from 4281 malware.The codetype attribute is intended to provide a way of 4282 specifying the type of code being characterized. Possible 4283 values: Exploit_Code, Shellcode, Unknown, Other.The language 4284 attribute refers to the programming language used in the code 4285 characterized in this element. Possible values are: C, C++, C#, 4286 Java, JSP, Javascript, ASP.NET, SQL, Python, Perl, PHP, SOAP, 4287 Ruby, Shell, Pseudocode, .NET, Assembly, XML, HTML.If the code 4288 was discovered inside a binary, the start_address attribute can 4289 be used to reference the its start address.The processor_family 4290 attribute is intended to specify the class of processor that the 4291 code snippet is targeting. Possible values: x86-32, x86-64, 4292 IA-64, PowerPC, ARM, Alpha, SPARC, z/Architecture, eSi-RISC, 4293 MIPS, Motorola 68k, Other.The xorpattern attribute contains a 16 4294 -hexadecimal-character hex string, which represents the pattern 4295 that the Code_Segment element should be XORed with in order to 4296 recover the actual code. The default value is 55AA55AA55AA55BB, 4297 as specified by IETF RFC 5901.""" 4298 subclass = None 4299 superclass = None
4300 - def __init__(self, language=None, processor_family=None, start_address=None, codetype=None, xorpattern='55AA55AA55AA55BB', id=None, Discovery_Method=None, Code_Segment=None, Code_Segment_XOR=None, External_File=None):
4301 self.language = _cast(None, language) 4302 self.processor_family = _cast(None, processor_family) 4303 self.start_address = _cast(None, start_address) 4304 self.codetype = _cast(None, codetype) 4305 self.xorpattern = _cast(None, xorpattern) 4306 self.id = _cast(None, id) 4307 self.Discovery_Method = Discovery_Method 4308 self.Code_Segment = Code_Segment 4309 self.Code_Segment_XOR = Code_Segment_XOR 4310 self.External_File = External_File
4311 - def factory(*args_, **kwargs_):
4312 if CodeType.subclass: 4313 return CodeType.subclass(*args_, **kwargs_) 4314 else: 4315 return CodeType(*args_, **kwargs_)
4316 factory = staticmethod(factory)
4317 - def get_Discovery_Method(self): return self.Discovery_Method
4318 - def set_Discovery_Method(self, Discovery_Method): self.Discovery_Method = Discovery_Method
4319 - def get_Code_Segment(self): return self.Code_Segment
4320 - def set_Code_Segment(self, Code_Segment): self.Code_Segment = Code_Segment
4321 - def get_Code_Segment_XOR(self): return self.Code_Segment_XOR
4322 - def set_Code_Segment_XOR(self, Code_Segment_XOR): self.Code_Segment_XOR = Code_Segment_XOR
4323 - def get_External_File(self): return self.External_File
4324 - def set_External_File(self, External_File): self.External_File = External_File
4325 - def get_language(self): return self.language
4326 - def set_language(self, language): self.language = language
4327 - def get_processor_family(self): return self.processor_family
4328 - def set_processor_family(self, processor_family): self.processor_family = processor_family
4329 - def get_start_address(self): return self.start_address
4330 - def set_start_address(self, start_address): self.start_address = start_address
4331 - def get_codetype(self): return self.codetype
4332 - def set_codetype(self, codetype): self.codetype = codetype
4333 - def get_xorpattern(self): return self.xorpattern
4334 - def set_xorpattern(self, xorpattern): self.xorpattern = xorpattern
4335 - def get_id(self): return self.id
4336 - def set_id(self, id): self.id = id
4337 - def export(self, outfile, level, namespace_='maec:', name_='CodeType', namespacedef_=''):
4338 showIndent(outfile, level) 4339 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4340 already_processed = [] 4341 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodeType') 4342 if self.hasContent_(): 4343 outfile.write('>\n') 4344 self.exportChildren(outfile, level + 1, namespace_, name_) 4345 showIndent(outfile, level) 4346 outfile.write('</%s%s>\n' % (namespace_, name_)) 4347 else: 4348 outfile.write('/>\n')
4349 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='CodeType'):
4350 if self.language is not None and 'language' not in already_processed: 4351 already_processed.append('language') 4352 outfile.write(' language=%s' % (quote_attrib(self.language), )) 4353 if self.processor_family is not None and 'processor_family' not in already_processed: 4354 already_processed.append('processor_family') 4355 outfile.write(' processor_family=%s' % (quote_attrib(self.processor_family), )) 4356 if self.start_address is not None and 'start_address' not in already_processed: 4357 already_processed.append('start_address') 4358 outfile.write(' start_address=%s' % (quote_attrib(self.start_address), )) 4359 if self.codetype is not None and 'codetype' not in already_processed: 4360 already_processed.append('codetype') 4361 outfile.write(' codetype=%s' % (self.gds_format_string(quote_attrib(self.codetype).encode(ExternalEncoding), input_name='codetype'), )) 4362 if self.xorpattern is not None and 'xorpattern' not in already_processed: 4363 already_processed.append('xorpattern') 4364 outfile.write(' xorpattern=%s' % (quote_attrib(self.xorpattern), )) 4365 if self.id is not None and 'id' not in already_processed: 4366 already_processed.append('id') 4367 outfile.write(' id=%s' % (quote_attrib(self.id), ))
4368 - def exportChildren(self, outfile, level, namespace_='maec:', name_='CodeType', fromsubclass_=False):
4369 if self.Discovery_Method is not None: 4370 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method') 4371 if self.Code_Segment is not None: 4372 showIndent(outfile, level) 4373 outfile.write('<%sCode_Segment>%s</%sCode_Segment>\n' % (namespace_, self.gds_format_string(quote_xml(self.Code_Segment).encode(ExternalEncoding), input_name='Code_Segment'), namespace_)) 4374 if self.Code_Segment_XOR is not None: 4375 self.Code_Segment_XOR.export(outfile, level, namespace_, name_='Code_Segment_XOR') 4376 if self.External_File is not None: 4377 self.External_File.export(outfile, level, namespace_, name_='External_File')
4378 - def hasContent_(self):
4379 if ( 4380 self.Discovery_Method is not None or 4381 self.Code_Segment is not None or 4382 self.Code_Segment_XOR is not None or 4383 self.External_File is not None 4384 ): 4385 return True 4386 else: 4387 return False
4388 - def exportLiteral(self, outfile, level, name_='CodeType'):
4389 level += 1 4390 self.exportLiteralAttributes(outfile, level, [], name_) 4391 if self.hasContent_(): 4392 self.exportLiteralChildren(outfile, level, name_)
4393 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4394 if self.language is not None and 'language' not in already_processed: 4395 already_processed.append('language') 4396 showIndent(outfile, level) 4397 outfile.write('language = %s,\n' % (self.language,)) 4398 if self.processor_family is not None and 'processor_family' not in already_processed: 4399 already_processed.append('processor_family') 4400 showIndent(outfile, level) 4401 outfile.write('processor_family = %s,\n' % (self.processor_family,)) 4402 if self.start_address is not None and 'start_address' not in already_processed: 4403 already_processed.append('start_address') 4404 showIndent(outfile, level) 4405 outfile.write('start_address = %s,\n' % (self.start_address,)) 4406 if self.codetype is not None and 'codetype' not in already_processed: 4407 already_processed.append('codetype') 4408 showIndent(outfile, level) 4409 outfile.write('codetype = "%s",\n' % (self.codetype,)) 4410 if self.xorpattern is not None and 'xorpattern' not in already_processed: 4411 already_processed.append('xorpattern') 4412 showIndent(outfile, level) 4413 outfile.write('xorpattern = %s,\n' % (self.xorpattern,)) 4414 if self.id is not None and 'id' not in already_processed: 4415 already_processed.append('id') 4416 showIndent(outfile, level) 4417 outfile.write('id = %s,\n' % (self.id,))
4418 - def exportLiteralChildren(self, outfile, level, name_):
4419 if self.Discovery_Method is not None: 4420 showIndent(outfile, level) 4421 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n') 4422 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method') 4423 showIndent(outfile, level) 4424 outfile.write('),\n') 4425 if self.Code_Segment is not None: 4426 showIndent(outfile, level) 4427 outfile.write('Code_Segment=%s,\n' % quote_python(self.Code_Segment).encode(ExternalEncoding)) 4428 if self.Code_Segment_XOR is not None: 4429 showIndent(outfile, level) 4430 outfile.write('Code_Segment_XOR=model_.xs_hexBinary(\n') 4431 self.Code_Segment_XOR.exportLiteral(outfile, level, name_='Code_Segment_XOR') 4432 showIndent(outfile, level) 4433 outfile.write('),\n') 4434 if self.External_File is not None: 4435 showIndent(outfile, level) 4436 outfile.write('External_File=model_.ObjectType(\n') 4437 self.External_File.exportLiteral(outfile, level, name_='External_File') 4438 showIndent(outfile, level) 4439 outfile.write('),\n')
4440 - def build(self, node):
4441 self.buildAttributes(node, node.attrib, []) 4442 for child in node: 4443 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4444 self.buildChildren(child, node, nodeName_)
4445 - def buildAttributes(self, node, attrs, already_processed):
4446 value = find_attr_value_('language', node) 4447 if value is not None and 'language' not in already_processed: 4448 already_processed.append('language') 4449 self.language = value 4450 value = find_attr_value_('processor_family', node) 4451 if value is not None and 'processor_family' not in already_processed: 4452 already_processed.append('processor_family') 4453 self.processor_family = value 4454 value = find_attr_value_('start_address', node) 4455 if value is not None and 'start_address' not in already_processed: 4456 already_processed.append('start_address') 4457 self.start_address = value 4458 value = find_attr_value_('codetype', node) 4459 if value is not None and 'codetype' not in already_processed: 4460 already_processed.append('codetype') 4461 self.codetype = value 4462 value = find_attr_value_('xorpattern', node) 4463 if value is not None and 'xorpattern' not in already_processed: 4464 already_processed.append('xorpattern') 4465 self.xorpattern = value 4466 value = find_attr_value_('id', node) 4467 if value is not None and 'id' not in already_processed: 4468 already_processed.append('id') 4469 self.id = value
4470 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4471 if nodeName_ == 'Discovery_Method': 4472 obj_ = DiscoveryMethod.factory() 4473 obj_.build(child_) 4474 self.set_Discovery_Method(obj_) 4475 elif nodeName_ == 'Code_Segment': 4476 Code_Segment_ = child_.text 4477 Code_Segment_ = self.gds_validate_string(Code_Segment_, node, 'Code_Segment') 4478 self.Code_Segment = Code_Segment_ 4479 elif nodeName_ == 'Code_Segment_XOR': 4480 obj_ = xs_hexBinary.factory() 4481 obj_.build(child_) 4482 self.set_Code_Segment_XOR(obj_) 4483 elif nodeName_ == 'External_File': 4484 obj_ = ObjectType.factory() 4485 obj_.build(child_) 4486 self.set_External_File(obj_)
4487 # end class CodeType 4488 4489
4490 -class DiscoveryMethod(GeneratedsSuper):
4491 """DiscoveryMethod is intended to provide a mechanism for the 4492 characterization of how actions, behaviors, malicious code, data 4493 segments, and other relevant MAEC entities were discovered.The 4494 tool_id attribute contains the id of the tool used to discovery 4495 the entity (if applicable).The method attribute contains the 4496 method used to discover the entity. Possible values are: Static 4497 Analysis, Dynamic/Runtime Analysis, Other.""" 4498 subclass = None 4499 superclass = None
4500 - def __init__(self, tool_id=None, method=None):
4501 self.tool_id = _cast(None, tool_id) 4502 self.method = _cast(None, method) 4503 pass
4504 - def factory(*args_, **kwargs_):
4505 if DiscoveryMethod.subclass: 4506 return DiscoveryMethod.subclass(*args_, **kwargs_) 4507 else: 4508 return DiscoveryMethod(*args_, **kwargs_)
4509 factory = staticmethod(factory)
4510 - def get_tool_id(self): return self.tool_id
4511 - def set_tool_id(self, tool_id): self.tool_id = tool_id
4512 - def get_method(self): return self.method
4513 - def set_method(self, method): self.method = method
4514 - def export(self, outfile, level, namespace_='maec:', name_='DiscoveryMethod', namespacedef_=''):
4515 showIndent(outfile, level) 4516 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4517 already_processed = [] 4518 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DiscoveryMethod') 4519 if self.hasContent_(): 4520 outfile.write('>\n') 4521 self.exportChildren(outfile, level + 1, namespace_, name_) 4522 outfile.write('</%s%s>\n' % (namespace_, name_)) 4523 else: 4524 outfile.write('/>\n')
4525 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='DiscoveryMethod'):
4526 if self.tool_id is not None and 'tool_id' not in already_processed: 4527 already_processed.append('tool_id') 4528 outfile.write(' tool_id=%s' % (quote_attrib(self.tool_id), )) 4529 if self.method is not None and 'method' not in already_processed: 4530 already_processed.append('method') 4531 outfile.write(' method=%s' % (self.gds_format_string(quote_attrib(self.method).encode(ExternalEncoding), input_name='method'), ))
4532 - def exportChildren(self, outfile, level, namespace_='maec:', name_='DiscoveryMethod', fromsubclass_=False):
4533 pass
4534 - def hasContent_(self):
4535 if ( 4536 4537 ): 4538 return True 4539 else: 4540 return False
4541 - def exportLiteral(self, outfile, level, name_='DiscoveryMethod'):
4542 level += 1 4543 self.exportLiteralAttributes(outfile, level, [], name_) 4544 if self.hasContent_(): 4545 self.exportLiteralChildren(outfile, level, name_)
4546 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4547 if self.tool_id is not None and 'tool_id' not in already_processed: 4548 already_processed.append('tool_id') 4549 showIndent(outfile, level) 4550 outfile.write('tool_id = %s,\n' % (self.tool_id,)) 4551 if self.method is not None and 'method' not in already_processed: 4552 already_processed.append('method') 4553 showIndent(outfile, level) 4554 outfile.write('method = "%s",\n' % (self.method,))
4555 - def exportLiteralChildren(self, outfile, level, name_):
4556 pass
4557 - def build(self, node):
4558 self.buildAttributes(node, node.attrib, []) 4559 for child in node: 4560 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4561 self.buildChildren(child, node, nodeName_)
4562 - def buildAttributes(self, node, attrs, already_processed):
4563 value = find_attr_value_('tool_id', node) 4564 if value is not None and 'tool_id' not in already_processed: 4565 already_processed.append('tool_id') 4566 self.tool_id = value 4567 value = find_attr_value_('method', node) 4568 if value is not None and 'method' not in already_processed: 4569 already_processed.append('method') 4570 self.method = value
4571 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4572 pass
4573 # end class DiscoveryMethod 4574 4575
4576 -class HashType(GeneratedsSuper):
4577 """HashType is intended as a way of chracterizing the outputs of 4578 crytopgrahic hash functions.The type attribute refers to the 4579 type of hash used in the Hash_Value element. Possible choices 4580 are: SHA1, SHA256, MD5, MD6, Other.The other_type refers to an 4581 optional attribute, which can be used if it is necessary to 4582 specify a hash type other than those that are enumerated in the 4583 'type' attribute.""" 4584 subclass = None 4585 superclass = None
4586 - def __init__(self, type_=None, other_type=None, Hash_Value=None):
4587 self.type_ = _cast(None, type_) 4588 self.other_type = _cast(None, other_type) 4589 self.Hash_Value = Hash_Value
4590 - def factory(*args_, **kwargs_):
4591 if HashType.subclass: 4592 return HashType.subclass(*args_, **kwargs_) 4593 else: 4594 return HashType(*args_, **kwargs_)
4595 factory = staticmethod(factory)
4596 - def get_Hash_Value(self): return self.Hash_Value
4597 - def set_Hash_Value(self, Hash_Value): self.Hash_Value = Hash_Value
4598 - def get_type(self): return self.type_
4599 - def set_type(self, type_): self.type_ = type_
4600 - def get_other_type(self): return self.other_type
4601 - def set_other_type(self, other_type): self.other_type = other_type
4602 - def export(self, outfile, level, namespace_='maec:', name_='HashType', namespacedef_=''):
4603 showIndent(outfile, level) 4604 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4605 already_processed = [] 4606 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashType') 4607 if self.hasContent_(): 4608 outfile.write('>\n') 4609 self.exportChildren(outfile, level + 1, namespace_, name_) 4610 showIndent(outfile, level) 4611 outfile.write('</%s%s>\n' % (namespace_, name_)) 4612 else: 4613 outfile.write('/>\n')
4614 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashType'):
4615 if self.type_ is not None and 'type_' not in already_processed: 4616 already_processed.append('type_') 4617 outfile.write(' type=%s' % (quote_attrib(self.type_), )) 4618 if self.other_type is not None and 'other_type' not in already_processed: 4619 already_processed.append('other_type') 4620 outfile.write(' other_type=%s' % (self.gds_format_string(quote_attrib(self.other_type).encode(ExternalEncoding), input_name='other_type'), ))
4621 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashType', fromsubclass_=False):
4622 if self.Hash_Value is not None: 4623 showIndent(outfile, level) 4624 outfile.write('<%sHash_Value>%s</%sHash_Value>\n' % (namespace_, self.gds_format_string(quote_xml(self.Hash_Value).encode(ExternalEncoding), input_name='Hash_Value'), namespace_))
4625 - def hasContent_(self):
4626 if ( 4627 self.Hash_Value is not None 4628 ): 4629 return True 4630 else: 4631 return False
4632 - def exportLiteral(self, outfile, level, name_='HashType'):
4633 level += 1 4634 self.exportLiteralAttributes(outfile, level, [], name_) 4635 if self.hasContent_(): 4636 self.exportLiteralChildren(outfile, level, name_)
4637 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4638 if self.type_ is not None and 'type_' not in already_processed: 4639 already_processed.append('type_') 4640 showIndent(outfile, level) 4641 outfile.write('type_ = %s,\n' % (self.type_,)) 4642 if self.other_type is not None and 'other_type' not in already_processed: 4643 already_processed.append('other_type') 4644 showIndent(outfile, level) 4645 outfile.write('other_type = "%s",\n' % (self.other_type,))
4646 - def exportLiteralChildren(self, outfile, level, name_):
4647 if self.Hash_Value is not None: 4648 showIndent(outfile, level) 4649 outfile.write('Hash_Value=model_.xs_hexBinary(\n') 4650 self.Hash_Value.exportLiteral(outfile, level, name_='Hash_Value') 4651 showIndent(outfile, level) 4652 outfile.write('),\n')
4653 - def build(self, node):
4654 self.buildAttributes(node, node.attrib, []) 4655 for child in node: 4656 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4657 self.buildChildren(child, node, nodeName_)
4658 - def buildAttributes(self, node, attrs, already_processed):
4659 value = find_attr_value_('type', node) 4660 if value is not None and 'type' not in already_processed: 4661 already_processed.append('type') 4662 self.type_ = value 4663 value = find_attr_value_('other_type', node) 4664 if value is not None and 'other_type' not in already_processed: 4665 already_processed.append('other_type') 4666 self.other_type = value
4667 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4668 if nodeName_ == 'Hash_Value': 4669 obj_ = xs_hexBinary.factory() 4670 obj_.build(child_) 4671 self.set_Hash_Value(obj_)
4672 # end class HashType 4673 4674
4675 -class PEDataDirectoryStruct(GeneratedsSuper):
4676 """PEDataDirectoryStruct is intended as container for the attributes 4677 present in a PE binary's data directory structure.""" 4678 subclass = None 4679 superclass = None
4680 - def __init__(self, Virtual_Address=None, Size=None):
4681 self.Virtual_Address = Virtual_Address 4682 self.Size = Size
4683 - def factory(*args_, **kwargs_):
4684 if PEDataDirectoryStruct.subclass: 4685 return PEDataDirectoryStruct.subclass(*args_, **kwargs_) 4686 else: 4687 return PEDataDirectoryStruct(*args_, **kwargs_)
4688 factory = staticmethod(factory)
4689 - def get_Virtual_Address(self): return self.Virtual_Address
4690 - def set_Virtual_Address(self, Virtual_Address): self.Virtual_Address = Virtual_Address
4691 - def get_Size(self): return self.Size
4692 - def set_Size(self, Size): self.Size = Size
4693 - def export(self, outfile, level, namespace_='maec:', name_='PEDataDirectoryStruct', namespacedef_=''):
4694 showIndent(outfile, level) 4695 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4696 already_processed = [] 4697 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEDataDirectoryStruct') 4698 if self.hasContent_(): 4699 outfile.write('>\n') 4700 self.exportChildren(outfile, level + 1, namespace_, name_) 4701 showIndent(outfile, level) 4702 outfile.write('</%s%s>\n' % (namespace_, name_)) 4703 else: 4704 outfile.write('/>\n')
4705 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEDataDirectoryStruct'):
4706 pass
4707 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEDataDirectoryStruct', fromsubclass_=False):
4708 if self.Virtual_Address is not None: 4709 self.Virtual_Address.export(outfile, level, namespace_, name_='Virtual_Address', ) 4710 if self.Size is not None: 4711 showIndent(outfile, level) 4712 outfile.write('<%sSize>%s</%sSize>\n' % (namespace_, self.gds_format_integer(self.Size, input_name='Size'), namespace_))
4713 - def hasContent_(self):
4714 if ( 4715 self.Virtual_Address is not None or 4716 self.Size is not None 4717 ): 4718 return True 4719 else: 4720 return False
4721 - def exportLiteral(self, outfile, level, name_='PEDataDirectoryStruct'):
4722 level += 1 4723 self.exportLiteralAttributes(outfile, level, [], name_) 4724 if self.hasContent_(): 4725 self.exportLiteralChildren(outfile, level, name_)
4726 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4727 pass
4728 - def exportLiteralChildren(self, outfile, level, name_):
4729 if self.Virtual_Address is not None: 4730 showIndent(outfile, level) 4731 outfile.write('Virtual_Address=model_.xs_hexBinary(\n') 4732 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address') 4733 showIndent(outfile, level) 4734 outfile.write('),\n') 4735 if self.Size is not None: 4736 showIndent(outfile, level) 4737 outfile.write('Size=%d,\n' % self.Size)
4738 - def build(self, node):
4739 self.buildAttributes(node, node.attrib, []) 4740 for child in node: 4741 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4742 self.buildChildren(child, node, nodeName_)
4743 - def buildAttributes(self, node, attrs, already_processed):
4744 pass
4745 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4746 if nodeName_ == 'Virtual_Address': 4747 obj_ = xs_hexBinary.factory() 4748 obj_.build(child_) 4749 self.set_Virtual_Address(obj_) 4750 elif nodeName_ == 'Size': 4751 sval_ = child_.text 4752 try: 4753 ival_ = int(sval_) 4754 except (TypeError, ValueError) as e: 4755 raise_parse_error(child_, 'requires integer: %s' % e) 4756 ival_ = self.gds_validate_integer(ival_, node, 'Size') 4757 self.Size = ival_
4758 # end class PEDataDirectoryStruct 4759 4760
4761 -class PESectionHeaderStruct(GeneratedsSuper):
4762 """PESectionHeaderStruct is intended as container for the attributes 4763 present in a PE binary's section header structure.""" 4764 subclass = None 4765 superclass = None
4766 - def __init__(self, Hashes=None, Name=None, Physical_Address=None, Virtual_Address=None, Size_Of_Raw_Data=None, Pointer_To_Raw_Data=None, Pointer_To_Relocations=None, Pointer_To_Linenumbers=None, Number_Of_Relocations=None, Number_Of_Linenumbers=None, Characteristics=None):
4767 self.Hashes = Hashes 4768 self.Name = Name 4769 self.Physical_Address = Physical_Address 4770 self.Virtual_Address = Virtual_Address 4771 self.Size_Of_Raw_Data = Size_Of_Raw_Data 4772 self.Pointer_To_Raw_Data = Pointer_To_Raw_Data 4773 self.Pointer_To_Relocations = Pointer_To_Relocations 4774 self.Pointer_To_Linenumbers = Pointer_To_Linenumbers 4775 self.Number_Of_Relocations = Number_Of_Relocations 4776 self.Number_Of_Linenumbers = Number_Of_Linenumbers 4777 self.Characteristics = Characteristics
4778 - def factory(*args_, **kwargs_):
4779 if PESectionHeaderStruct.subclass: 4780 return PESectionHeaderStruct.subclass(*args_, **kwargs_) 4781 else: 4782 return PESectionHeaderStruct(*args_, **kwargs_)
4783 factory = staticmethod(factory)
4784 - def get_Hashes(self): return self.Hashes
4785 - def set_Hashes(self, Hashes): self.Hashes = Hashes
4786 - def get_Name(self): return self.Name
4787 - def set_Name(self, Name): self.Name = Name
4788 - def get_Physical_Address(self): return self.Physical_Address
4789 - def set_Physical_Address(self, Physical_Address): self.Physical_Address = Physical_Address
4790 - def get_Virtual_Address(self): return self.Virtual_Address
4791 - def set_Virtual_Address(self, Virtual_Address): self.Virtual_Address = Virtual_Address
4792 - def get_Size_Of_Raw_Data(self): return self.Size_Of_Raw_Data
4793 - def set_Size_Of_Raw_Data(self, Size_Of_Raw_Data): self.Size_Of_Raw_Data = Size_Of_Raw_Data
4794 - def get_Pointer_To_Raw_Data(self): return self.Pointer_To_Raw_Data
4795 - def set_Pointer_To_Raw_Data(self, Pointer_To_Raw_Data): self.Pointer_To_Raw_Data = Pointer_To_Raw_Data
4796 - def get_Pointer_To_Relocations(self): return self.Pointer_To_Relocations
4797 - def set_Pointer_To_Relocations(self, Pointer_To_Relocations): self.Pointer_To_Relocations = Pointer_To_Relocations
4798 - def get_Pointer_To_Linenumbers(self): return self.Pointer_To_Linenumbers
4799 - def set_Pointer_To_Linenumbers(self, Pointer_To_Linenumbers): self.Pointer_To_Linenumbers = Pointer_To_Linenumbers
4800 - def get_Number_Of_Relocations(self): return self.Number_Of_Relocations
4801 - def set_Number_Of_Relocations(self, Number_Of_Relocations): self.Number_Of_Relocations = Number_Of_Relocations
4802 - def get_Number_Of_Linenumbers(self): return self.Number_Of_Linenumbers
4803 - def set_Number_Of_Linenumbers(self, Number_Of_Linenumbers): self.Number_Of_Linenumbers = Number_Of_Linenumbers
4804 - def get_Characteristics(self): return self.Characteristics
4805 - def set_Characteristics(self, Characteristics): self.Characteristics = Characteristics
4806 - def export(self, outfile, level, namespace_='maec:', name_='PESectionHeaderStruct', namespacedef_=''):
4807 showIndent(outfile, level) 4808 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 4809 already_processed = [] 4810 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PESectionHeaderStruct') 4811 if self.hasContent_(): 4812 outfile.write('>\n') 4813 self.exportChildren(outfile, level + 1, namespace_, name_) 4814 showIndent(outfile, level) 4815 outfile.write('</%s%s>\n' % (namespace_, name_)) 4816 else: 4817 outfile.write('/>\n')
4818 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PESectionHeaderStruct'):
4819 pass
4820 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PESectionHeaderStruct', fromsubclass_=False):
4821 if self.Hashes is not None: 4822 self.Hashes.export(outfile, level, namespace_, name_='Hashes') 4823 if self.Name is not None: 4824 showIndent(outfile, level) 4825 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) 4826 if self.Physical_Address is not None: 4827 self.Physical_Address.export(outfile, level, namespace_, name_='Physical_Address') 4828 if self.Virtual_Address is not None: 4829 self.Virtual_Address.export(outfile, level, namespace_, name_='Virtual_Address') 4830 if self.Size_Of_Raw_Data is not None: 4831 self.Size_Of_Raw_Data.export(outfile, level, namespace_, name_='Size_Of_Raw_Data') 4832 if self.Pointer_To_Raw_Data is not None: 4833 self.Pointer_To_Raw_Data.export(outfile, level, namespace_, name_='Pointer_To_Raw_Data') 4834 if self.Pointer_To_Relocations is not None: 4835 self.Pointer_To_Relocations.export(outfile, level, namespace_, name_='Pointer_To_Relocations') 4836 if self.Pointer_To_Linenumbers is not None: 4837 self.Pointer_To_Linenumbers.export(outfile, level, namespace_, name_='Pointer_To_Linenumbers') 4838 if self.Number_Of_Relocations is not None: 4839 showIndent(outfile, level) 4840 outfile.write('<%sNumber_Of_Relocations>%s</%sNumber_Of_Relocations>\n' % (namespace_, self.gds_format_integer(self.Number_Of_Relocations, input_name='Number_Of_Relocations'), namespace_)) 4841 if self.Number_Of_Linenumbers is not None: 4842 showIndent(outfile, level) 4843 outfile.write('<%sNumber_Of_Linenumbers>%s</%sNumber_Of_Linenumbers>\n' % (namespace_, self.gds_format_integer(self.Number_Of_Linenumbers, input_name='Number_Of_Linenumbers'), namespace_)) 4844 if self.Characteristics is not None: 4845 self.Characteristics.export(outfile, level, namespace_, name_='Characteristics')
4846 - def hasContent_(self):
4847 if ( 4848 self.Hashes is not None or 4849 self.Name is not None or 4850 self.Physical_Address is not None or 4851 self.Virtual_Address is not None or 4852 self.Size_Of_Raw_Data is not None or 4853 self.Pointer_To_Raw_Data is not None or 4854 self.Pointer_To_Relocations is not None or 4855 self.Pointer_To_Linenumbers is not None or 4856 self.Number_Of_Relocations is not None or 4857 self.Number_Of_Linenumbers is not None or 4858 self.Characteristics is not None 4859 ): 4860 return True 4861 else: 4862 return False
4863 - def exportLiteral(self, outfile, level, name_='PESectionHeaderStruct'):
4864 level += 1 4865 self.exportLiteralAttributes(outfile, level, [], name_) 4866 if self.hasContent_(): 4867 self.exportLiteralChildren(outfile, level, name_)
4868 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
4869 pass
4870 - def exportLiteralChildren(self, outfile, level, name_):
4871 if self.Hashes is not None: 4872 showIndent(outfile, level) 4873 outfile.write('Hashes=model_.HashesType5(\n') 4874 self.Hashes.exportLiteral(outfile, level, name_='Hashes') 4875 showIndent(outfile, level) 4876 outfile.write('),\n') 4877 if self.Name is not None: 4878 showIndent(outfile, level) 4879 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) 4880 if self.Physical_Address is not None: 4881 showIndent(outfile, level) 4882 outfile.write('Physical_Address=model_.xs_hexBinary(\n') 4883 self.Physical_Address.exportLiteral(outfile, level, name_='Physical_Address') 4884 showIndent(outfile, level) 4885 outfile.write('),\n') 4886 if self.Virtual_Address is not None: 4887 showIndent(outfile, level) 4888 outfile.write('Virtual_Address=model_.xs_hexBinary(\n') 4889 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address') 4890 showIndent(outfile, level) 4891 outfile.write('),\n') 4892 if self.Size_Of_Raw_Data is not None: 4893 showIndent(outfile, level) 4894 outfile.write('Size_Of_Raw_Data=model_.xs_hexBinary(\n') 4895 self.Size_Of_Raw_Data.exportLiteral(outfile, level, name_='Size_Of_Raw_Data') 4896 showIndent(outfile, level) 4897 outfile.write('),\n') 4898 if self.Pointer_To_Raw_Data is not None: 4899 showIndent(outfile, level) 4900 outfile.write('Pointer_To_Raw_Data=model_.xs_hexBinary(\n') 4901 self.Pointer_To_Raw_Data.exportLiteral(outfile, level, name_='Pointer_To_Raw_Data') 4902 showIndent(outfile, level) 4903 outfile.write('),\n') 4904 if self.Pointer_To_Relocations is not None: 4905 showIndent(outfile, level) 4906 outfile.write('Pointer_To_Relocations=model_.xs_hexBinary(\n') 4907 self.Pointer_To_Relocations.exportLiteral(outfile, level, name_='Pointer_To_Relocations') 4908 showIndent(outfile, level) 4909 outfile.write('),\n') 4910 if self.Pointer_To_Linenumbers is not None: 4911 showIndent(outfile, level) 4912 outfile.write('Pointer_To_Linenumbers=model_.xs_hexBinary(\n') 4913 self.Pointer_To_Linenumbers.exportLiteral(outfile, level, name_='Pointer_To_Linenumbers') 4914 showIndent(outfile, level) 4915 outfile.write('),\n') 4916 if self.Number_Of_Relocations is not None: 4917 showIndent(outfile, level) 4918 outfile.write('Number_Of_Relocations=%d,\n' % self.Number_Of_Relocations) 4919 if self.Number_Of_Linenumbers is not None: 4920 showIndent(outfile, level) 4921 outfile.write('Number_Of_Linenumbers=%d,\n' % self.Number_Of_Linenumbers) 4922 if self.Characteristics is not None: 4923 showIndent(outfile, level) 4924 outfile.write('Characteristics=model_.xs_hexBinary(\n') 4925 self.Characteristics.exportLiteral(outfile, level, name_='Characteristics') 4926 showIndent(outfile, level) 4927 outfile.write('),\n')
4928 - def build(self, node):
4929 self.buildAttributes(node, node.attrib, []) 4930 for child in node: 4931 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 4932 self.buildChildren(child, node, nodeName_)
4933 - def buildAttributes(self, node, attrs, already_processed):
4934 pass
4935 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4936 if nodeName_ == 'Hashes': 4937 obj_ = HashesType5.factory() 4938 obj_.build(child_) 4939 self.set_Hashes(obj_) 4940 elif nodeName_ == 'Name': 4941 Name_ = child_.text 4942 Name_ = self.gds_validate_string(Name_, node, 'Name') 4943 self.Name = Name_ 4944 elif nodeName_ == 'Physical_Address': 4945 obj_ = xs_hexBinary.factory() 4946 obj_.build(child_) 4947 self.set_Physical_Address(obj_) 4948 elif nodeName_ == 'Virtual_Address': 4949 obj_ = xs_hexBinary.factory() 4950 obj_.build(child_) 4951 self.set_Virtual_Address(obj_) 4952 elif nodeName_ == 'Size_Of_Raw_Data': 4953 obj_ = xs_hexBinary.factory() 4954 obj_.build(child_) 4955 self.set_Size_Of_Raw_Data(obj_) 4956 elif nodeName_ == 'Pointer_To_Raw_Data': 4957 obj_ = xs_hexBinary.factory() 4958 obj_.build(child_) 4959 self.set_Pointer_To_Raw_Data(obj_) 4960 elif nodeName_ == 'Pointer_To_Relocations': 4961 obj_ = xs_hexBinary.factory() 4962 obj_.build(child_) 4963 self.set_Pointer_To_Relocations(obj_) 4964 elif nodeName_ == 'Pointer_To_Linenumbers': 4965 obj_ = xs_hexBinary.factory() 4966 obj_.build(child_) 4967 self.set_Pointer_To_Linenumbers(obj_) 4968 elif nodeName_ == 'Number_Of_Relocations': 4969 sval_ = child_.text 4970 try: 4971 ival_ = int(sval_) 4972 except (TypeError, ValueError) as e: 4973 raise_parse_error(child_, 'requires integer: %s' % e) 4974 ival_ = self.gds_validate_integer(ival_, node, 'Number_Of_Relocations') 4975 self.Number_Of_Relocations = ival_ 4976 elif nodeName_ == 'Number_Of_Linenumbers': 4977 sval_ = child_.text 4978 try: 4979 ival_ = int(sval_) 4980 except (TypeError, ValueError) as e: 4981 raise_parse_error(child_, 'requires integer: %s' % e) 4982 ival_ = self.gds_validate_integer(ival_, node, 'Number_Of_Linenumbers') 4983 self.Number_Of_Linenumbers = ival_ 4984 elif nodeName_ == 'Characteristics': 4985 obj_ = xs_hexBinary.factory() 4986 obj_.build(child_) 4987 self.set_Characteristics(obj_)
4988 # end class PESectionHeaderStruct 4989 4990
4991 -class PEStringType(GeneratedsSuper):
4992 """PEStringType is intended as container for strings extracted from PE 4993 binaries.The address attribute refers to the location of the 4994 specified string in the PE binary.The encoding attribute refers 4995 to the encoding method used for the string extracted from the PE 4996 binary. Possible values are: ANSI, Unicode, Other.The length 4997 attribute refers to the length, in characters, of the string 4998 extracted from the PE binary.""" 4999 subclass = None 5000 superclass = None
5001 - def __init__(self, length=None, encoding=None, address=None, String_Value=None, Hashes=None):
5002 self.length = _cast(int, length) 5003 self.encoding = _cast(None, encoding) 5004 self.address = _cast(None, address) 5005 self.String_Value = String_Value 5006 self.Hashes = Hashes
5007 - def factory(*args_, **kwargs_):
5008 if PEStringType.subclass: 5009 return PEStringType.subclass(*args_, **kwargs_) 5010 else: 5011 return PEStringType(*args_, **kwargs_)
5012 factory = staticmethod(factory)
5013 - def get_String_Value(self): return self.String_Value
5014 - def set_String_Value(self, String_Value): self.String_Value = String_Value
5015 - def get_Hashes(self): return self.Hashes
5016 - def set_Hashes(self, Hashes): self.Hashes = Hashes
5017 - def get_length(self): return self.length
5018 - def set_length(self, length): self.length = length
5019 - def get_encoding(self): return self.encoding
5020 - def set_encoding(self, encoding): self.encoding = encoding
5021 - def get_address(self): return self.address
5022 - def set_address(self, address): self.address = address
5023 - def export(self, outfile, level, namespace_='maec:', name_='PEStringType', namespacedef_=''):
5024 showIndent(outfile, level) 5025 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5026 already_processed = [] 5027 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEStringType') 5028 if self.hasContent_(): 5029 outfile.write('>\n') 5030 self.exportChildren(outfile, level + 1, namespace_, name_) 5031 showIndent(outfile, level) 5032 outfile.write('</%s%s>\n' % (namespace_, name_)) 5033 else: 5034 outfile.write('/>\n')
5035 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEStringType'):
5036 if self.length is not None and 'length' not in already_processed: 5037 already_processed.append('length') 5038 outfile.write(' length="%s"' % self.gds_format_integer(self.length, input_name='length')) 5039 if self.encoding is not None and 'encoding' not in already_processed: 5040 already_processed.append('encoding') 5041 outfile.write(' encoding=%s' % (self.gds_format_string(quote_attrib(self.encoding).encode(ExternalEncoding), input_name='encoding'), )) 5042 if self.address is not None and 'address' not in already_processed: 5043 already_processed.append('address') 5044 outfile.write(' address=%s' % (quote_attrib(self.address), ))
5045 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEStringType', fromsubclass_=False):
5046 if self.String_Value is not None: 5047 showIndent(outfile, level) 5048 outfile.write('<%sString_Value>%s</%sString_Value>\n' % (namespace_, self.gds_format_string(quote_xml(self.String_Value).encode(ExternalEncoding), input_name='String_Value'), namespace_)) 5049 if self.Hashes is not None: 5050 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
5051 - def hasContent_(self):
5052 if ( 5053 self.String_Value is not None or 5054 self.Hashes is not None 5055 ): 5056 return True 5057 else: 5058 return False
5059 - def exportLiteral(self, outfile, level, name_='PEStringType'):
5060 level += 1 5061 self.exportLiteralAttributes(outfile, level, [], name_) 5062 if self.hasContent_(): 5063 self.exportLiteralChildren(outfile, level, name_)
5064 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5065 if self.length is not None and 'length' not in already_processed: 5066 already_processed.append('length') 5067 showIndent(outfile, level) 5068 outfile.write('length = %d,\n' % (self.length,)) 5069 if self.encoding is not None and 'encoding' not in already_processed: 5070 already_processed.append('encoding') 5071 showIndent(outfile, level) 5072 outfile.write('encoding = "%s",\n' % (self.encoding,)) 5073 if self.address is not None and 'address' not in already_processed: 5074 already_processed.append('address') 5075 showIndent(outfile, level) 5076 outfile.write('address = %s,\n' % (self.address,))
5077 - def exportLiteralChildren(self, outfile, level, name_):
5078 if self.String_Value is not None: 5079 showIndent(outfile, level) 5080 outfile.write('String_Value=%s,\n' % quote_python(self.String_Value).encode(ExternalEncoding)) 5081 if self.Hashes is not None: 5082 showIndent(outfile, level) 5083 outfile.write('Hashes=model_.HashesType6(\n') 5084 self.Hashes.exportLiteral(outfile, level, name_='Hashes') 5085 showIndent(outfile, level) 5086 outfile.write('),\n')
5087 - def build(self, node):
5088 self.buildAttributes(node, node.attrib, []) 5089 for child in node: 5090 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5091 self.buildChildren(child, node, nodeName_)
5092 - def buildAttributes(self, node, attrs, already_processed):
5093 value = find_attr_value_('length', node) 5094 if value is not None and 'length' not in already_processed: 5095 already_processed.append('length') 5096 try: 5097 self.length = int(value) 5098 except ValueError as e: 5099 raise_parse_error(node, 'Bad integer attribute: %s' % e) 5100 value = find_attr_value_('encoding', node) 5101 if value is not None and 'encoding' not in already_processed: 5102 already_processed.append('encoding') 5103 self.encoding = value 5104 value = find_attr_value_('address', node) 5105 if value is not None and 'address' not in already_processed: 5106 already_processed.append('address') 5107 self.address = value
5108 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5109 if nodeName_ == 'String_Value': 5110 String_Value_ = child_.text 5111 String_Value_ = self.gds_validate_string(String_Value_, node, 'String_Value') 5112 self.String_Value = String_Value_ 5113 elif nodeName_ == 'Hashes': 5114 obj_ = HashesType6.factory() 5115 obj_.build(child_) 5116 self.set_Hashes(obj_)
5117 # end class PEStringType 5118 5119
5120 -class PEImportType(GeneratedsSuper):
5121 """PEImportType is intended as container for the attributes relevant to 5122 PE binary imports.The type attribute refers to the type of 5123 import, with regards to being initially visible or hidden in 5124 relation to PE binary packing. A packed binary will typically 5125 have few initially visible imports, and thus it is necessary to 5126 make the distinction between those that are visible initially or 5127 only after the binary is unpacked. Thus, the possible values for 5128 this attribute are: Initially Visible, Initially Hidden.The 5129 delay_load attribute is a boolean value that is intended to 5130 describe whether a PE binary import is delay-load or not.""" 5131 subclass = None 5132 superclass = None
5133 - def __init__(self, type_=None, delay_load=None, File_Name=None, Virtual_Address=None, Imported_Functions=None):
5134 self.type_ = _cast(None, type_) 5135 self.delay_load = _cast(bool, delay_load) 5136 self.File_Name = File_Name 5137 self.Virtual_Address = Virtual_Address 5138 self.Imported_Functions = Imported_Functions
5139 - def factory(*args_, **kwargs_):
5140 if PEImportType.subclass: 5141 return PEImportType.subclass(*args_, **kwargs_) 5142 else: 5143 return PEImportType(*args_, **kwargs_)
5144 factory = staticmethod(factory)
5145 - def get_File_Name(self): return self.File_Name
5146 - def set_File_Name(self, File_Name): self.File_Name = File_Name
5147 - def get_Virtual_Address(self): return self.Virtual_Address
5148 - def set_Virtual_Address(self, Virtual_Address): self.Virtual_Address = Virtual_Address
5149 - def get_Imported_Functions(self): return self.Imported_Functions
5150 - def set_Imported_Functions(self, Imported_Functions): self.Imported_Functions = Imported_Functions
5151 - def get_type(self): return self.type_
5152 - def set_type(self, type_): self.type_ = type_
5153 - def get_delay_load(self): return self.delay_load
5154 - def set_delay_load(self, delay_load): self.delay_load = delay_load
5155 - def export(self, outfile, level, namespace_='maec:', name_='PEImportType', namespacedef_=''):
5156 showIndent(outfile, level) 5157 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5158 already_processed = [] 5159 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEImportType') 5160 if self.hasContent_(): 5161 outfile.write('>\n') 5162 self.exportChildren(outfile, level + 1, namespace_, name_) 5163 showIndent(outfile, level) 5164 outfile.write('</%s%s>\n' % (namespace_, name_)) 5165 else: 5166 outfile.write('/>\n')
5167 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEImportType'):
5168 if self.type_ is not None and 'type_' not in already_processed: 5169 already_processed.append('type_') 5170 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), )) 5171 if self.delay_load is not None and 'delay_load' not in already_processed: 5172 already_processed.append('delay_load') 5173 outfile.write(' delay_load="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.delay_load)), input_name='delay_load'))
5174 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEImportType', fromsubclass_=False):
5175 if self.File_Name is not None: 5176 showIndent(outfile, level) 5177 outfile.write('<%sFile_Name>%s</%sFile_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.File_Name).encode(ExternalEncoding), input_name='File_Name'), namespace_)) 5178 if self.Virtual_Address is not None: 5179 self.Virtual_Address.export(outfile, level, namespace_, name_='Virtual_Address') 5180 if self.Imported_Functions is not None: 5181 self.Imported_Functions.export(outfile, level, namespace_, name_='Imported_Functions')
5182 - def hasContent_(self):
5183 if ( 5184 self.File_Name is not None or 5185 self.Virtual_Address is not None or 5186 self.Imported_Functions is not None 5187 ): 5188 return True 5189 else: 5190 return False
5191 - def exportLiteral(self, outfile, level, name_='PEImportType'):
5192 level += 1 5193 self.exportLiteralAttributes(outfile, level, [], name_) 5194 if self.hasContent_(): 5195 self.exportLiteralChildren(outfile, level, name_)
5196 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5197 if self.type_ is not None and 'type_' not in already_processed: 5198 already_processed.append('type_') 5199 showIndent(outfile, level) 5200 outfile.write('type_ = "%s",\n' % (self.type_,)) 5201 if self.delay_load is not None and 'delay_load' not in already_processed: 5202 already_processed.append('delay_load') 5203 showIndent(outfile, level) 5204 outfile.write('delay_load = %s,\n' % (self.delay_load,))
5205 - def exportLiteralChildren(self, outfile, level, name_):
5206 if self.File_Name is not None: 5207 showIndent(outfile, level) 5208 outfile.write('File_Name=%s,\n' % quote_python(self.File_Name).encode(ExternalEncoding)) 5209 if self.Virtual_Address is not None: 5210 showIndent(outfile, level) 5211 outfile.write('Virtual_Address=model_.xs_hexBinary(\n') 5212 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address') 5213 showIndent(outfile, level) 5214 outfile.write('),\n') 5215 if self.Imported_Functions is not None: 5216 showIndent(outfile, level) 5217 outfile.write('Imported_Functions=model_.Imported_FunctionsType(\n') 5218 self.Imported_Functions.exportLiteral(outfile, level, name_='Imported_Functions') 5219 showIndent(outfile, level) 5220 outfile.write('),\n')
5221 - def build(self, node):
5222 self.buildAttributes(node, node.attrib, []) 5223 for child in node: 5224 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5225 self.buildChildren(child, node, nodeName_)
5226 - def buildAttributes(self, node, attrs, already_processed):
5227 value = find_attr_value_('type', node) 5228 if value is not None and 'type' not in already_processed: 5229 already_processed.append('type') 5230 self.type_ = value 5231 value = find_attr_value_('delay_load', node) 5232 if value is not None and 'delay_load' not in already_processed: 5233 already_processed.append('delay_load') 5234 if value in ('true', '1'): 5235 self.delay_load = True 5236 elif value in ('false', '0'): 5237 self.delay_load = False 5238 else: 5239 raise_parse_error(node, 'Bad boolean attribute')
5240 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5241 if nodeName_ == 'File_Name': 5242 File_Name_ = child_.text 5243 File_Name_ = self.gds_validate_string(File_Name_, node, 'File_Name') 5244 self.File_Name = File_Name_ 5245 elif nodeName_ == 'Virtual_Address': 5246 obj_ = xs_hexBinary.factory() 5247 obj_.build(child_) 5248 self.set_Virtual_Address(obj_) 5249 elif nodeName_ == 'Imported_Functions': 5250 obj_ = Imported_FunctionsType.factory() 5251 obj_.build(child_) 5252 self.set_Imported_Functions(obj_)
5253 # end class PEImportType 5254 5255
5256 -class PEExportType(GeneratedsSuper):
5257 """PEExportType is intended as container for the attributes relevant to 5258 PE binary exports.""" 5259 subclass = None 5260 superclass = None
5261 - def __init__(self, Function_Name=None, Entry_Point=None, Ordinal=None):
5262 self.Function_Name = Function_Name 5263 self.Entry_Point = Entry_Point 5264 self.Ordinal = Ordinal
5265 - def factory(*args_, **kwargs_):
5266 if PEExportType.subclass: 5267 return PEExportType.subclass(*args_, **kwargs_) 5268 else: 5269 return PEExportType(*args_, **kwargs_)
5270 factory = staticmethod(factory)
5271 - def get_Function_Name(self): return self.Function_Name
5272 - def set_Function_Name(self, Function_Name): self.Function_Name = Function_Name
5273 - def get_Entry_Point(self): return self.Entry_Point
5274 - def set_Entry_Point(self, Entry_Point): self.Entry_Point = Entry_Point
5275 - def get_Ordinal(self): return self.Ordinal
5276 - def set_Ordinal(self, Ordinal): self.Ordinal = Ordinal
5277 - def export(self, outfile, level, namespace_='maec:', name_='PEExportType', namespacedef_=''):
5278 showIndent(outfile, level) 5279 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5280 already_processed = [] 5281 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEExportType') 5282 if self.hasContent_(): 5283 outfile.write('>\n') 5284 self.exportChildren(outfile, level + 1, namespace_, name_) 5285 showIndent(outfile, level) 5286 outfile.write('</%s%s>\n' % (namespace_, name_)) 5287 else: 5288 outfile.write('/>\n')
5289 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEExportType'):
5290 pass
5291 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEExportType', fromsubclass_=False):
5292 if self.Function_Name is not None: 5293 showIndent(outfile, level) 5294 outfile.write('<%sFunction_Name>%s</%sFunction_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Function_Name).encode(ExternalEncoding), input_name='Function_Name'), namespace_)) 5295 if self.Entry_Point is not None: 5296 showIndent(outfile, level) 5297 outfile.write('<%sEntry_Point>%s</%sEntry_Point>\n' % (namespace_, self.gds_format_string(quote_xml(self.Entry_Point).encode(ExternalEncoding), input_name='Entry_Point'), namespace_)) 5298 if self.Ordinal is not None: 5299 showIndent(outfile, level) 5300 outfile.write('<%sOrdinal>%s</%sOrdinal>\n' % (namespace_, self.gds_format_integer(self.Ordinal, input_name='Ordinal'), namespace_))
5301 - def hasContent_(self):
5302 if ( 5303 self.Function_Name is not None or 5304 self.Entry_Point is not None or 5305 self.Ordinal is not None 5306 ): 5307 return True 5308 else: 5309 return False
5310 - def exportLiteral(self, outfile, level, name_='PEExportType'):
5311 level += 1 5312 self.exportLiteralAttributes(outfile, level, [], name_) 5313 if self.hasContent_(): 5314 self.exportLiteralChildren(outfile, level, name_)
5315 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5316 pass
5317 - def exportLiteralChildren(self, outfile, level, name_):
5318 if self.Function_Name is not None: 5319 showIndent(outfile, level) 5320 outfile.write('Function_Name=%s,\n' % quote_python(self.Function_Name).encode(ExternalEncoding)) 5321 if self.Entry_Point is not None: 5322 showIndent(outfile, level) 5323 outfile.write('Entry_Point=model_.xs_hexBinary(\n') 5324 self.Entry_Point.exportLiteral(outfile, level, name_='Entry_Point') 5325 showIndent(outfile, level) 5326 outfile.write('),\n') 5327 if self.Ordinal is not None: 5328 showIndent(outfile, level) 5329 outfile.write('Ordinal=%d,\n' % self.Ordinal)
5330 - def build(self, node):
5331 self.buildAttributes(node, node.attrib, []) 5332 for child in node: 5333 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5334 self.buildChildren(child, node, nodeName_)
5335 - def buildAttributes(self, node, attrs, already_processed):
5336 pass
5337 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5338 if nodeName_ == 'Function_Name': 5339 Function_Name_ = child_.text 5340 Function_Name_ = self.gds_validate_string(Function_Name_, node, 'Function_Name') 5341 self.Function_Name = Function_Name_ 5342 elif nodeName_ == 'Entry_Point': 5343 obj_ = xs_hexBinary.factory() 5344 obj_.build(child_) 5345 self.set_Entry_Point(obj_) 5346 elif nodeName_ == 'Ordinal': 5347 sval_ = child_.text 5348 try: 5349 ival_ = int(sval_) 5350 except (TypeError, ValueError) as e: 5351 raise_parse_error(child_, 'requires integer: %s' % e) 5352 ival_ = self.gds_validate_integer(ival_, node, 'Ordinal') 5353 self.Ordinal = ival_
5354 # end class PEExportType 5355 5356
5357 -class PESectionType(GeneratedsSuper):
5358 """PESectionType is intended as container for the attributes relevant 5359 to PE binary sections.""" 5360 subclass = None 5361 superclass = None
5362 - def __init__(self, Header_Hashes=None, Data_Hashes=None, Section_Name=None, Entropy=None, Virtual_Address=None, Virtual_Size=None, Flags=None, Relocations=None):
5363 self.Header_Hashes = Header_Hashes 5364 self.Data_Hashes = Data_Hashes 5365 self.Section_Name = Section_Name 5366 self.Entropy = Entropy 5367 self.Virtual_Address = Virtual_Address 5368 self.Virtual_Size = Virtual_Size 5369 self.Flags = Flags 5370 self.Relocations = Relocations
5371 - def factory(*args_, **kwargs_):
5372 if PESectionType.subclass: 5373 return PESectionType.subclass(*args_, **kwargs_) 5374 else: 5375 return PESectionType(*args_, **kwargs_)
5376 factory = staticmethod(factory)
5377 - def get_Header_Hashes(self): return self.Header_Hashes
5378 - def set_Header_Hashes(self, Header_Hashes): self.Header_Hashes = Header_Hashes
5379 - def get_Data_Hashes(self): return self.Data_Hashes
5380 - def set_Data_Hashes(self, Data_Hashes): self.Data_Hashes = Data_Hashes
5381 - def get_Section_Name(self): return self.Section_Name
5382 - def set_Section_Name(self, Section_Name): self.Section_Name = Section_Name
5383 - def get_Entropy(self): return self.Entropy
5384 - def set_Entropy(self, Entropy): self.Entropy = Entropy
5385 - def get_Virtual_Address(self): return self.Virtual_Address
5386 - def set_Virtual_Address(self, Virtual_Address): self.Virtual_Address = Virtual_Address
5387 - def get_Virtual_Size(self): return self.Virtual_Size
5388 - def set_Virtual_Size(self, Virtual_Size): self.Virtual_Size = Virtual_Size
5389 - def get_Flags(self): return self.Flags
5390 - def set_Flags(self, Flags): self.Flags = Flags
5391 - def get_Relocations(self): return self.Relocations
5392 - def set_Relocations(self, Relocations): self.Relocations = Relocations
5393 - def export(self, outfile, level, namespace_='maec:', name_='PESectionType', namespacedef_=''):
5394 showIndent(outfile, level) 5395 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5396 already_processed = [] 5397 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PESectionType') 5398 if self.hasContent_(): 5399 outfile.write('>\n') 5400 self.exportChildren(outfile, level + 1, namespace_, name_) 5401 showIndent(outfile, level) 5402 outfile.write('</%s%s>\n' % (namespace_, name_)) 5403 else: 5404 outfile.write('/>\n')
5405 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PESectionType'):
5406 pass
5407 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PESectionType', fromsubclass_=False):
5408 if self.Header_Hashes is not None: 5409 self.Header_Hashes.export(outfile, level, namespace_, name_='Header_Hashes') 5410 if self.Data_Hashes is not None: 5411 self.Data_Hashes.export(outfile, level, namespace_, name_='Data_Hashes') 5412 if self.Section_Name is not None: 5413 showIndent(outfile, level) 5414 outfile.write('<%sSection_Name>%s</%sSection_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Section_Name).encode(ExternalEncoding), input_name='Section_Name'), namespace_)) 5415 if self.Entropy is not None: 5416 showIndent(outfile, level) 5417 outfile.write('<%sEntropy>%s</%sEntropy>\n' % (namespace_, self.gds_format_float(self.Entropy, input_name='Entropy'), namespace_)) 5418 if self.Virtual_Address is not None: 5419 showIndent(outfile, level) 5420 outfile.write('<%sVirtual_Address>%s</%sVirtual_Address>\n' % (namespace_, self.gds_format_string(quote_xml(self.Virtual_Address).encode(ExternalEncoding), input_name='Virtual_Address'), namespace_)) 5421 if self.Virtual_Size is not None: 5422 showIndent(outfile, level) 5423 outfile.write('<%sVirtual_Size>%s</%sVirtual_Size>\n' % (namespace_, self.gds_format_integer(self.Virtual_Size, input_name='Virtual_Size'), namespace_)) 5424 if self.Flags is not None: 5425 self.Flags.export(outfile, level, namespace_, name_='Flags') 5426 if self.Relocations is not None: 5427 showIndent(outfile, level) 5428 outfile.write('<%sRelocations>%s</%sRelocations>\n' % (namespace_, self.gds_format_integer(self.Relocations, input_name='Relocations'), namespace_))
5429 - def hasContent_(self):
5430 if ( 5431 self.Header_Hashes is not None or 5432 self.Data_Hashes is not None or 5433 self.Section_Name is not None or 5434 self.Entropy is not None or 5435 self.Virtual_Address is not None or 5436 self.Virtual_Size is not None or 5437 self.Flags is not None or 5438 self.Relocations is not None 5439 ): 5440 return True 5441 else: 5442 return False
5443 - def exportLiteral(self, outfile, level, name_='PESectionType'):
5444 level += 1 5445 self.exportLiteralAttributes(outfile, level, [], name_) 5446 if self.hasContent_(): 5447 self.exportLiteralChildren(outfile, level, name_)
5448 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5449 pass
5450 - def exportLiteralChildren(self, outfile, level, name_):
5451 if self.Header_Hashes is not None: 5452 showIndent(outfile, level) 5453 outfile.write('Header_Hashes=model_.Header_HashesType(\n') 5454 self.Header_Hashes.exportLiteral(outfile, level, name_='Header_Hashes') 5455 showIndent(outfile, level) 5456 outfile.write('),\n') 5457 if self.Data_Hashes is not None: 5458 showIndent(outfile, level) 5459 outfile.write('Data_Hashes=model_.Data_HashesType(\n') 5460 self.Data_Hashes.exportLiteral(outfile, level, name_='Data_Hashes') 5461 showIndent(outfile, level) 5462 outfile.write('),\n') 5463 if self.Section_Name is not None: 5464 showIndent(outfile, level) 5465 outfile.write('Section_Name=%s,\n' % quote_python(self.Section_Name).encode(ExternalEncoding)) 5466 if self.Entropy is not None: 5467 showIndent(outfile, level) 5468 outfile.write('Entropy=%f,\n' % self.Entropy) 5469 if self.Virtual_Address is not None: 5470 showIndent(outfile, level) 5471 outfile.write('Virtual_Address=model_.xs_hexBinary(\n') 5472 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address') 5473 showIndent(outfile, level) 5474 outfile.write('),\n') 5475 if self.Virtual_Size is not None: 5476 showIndent(outfile, level) 5477 outfile.write('Virtual_Size=%d,\n' % self.Virtual_Size) 5478 if self.Flags is not None: 5479 showIndent(outfile, level) 5480 outfile.write('Flags=model_.xs_hexBinary(\n') 5481 self.Flags.exportLiteral(outfile, level, name_='Flags') 5482 showIndent(outfile, level) 5483 outfile.write('),\n') 5484 if self.Relocations is not None: 5485 showIndent(outfile, level) 5486 outfile.write('Relocations=%d,\n' % self.Relocations)
5487 - def build(self, node):
5488 self.buildAttributes(node, node.attrib, []) 5489 for child in node: 5490 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5491 self.buildChildren(child, node, nodeName_)
5492 - def buildAttributes(self, node, attrs, already_processed):
5493 pass
5494 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5495 if nodeName_ == 'Header_Hashes': 5496 obj_ = Header_HashesType.factory() 5497 obj_.build(child_) 5498 self.set_Header_Hashes(obj_) 5499 elif nodeName_ == 'Data_Hashes': 5500 obj_ = Data_HashesType.factory() 5501 obj_.build(child_) 5502 self.set_Data_Hashes(obj_) 5503 elif nodeName_ == 'Section_Name': 5504 Section_Name_ = child_.text 5505 Section_Name_ = self.gds_validate_string(Section_Name_, node, 'Section_Name') 5506 self.Section_Name = Section_Name_ 5507 elif nodeName_ == 'Entropy': 5508 sval_ = child_.text 5509 try: 5510 fval_ = float(sval_) 5511 except (TypeError, ValueError) as e: 5512 raise_parse_error(child_, 'requires float or double: %s' % e) 5513 fval_ = self.gds_validate_float(fval_, node, 'Entropy') 5514 self.Entropy = fval_ 5515 elif nodeName_ == 'Virtual_Address': 5516 obj_ = xs_hexBinary.factory() 5517 obj_.build(child_) 5518 self.set_Virtual_Address(obj_) 5519 elif nodeName_ == 'Virtual_Size': 5520 sval_ = child_.text 5521 try: 5522 ival_ = int(sval_) 5523 except (TypeError, ValueError) as e: 5524 raise_parse_error(child_, 'requires integer: %s' % e) 5525 ival_ = self.gds_validate_integer(ival_, node, 'Virtual_Size') 5526 self.Virtual_Size = ival_ 5527 elif nodeName_ == 'Flags': 5528 obj_ = xs_hexBinary.factory() 5529 obj_.build(child_) 5530 self.set_Flags(obj_) 5531 elif nodeName_ == 'Relocations': 5532 sval_ = child_.text 5533 try: 5534 ival_ = int(sval_) 5535 except (TypeError, ValueError) as e: 5536 raise_parse_error(child_, 'requires integer: %s' % e) 5537 ival_ = self.gds_validate_integer(ival_, node, 'Relocations') 5538 self.Relocations = ival_
5539 # end class PESectionType 5540 5541
5542 -class PEResourceType(GeneratedsSuper):
5543 """PEResourceType is intended as container for the attributes relevant 5544 to PE binary resources.The type attribute refers to the type of 5545 data referred to by this resource. Possible values are: Cursor, 5546 Bitmap, Icon, Menu, Dialog, String, Fontdir, Font, Accelerator, 5547 RCData, MessageTable, GroupCursor, GroupIcon, Version, 5548 DLGInclude, PlugPlay, Vxd, AniCursor, AniIcon, HTML, Manifest, 5549 Other.""" 5550 subclass = None 5551 superclass = None
5552 - def __init__(self, type_=None, Name=None, Hashes=None):
5553 self.type_ = _cast(None, type_) 5554 self.Name = Name 5555 self.Hashes = Hashes
5556 - def factory(*args_, **kwargs_):
5557 if PEResourceType.subclass: 5558 return PEResourceType.subclass(*args_, **kwargs_) 5559 else: 5560 return PEResourceType(*args_, **kwargs_)
5561 factory = staticmethod(factory)
5562 - def get_Name(self): return self.Name
5563 - def set_Name(self, Name): self.Name = Name
5564 - def get_Hashes(self): return self.Hashes
5565 - def set_Hashes(self, Hashes): self.Hashes = Hashes
5566 - def get_type(self): return self.type_
5567 - def set_type(self, type_): self.type_ = type_
5568 - def export(self, outfile, level, namespace_='maec:', name_='PEResourceType', namespacedef_=''):
5569 showIndent(outfile, level) 5570 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5571 already_processed = [] 5572 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEResourceType') 5573 if self.hasContent_(): 5574 outfile.write('>\n') 5575 self.exportChildren(outfile, level + 1, namespace_, name_) 5576 showIndent(outfile, level) 5577 outfile.write('</%s%s>\n' % (namespace_, name_)) 5578 else: 5579 outfile.write('/>\n')
5580 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEResourceType'):
5581 if self.type_ is not None and 'type_' not in already_processed: 5582 already_processed.append('type_') 5583 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
5584 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEResourceType', fromsubclass_=False):
5585 if self.Name is not None: 5586 showIndent(outfile, level) 5587 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) 5588 if self.Hashes is not None: 5589 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
5590 - def hasContent_(self):
5591 if ( 5592 self.Name is not None or 5593 self.Hashes is not None 5594 ): 5595 return True 5596 else: 5597 return False
5598 - def exportLiteral(self, outfile, level, name_='PEResourceType'):
5599 level += 1 5600 self.exportLiteralAttributes(outfile, level, [], name_) 5601 if self.hasContent_(): 5602 self.exportLiteralChildren(outfile, level, name_)
5603 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5604 if self.type_ is not None and 'type_' not in already_processed: 5605 already_processed.append('type_') 5606 showIndent(outfile, level) 5607 outfile.write('type_ = "%s",\n' % (self.type_,))
5608 - def exportLiteralChildren(self, outfile, level, name_):
5609 if self.Name is not None: 5610 showIndent(outfile, level) 5611 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) 5612 if self.Hashes is not None: 5613 showIndent(outfile, level) 5614 outfile.write('Hashes=model_.HashesType7(\n') 5615 self.Hashes.exportLiteral(outfile, level, name_='Hashes') 5616 showIndent(outfile, level) 5617 outfile.write('),\n')
5618 - def build(self, node):
5619 self.buildAttributes(node, node.attrib, []) 5620 for child in node: 5621 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5622 self.buildChildren(child, node, nodeName_)
5623 - def buildAttributes(self, node, attrs, already_processed):
5624 value = find_attr_value_('type', node) 5625 if value is not None and 'type' not in already_processed: 5626 already_processed.append('type') 5627 self.type_ = value
5628 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5629 if nodeName_ == 'Name': 5630 Name_ = child_.text 5631 Name_ = self.gds_validate_string(Name_, node, 'Name') 5632 self.Name = Name_ 5633 elif nodeName_ == 'Hashes': 5634 obj_ = HashesType7.factory() 5635 obj_.build(child_) 5636 self.set_Hashes(obj_)
5637 # end class PEResourceType 5638 5639
5640 -class malwareMetaData(GeneratedsSuper):
5641 """This is the top level element for the xml document. Required 5642 attribute is version. Open issues: 2. Right way to express 5643 commonality in field data so that it can be combined properly 3. 5644 How to handle unicode in urls Change list 11/12/2009 1. adding 5645 documentation across the schema 2. added partner to 5646 OriginTypeEnum 3. made sha1 in fileObject optional 4. added 5647 isDamaged as a propertyType 5. changed property name isNon- 5648 replicating to isNonReplicating 6/11/2009 1. incremented version 5649 2.Rename parents/children in relationship to source/target 3. 5650 Add generic relationship, ‘relatedTo’ 4. Make commonality 5651 element in fieldDataEntry optional 5. Add unknown element to 5652 origintypeenum 6. Remove ipv4 and ipv6 from locationenum 7. Make 5653 id on ip object startaddress-endaddress even if startaddress == 5654 endaddress. Added IPRange type 8. Add optional firstSeenDate to 5655 fieldDataEntry, for first time entity providing data saw the 5656 object 6/4/2009 1. File - id should be a xs:hexBinary 2. File - 5657 extraHash should be a xs:string 3. Uri – add optional 5658 ipProtocol field, with enumeration of values tcp/udp/icmp etc. 5659 4. Uri – add documentation that protocol in uri needs to be 5660 either from well known list (from iana.org) or ‘unknown’ 5. 5661 Domain - need to fix documentation for domain – example is 5662 wrong 6. registry – remove valuedata – it is in a property 5663 7. ip object – rename to ip, and give it a start address and 5664 end address. Share a single address by making start and end the 5665 same. Id will be address or startaddress-endaddress 8. service 5666 – delete – subsumed by uri with extra data elements in it 9. 5667 classification – remove modifiers (attributes) on category and 5668 put in properties 10. classification – add documentation that 5669 category is companyname:category 11. objectProperty – move 5670 timestamp to be top level instead of on each property and make 5671 it required 12. relationship – make timestamp required 13. 5672 relationship – add doc on runs. removed 'exploits' - it refers 5673 to environment object that no longer exists 14. added comment 5674 field to propertyenum 15. made timeStamp -> timestamp for 5675 consistency 16.incremented version 5/31/2009 1. incremented 5676 version 2. changed url to uri 3. removed environment object and 5677 related enumerations 4. added restriction on uri to not allow a 5678 question mark (?) 5/15/2009 1. incremented version 2. Added 5679 neutral classification type 3. Added numberOfWebsitesHosting and 5680 numberOfWebsitesRedirecting to volume units enumeration 4. added 5681 referrer, operatingSystem, userAgent and browser to properties 5682 5. made classification type attribute required 5/8/2009 1. added 5683 new object type for asn 2. moved domain information to 5684 properties, so that domains info can be timestamped 3. added 5685 properties for geolocation of an ip address 4. added property 5686 for location url for a file 5. added VolumeUnitsEnum and volume 5687 tag in fieldData. This is to allow sharing of actual prevalence 5688 numbers, with various units. 6. Added ipProtocol (tcp/udp) to 5689 service object. Also changed names of expectedProtocol and 5690 actualProtocol to be expectedApplicationProtocol and 5691 actualApplicationProtocol 7. added 'references' surrounding tag 5692 to ref tag in fieldDataEntry and objectProperty, so that can 5693 assign multiple references if required 8. made id on file back 5694 to hexBinary. Use length to figure out what hash it is. 9. 5695 incremented version 10. added properties for httpMethod and 5696 postData 11. added relationship types 'contactedBy' and 5697 'downloadedFrom' 4/17/2009 1. Incremented version 2. Added 5698 unwanted to ClassificationTypeEnum 3. Added text about ids for 5699 files to documentation 4. Removed filename from file object 5700 definition 5. Relaxed requirement on id of file to be an 5701 xs:hexString to be an xs:string to allow e.g. md5:aaaaabbbbccc 5702 as an id. Not enormously happy about that… 6. Made sha256 5703 optional and sha1 required in files 7. Added “open issues” 5704 section in documentation for top level element 8. Category is 5705 now an xs:string; deleted CategoryTypeEnum 9. Added comment to 5706 doc on fieldDataEntry about using standard time periods, but 5707 kept start date and end date 10. Added objectProperties element, 5708 and example illustratingProperties.xml. Currently allowed 5709 properties are filename, filepath, registryValueData and 5710 urlParameterString. There is an optional timestamp on each 5711 property. I allowed objectProperty to have an id, so that it can 5712 be referenced elsewhere, although we might want to re-think 5713 that. 11. Added some better documentation to relationships 12. 5714 Added more documentation throughout The version of the schema. 5715 This is currently fixed to be 1.1. A required identifier for the 5716 document.""" 5717 subclass = None 5718 superclass = None
5719 - def __init__(self, version=None, id=None, company=None, author=None, comment=None, timestamp=None, objects=None, objectProperties=None, relationships=None, fieldData=None):
5720 self.version = _cast(float, version) 5721 self.id = _cast(None, id) 5722 self.company = company 5723 self.author = author 5724 self.comment = comment 5725 self.timestamp = timestamp 5726 self.objects = objects 5727 self.objectProperties = objectProperties 5728 self.relationships = relationships 5729 self.fieldData = fieldData
5730 - def factory(*args_, **kwargs_):
5731 if malwareMetaData.subclass: 5732 return malwareMetaData.subclass(*args_, **kwargs_) 5733 else: 5734 return malwareMetaData(*args_, **kwargs_)
5735 factory = staticmethod(factory)
5736 - def get_company(self): return self.company
5737 - def set_company(self, company): self.company = company
5738 - def get_author(self): return self.author
5739 - def set_author(self, author): self.author = author
5740 - def get_comment(self): return self.comment
5741 - def set_comment(self, comment): self.comment = comment
5742 - def get_timestamp(self): return self.timestamp
5743 - def set_timestamp(self, timestamp): self.timestamp = timestamp
5744 - def get_objects(self): return self.objects
5745 - def set_objects(self, objects): self.objects = objects
5746 - def get_objectProperties(self): return self.objectProperties
5747 - def set_objectProperties(self, objectProperties): self.objectProperties = objectProperties
5748 - def get_relationships(self): return self.relationships
5749 - def set_relationships(self, relationships): self.relationships = relationships
5750 - def get_fieldData(self): return self.fieldData
5751 - def set_fieldData(self, fieldData): self.fieldData = fieldData
5752 - def get_version(self): return self.version
5753 - def set_version(self, version): self.version = version
5754 - def get_id(self): return self.id
5755 - def set_id(self, id): self.id = id
5756 - def export(self, outfile, level, namespace_='maec:', name_='malwareMetaData', namespacedef_=''):
5757 showIndent(outfile, level) 5758 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5759 already_processed = [] 5760 self.exportAttributes(outfile, level, already_processed, namespace_, name_='malwareMetaData') 5761 if self.hasContent_(): 5762 outfile.write('>\n') 5763 self.exportChildren(outfile, level + 1, namespace_, name_) 5764 showIndent(outfile, level) 5765 outfile.write('</%s%s>\n' % (namespace_, name_)) 5766 else: 5767 outfile.write('/>\n')
5768 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='malwareMetaData'):
5769 if self.version is not None and 'version' not in already_processed: 5770 already_processed.append('version') 5771 outfile.write(' version="%s"' % self.gds_format_float(self.version, input_name='version')) 5772 if self.id is not None and 'id' not in already_processed: 5773 already_processed.append('id') 5774 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
5775 - def exportChildren(self, outfile, level, namespace_='maec:', name_='malwareMetaData', fromsubclass_=False):
5776 if self.company is not None: 5777 showIndent(outfile, level) 5778 outfile.write('<%scompany>%s</%scompany>\n' % (namespace_, self.gds_format_string(quote_xml(self.company).encode(ExternalEncoding), input_name='company'), namespace_)) 5779 if self.author is not None: 5780 showIndent(outfile, level) 5781 outfile.write('<%sauthor>%s</%sauthor>\n' % (namespace_, self.gds_format_string(quote_xml(self.author).encode(ExternalEncoding), input_name='author'), namespace_)) 5782 if self.comment is not None: 5783 showIndent(outfile, level) 5784 outfile.write('<%scomment>%s</%scomment>\n' % (namespace_, self.gds_format_string(quote_xml(self.comment).encode(ExternalEncoding), input_name='comment'), namespace_)) 5785 if self.timestamp is not None: 5786 showIndent(outfile, level) 5787 outfile.write('<%stimestamp>%s</%stimestamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.timestamp).encode(ExternalEncoding), input_name='timestamp'), namespace_)) 5788 if self.objects is not None: 5789 self.objects.export(outfile, level, namespace_, name_='objects') 5790 if self.objectProperties is not None: 5791 self.objectProperties.export(outfile, level, namespace_, name_='objectProperties') 5792 if self.relationships is not None: 5793 self.relationships.export(outfile, level, namespace_, name_='relationships') 5794 if self.fieldData is not None: 5795 self.fieldData.export(outfile, level, namespace_, name_='fieldData')
5796 - def hasContent_(self):
5797 if ( 5798 self.company is not None or 5799 self.author is not None or 5800 self.comment is not None or 5801 self.timestamp is not None or 5802 self.objects is not None or 5803 self.objectProperties is not None or 5804 self.relationships is not None or 5805 self.fieldData is not None 5806 ): 5807 return True 5808 else: 5809 return False
5810 - def exportLiteral(self, outfile, level, name_='malwareMetaData'):
5811 level += 1 5812 self.exportLiteralAttributes(outfile, level, [], name_) 5813 if self.hasContent_(): 5814 self.exportLiteralChildren(outfile, level, name_)
5815 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
5816 if self.version is not None and 'version' not in already_processed: 5817 already_processed.append('version') 5818 showIndent(outfile, level) 5819 outfile.write('version = %f,\n' % (self.version,)) 5820 if self.id is not None and 'id' not in already_processed: 5821 already_processed.append('id') 5822 showIndent(outfile, level) 5823 outfile.write('id = "%s",\n' % (self.id,))
5824 - def exportLiteralChildren(self, outfile, level, name_):
5825 if self.company is not None: 5826 showIndent(outfile, level) 5827 outfile.write('company=%s,\n' % quote_python(self.company).encode(ExternalEncoding)) 5828 if self.author is not None: 5829 showIndent(outfile, level) 5830 outfile.write('author=%s,\n' % quote_python(self.author).encode(ExternalEncoding)) 5831 if self.comment is not None: 5832 showIndent(outfile, level) 5833 outfile.write('comment=%s,\n' % quote_python(self.comment).encode(ExternalEncoding)) 5834 if self.timestamp is not None: 5835 showIndent(outfile, level) 5836 outfile.write('timestamp=%s,\n' % quote_python(self.timestamp).encode(ExternalEncoding)) 5837 if self.objects is not None: 5838 showIndent(outfile, level) 5839 outfile.write('objects=model_.objectsType(\n') 5840 self.objects.exportLiteral(outfile, level, name_='objects') 5841 showIndent(outfile, level) 5842 outfile.write('),\n') 5843 if self.objectProperties is not None: 5844 showIndent(outfile, level) 5845 outfile.write('objectProperties=model_.objectPropertiesType(\n') 5846 self.objectProperties.exportLiteral(outfile, level, name_='objectProperties') 5847 showIndent(outfile, level) 5848 outfile.write('),\n') 5849 if self.relationships is not None: 5850 showIndent(outfile, level) 5851 outfile.write('relationships=model_.relationshipsType(\n') 5852 self.relationships.exportLiteral(outfile, level, name_='relationships') 5853 showIndent(outfile, level) 5854 outfile.write('),\n') 5855 if self.fieldData is not None: 5856 showIndent(outfile, level) 5857 outfile.write('fieldData=model_.fieldDataType(\n') 5858 self.fieldData.exportLiteral(outfile, level, name_='fieldData') 5859 showIndent(outfile, level) 5860 outfile.write('),\n')
5861 - def build(self, node):
5862 self.buildAttributes(node, node.attrib, []) 5863 for child in node: 5864 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 5865 self.buildChildren(child, node, nodeName_)
5866 - def buildAttributes(self, node, attrs, already_processed):
5867 value = find_attr_value_('version', node) 5868 if value is not None and 'version' not in already_processed: 5869 already_processed.append('version') 5870 try: 5871 self.version = float(value) 5872 except ValueError as e: 5873 raise ValueError('Bad float/double attribute (version): %s' % e) 5874 value = find_attr_value_('id', node) 5875 if value is not None and 'id' not in already_processed: 5876 already_processed.append('id') 5877 self.id = value
5878 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5879 if nodeName_ == 'company': 5880 company_ = child_.text 5881 company_ = self.gds_validate_string(company_, node, 'company') 5882 self.company = company_ 5883 elif nodeName_ == 'author': 5884 author_ = child_.text 5885 author_ = self.gds_validate_string(author_, node, 'author') 5886 self.author = author_ 5887 elif nodeName_ == 'comment': 5888 comment_ = child_.text 5889 comment_ = self.gds_validate_string(comment_, node, 'comment') 5890 self.comment = comment_ 5891 elif nodeName_ == 'timestamp': 5892 timestamp_ = child_.text 5893 timestamp_ = self.gds_validate_string(timestamp_, node, 'timestamp') 5894 self.timestamp = timestamp_ 5895 elif nodeName_ == 'objects': 5896 obj_ = objectsType.factory() 5897 obj_.build(child_) 5898 self.set_objects(obj_) 5899 elif nodeName_ == 'objectProperties': 5900 obj_ = objectPropertiesType.factory() 5901 obj_.build(child_) 5902 self.set_objectProperties(obj_) 5903 elif nodeName_ == 'relationships': 5904 obj_ = relationshipsType.factory() 5905 obj_.build(child_) 5906 self.set_relationships(obj_) 5907 elif nodeName_ == 'fieldData': 5908 obj_ = fieldDataType.factory() 5909 obj_.build(child_) 5910 self.set_fieldData(obj_)
5911 # end class malwareMetaData 5912 5913
5914 -class fileObject(GeneratedsSuper):
5915 """Object definition for files. The required attribute is the id, which 5916 needs to be globally unique. By convention, the value used is a 5917 hash, the stronger the better. The choice should be: use sha256 5918 if you have it, if not use sha1, if not use md5. Other hashes 5919 and file sizes are recorded in the elements. File names are put 5920 in as properties.""" 5921 subclass = None 5922 superclass = None
5923 - def __init__(self, id=None, md5=None, sha1=None, sha256=None, sha512=None, size=None, crc32=None, fileType=None, extraHash=None):
5924 self.id = _cast(None, id) 5925 self.md5 = md5 5926 self.sha1 = sha1 5927 self.sha256 = sha256 5928 self.sha512 = sha512 5929 self.size = size 5930 self.crc32 = crc32 5931 if fileType is None: 5932 self.fileType = [] 5933 else: 5934 self.fileType = fileType 5935 if extraHash is None: 5936 self.extraHash = [] 5937 else: 5938 self.extraHash = extraHash
5939 - def factory(*args_, **kwargs_):
5940 if fileObject.subclass: 5941 return fileObject.subclass(*args_, **kwargs_) 5942 else: 5943 return fileObject(*args_, **kwargs_)
5944 factory = staticmethod(factory)
5945 - def get_md5(self): return self.md5
5946 - def set_md5(self, md5): self.md5 = md5
5947 - def get_sha1(self): return self.sha1
5948 - def set_sha1(self, sha1): self.sha1 = sha1
5949 - def get_sha256(self): return self.sha256
5950 - def set_sha256(self, sha256): self.sha256 = sha256
5951 - def get_sha512(self): return self.sha512
5952 - def set_sha512(self, sha512): self.sha512 = sha512
5953 - def get_size(self): return self.size
5954 - def set_size(self, size): self.size = size
5955 - def get_crc32(self): return self.crc32
5956 - def set_crc32(self, crc32): self.crc32 = crc32
5957 - def get_fileType(self): return self.fileType
5958 - def set_fileType(self, fileType): self.fileType = fileType
5959 - def add_fileType(self, value): self.fileType.append(value)
5960 - def insert_fileType(self, index, value): self.fileType[index] = value
5961 - def get_extraHash(self): return self.extraHash
5962 - def set_extraHash(self, extraHash): self.extraHash = extraHash
5963 - def add_extraHash(self, value): self.extraHash.append(value)
5964 - def insert_extraHash(self, index, value): self.extraHash[index] = value
5965 - def get_id(self): return self.id
5966 - def set_id(self, id): self.id = id
5967 - def export(self, outfile, level, namespace_='maec:', name_='fileObject', namespacedef_=''):
5968 showIndent(outfile, level) 5969 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 5970 already_processed = [] 5971 self.exportAttributes(outfile, level, already_processed, namespace_, name_='fileObject') 5972 if self.hasContent_(): 5973 outfile.write('>\n') 5974 self.exportChildren(outfile, level + 1, namespace_, name_) 5975 showIndent(outfile, level) 5976 outfile.write('</%s%s>\n' % (namespace_, name_)) 5977 else: 5978 outfile.write('/>\n')
5979 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='fileObject'):
5980 if self.id is not None and 'id' not in already_processed: 5981 already_processed.append('id') 5982 outfile.write(' id=%s' % (quote_attrib(self.id), ))
5983 - def exportChildren(self, outfile, level, namespace_='maec:', name_='fileObject', fromsubclass_=False):
5984 if self.md5 is not None: 5985 showIndent(outfile, level) 5986 outfile.write('<%smd5>%s</%smd5>\n' % (namespace_, self.gds_format_string(quote_xml(self.md5).encode(ExternalEncoding), input_name='md5'), namespace_)) 5987 if self.sha1 is not None: 5988 showIndent(outfile, level) 5989 outfile.write('<%ssha1>%s</%ssha1>\n' % (namespace_, self.gds_format_string(quote_xml(self.sha1).encode(ExternalEncoding), input_name='sha1'), namespace_)) 5990 if self.sha256 is not None: 5991 showIndent(outfile, level) 5992 outfile.write('<%ssha256>%s</%ssha256>\n' % (namespace_, self.gds_format_string(quote_xml(self.sha256).encode(ExternalEncoding), input_name='sha256'), namespace_)) 5993 if self.sha512 is not None: 5994 showIndent(outfile, level) 5995 outfile.write('<%ssha512>%s</%ssha512>\n' % (namespace_, self.gds_format_string(quote_xml(self.sha512).encode(ExternalEncoding), input_name='sha512'), namespace_)) 5996 if self.size is not None: 5997 showIndent(outfile, level) 5998 outfile.write('<%ssize>%s</%ssize>\n' % (namespace_, self.gds_format_integer(self.size, input_name='size'), namespace_)) 5999 if self.crc32 is not None: 6000 showIndent(outfile, level) 6001 outfile.write('<%scrc32>%s</%scrc32>\n' % (namespace_, self.gds_format_string(quote_xml(self.crc32).encode(ExternalEncoding), input_name='crc32'), namespace_)) 6002 for fileType_ in self.fileType: 6003 showIndent(outfile, level) 6004 outfile.write('<%sfileType>%s</%sfileType>\n' % (namespace_, self.gds_format_string(quote_xml(fileType_).encode(ExternalEncoding), input_name='fileType'), namespace_)) 6005 for extraHash_ in self.extraHash: 6006 extraHash_.export(outfile, level, namespace_, name_='extraHash')
6007 - def hasContent_(self):
6008 if ( 6009 self.md5 is not None or 6010 self.sha1 is not None or 6011 self.sha256 is not None or 6012 self.sha512 is not None or 6013 self.size is not None or 6014 self.crc32 is not None or 6015 self.fileType or 6016 self.extraHash 6017 ): 6018 return True 6019 else: 6020 return False
6021 - def exportLiteral(self, outfile, level, name_='fileObject'):
6022 level += 1 6023 self.exportLiteralAttributes(outfile, level, [], name_) 6024 if self.hasContent_(): 6025 self.exportLiteralChildren(outfile, level, name_)
6026 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6027 if self.id is not None and 'id' not in already_processed: 6028 already_processed.append('id') 6029 showIndent(outfile, level) 6030 outfile.write('id = %s,\n' % (self.id,))
6031 - def exportLiteralChildren(self, outfile, level, name_):
6032 if self.md5 is not None: 6033 showIndent(outfile, level) 6034 outfile.write('md5=model_.xs_hexBinary(\n') 6035 self.md5.exportLiteral(outfile, level, name_='md5') 6036 showIndent(outfile, level) 6037 outfile.write('),\n') 6038 if self.sha1 is not None: 6039 showIndent(outfile, level) 6040 outfile.write('sha1=model_.xs_hexBinary(\n') 6041 self.sha1.exportLiteral(outfile, level, name_='sha1') 6042 showIndent(outfile, level) 6043 outfile.write('),\n') 6044 if self.sha256 is not None: 6045 showIndent(outfile, level) 6046 outfile.write('sha256=model_.xs_hexBinary(\n') 6047 self.sha256.exportLiteral(outfile, level, name_='sha256') 6048 showIndent(outfile, level) 6049 outfile.write('),\n') 6050 if self.sha512 is not None: 6051 showIndent(outfile, level) 6052 outfile.write('sha512=model_.xs_hexBinary(\n') 6053 self.sha512.exportLiteral(outfile, level, name_='sha512') 6054 showIndent(outfile, level) 6055 outfile.write('),\n') 6056 if self.size is not None: 6057 showIndent(outfile, level) 6058 outfile.write('size=%d,\n' % self.size) 6059 if self.crc32 is not None: 6060 showIndent(outfile, level) 6061 outfile.write('crc32=%s,\n' % quote_python(self.crc32).encode(ExternalEncoding)) 6062 showIndent(outfile, level) 6063 outfile.write('fileType=[\n') 6064 level += 1 6065 for fileType_ in self.fileType: 6066 showIndent(outfile, level) 6067 outfile.write('%s,\n' % quote_python(fileType_).encode(ExternalEncoding)) 6068 level -= 1 6069 showIndent(outfile, level) 6070 outfile.write('],\n') 6071 showIndent(outfile, level) 6072 outfile.write('extraHash=[\n') 6073 level += 1 6074 for extraHash_ in self.extraHash: 6075 showIndent(outfile, level) 6076 outfile.write('model_.extraHashType(\n') 6077 extraHash_.exportLiteral(outfile, level, name_='extraHashType') 6078 showIndent(outfile, level) 6079 outfile.write('),\n') 6080 level -= 1 6081 showIndent(outfile, level) 6082 outfile.write('],\n')
6083 - def build(self, node):
6084 self.buildAttributes(node, node.attrib, []) 6085 for child in node: 6086 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6087 self.buildChildren(child, node, nodeName_)
6088 - def buildAttributes(self, node, attrs, already_processed):
6089 value = find_attr_value_('id', node) 6090 if value is not None and 'id' not in already_processed: 6091 already_processed.append('id') 6092 self.id = value
6093 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6094 if nodeName_ == 'md5': 6095 obj_ = xs_hexBinary.factory() 6096 obj_.build(child_) 6097 self.set_md5(obj_) 6098 elif nodeName_ == 'sha1': 6099 obj_ = xs_hexBinary.factory() 6100 obj_.build(child_) 6101 self.set_sha1(obj_) 6102 elif nodeName_ == 'sha256': 6103 obj_ = xs_hexBinary.factory() 6104 obj_.build(child_) 6105 self.set_sha256(obj_) 6106 elif nodeName_ == 'sha512': 6107 obj_ = xs_hexBinary.factory() 6108 obj_.build(child_) 6109 self.set_sha512(obj_) 6110 elif nodeName_ == 'size': 6111 sval_ = child_.text 6112 try: 6113 ival_ = int(sval_) 6114 except (TypeError, ValueError) as e: 6115 raise_parse_error(child_, 'requires integer: %s' % e) 6116 ival_ = self.gds_validate_integer(ival_, node, 'size') 6117 self.size = ival_ 6118 elif nodeName_ == 'crc32': 6119 crc32_ = child_.text 6120 crc32_ = self.gds_validate_string(crc32_, node, 'crc32') 6121 self.crc32 = crc32_ 6122 elif nodeName_ == 'fileType': 6123 fileType_ = child_.text 6124 fileType_ = self.gds_validate_string(fileType_, node, 'fileType') 6125 self.fileType.append(fileType_) 6126 elif nodeName_ == 'extraHash': 6127 obj_ = extraHashType.factory() 6128 obj_.build(child_) 6129 self.extraHash.append(obj_)
6130 # end class fileObject 6131 6132
6133 -class registryObject(GeneratedsSuper):
6134 """Registry object. The required attribute is 'id', which is taken to 6135 be key\\valueName. Keys end in a \, value names start with a \, 6136 so you have e.g. key = 6137 hklm\software\microsoft\currentversion\windows\run\ value =\foo 6138 making the id 6139 hklm\software\microsoft\currentversion\windows\run\\foo""" 6140 subclass = None 6141 superclass = None
6142 - def __init__(self, id=None, key=None, valueName=None):
6143 self.id = _cast(None, id) 6144 self.key = key 6145 self.valueName = valueName
6146 - def factory(*args_, **kwargs_):
6147 if registryObject.subclass: 6148 return registryObject.subclass(*args_, **kwargs_) 6149 else: 6150 return registryObject(*args_, **kwargs_)
6151 factory = staticmethod(factory)
6152 - def get_key(self): return self.key
6153 - def set_key(self, key): self.key = key
6154 - def get_valueName(self): return self.valueName
6155 - def set_valueName(self, valueName): self.valueName = valueName
6156 - def get_id(self): return self.id
6157 - def set_id(self, id): self.id = id
6158 - def export(self, outfile, level, namespace_='maec:', name_='registryObject', namespacedef_=''):
6159 showIndent(outfile, level) 6160 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6161 already_processed = [] 6162 self.exportAttributes(outfile, level, already_processed, namespace_, name_='registryObject') 6163 if self.hasContent_(): 6164 outfile.write('>\n') 6165 self.exportChildren(outfile, level + 1, namespace_, name_) 6166 showIndent(outfile, level) 6167 outfile.write('</%s%s>\n' % (namespace_, name_)) 6168 else: 6169 outfile.write('/>\n')
6170 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='registryObject'):
6171 if self.id is not None and 'id' not in already_processed: 6172 already_processed.append('id') 6173 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
6174 - def exportChildren(self, outfile, level, namespace_='maec:', name_='registryObject', fromsubclass_=False):
6175 if self.key is not None: 6176 showIndent(outfile, level) 6177 outfile.write('<%skey>%s</%skey>\n' % (namespace_, self.gds_format_string(quote_xml(self.key).encode(ExternalEncoding), input_name='key'), namespace_)) 6178 if self.valueName is not None: 6179 showIndent(outfile, level) 6180 outfile.write('<%svalueName>%s</%svalueName>\n' % (namespace_, self.gds_format_string(quote_xml(self.valueName).encode(ExternalEncoding), input_name='valueName'), namespace_))
6181 - def hasContent_(self):
6182 if ( 6183 self.key is not None or 6184 self.valueName is not None 6185 ): 6186 return True 6187 else: 6188 return False
6189 - def exportLiteral(self, outfile, level, name_='registryObject'):
6190 level += 1 6191 self.exportLiteralAttributes(outfile, level, [], name_) 6192 if self.hasContent_(): 6193 self.exportLiteralChildren(outfile, level, name_)
6194 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6195 if self.id is not None and 'id' not in already_processed: 6196 already_processed.append('id') 6197 showIndent(outfile, level) 6198 outfile.write('id = "%s",\n' % (self.id,))
6199 - def exportLiteralChildren(self, outfile, level, name_):
6200 if self.key is not None: 6201 showIndent(outfile, level) 6202 outfile.write('key=%s,\n' % quote_python(self.key).encode(ExternalEncoding)) 6203 if self.valueName is not None: 6204 showIndent(outfile, level) 6205 outfile.write('valueName=%s,\n' % quote_python(self.valueName).encode(ExternalEncoding))
6206 - def build(self, node):
6207 self.buildAttributes(node, node.attrib, []) 6208 for child in node: 6209 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6210 self.buildChildren(child, node, nodeName_)
6211 - def buildAttributes(self, node, attrs, already_processed):
6212 value = find_attr_value_('id', node) 6213 if value is not None and 'id' not in already_processed: 6214 already_processed.append('id') 6215 self.id = value
6216 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6217 if nodeName_ == 'key': 6218 key_ = child_.text 6219 key_ = self.gds_validate_string(key_, node, 'key') 6220 self.key = key_ 6221 elif nodeName_ == 'valueName': 6222 valueName_ = child_.text 6223 valueName_ = self.gds_validate_string(valueName_, node, 'valueName') 6224 self.valueName = valueName_
6225 # end class registryObject 6226 6227
6228 -class entityObject(GeneratedsSuper):
6229 """Entity Object. This is used to record groups, companies etc., and 6230 departments within organizations. The globally unique id 6231 (attribute) should be constructed from the company and 6232 department name, e.g. "Company name:Department name", 6233 "Mcafee:AVERT labs", or "Russian Business Network".""" 6234 subclass = None 6235 superclass = None
6236 - def __init__(self, id=None, name=None):
6237 self.id = _cast(None, id) 6238 self.name = name
6239 - def factory(*args_, **kwargs_):
6240 if entityObject.subclass: 6241 return entityObject.subclass(*args_, **kwargs_) 6242 else: 6243 return entityObject(*args_, **kwargs_)
6244 factory = staticmethod(factory)
6245 - def get_name(self): return self.name
6246 - def set_name(self, name): self.name = name
6247 - def get_id(self): return self.id
6248 - def set_id(self, id): self.id = id
6249 - def export(self, outfile, level, namespace_='maec:', name_='entityObject', namespacedef_=''):
6250 showIndent(outfile, level) 6251 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6252 already_processed = [] 6253 self.exportAttributes(outfile, level, already_processed, namespace_, name_='entityObject') 6254 if self.hasContent_(): 6255 outfile.write('>\n') 6256 self.exportChildren(outfile, level + 1, namespace_, name_) 6257 showIndent(outfile, level) 6258 outfile.write('</%s%s>\n' % (namespace_, name_)) 6259 else: 6260 outfile.write('/>\n')
6261 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='entityObject'):
6262 if self.id is not None and 'id' not in already_processed: 6263 already_processed.append('id') 6264 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
6265 - def exportChildren(self, outfile, level, namespace_='maec:', name_='entityObject', fromsubclass_=False):
6266 if self.name is not None: 6267 showIndent(outfile, level) 6268 outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
6269 - def hasContent_(self):
6270 if ( 6271 self.name is not None 6272 ): 6273 return True 6274 else: 6275 return False
6276 - def exportLiteral(self, outfile, level, name_='entityObject'):
6277 level += 1 6278 self.exportLiteralAttributes(outfile, level, [], name_) 6279 if self.hasContent_(): 6280 self.exportLiteralChildren(outfile, level, name_)
6281 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6282 if self.id is not None and 'id' not in already_processed: 6283 already_processed.append('id') 6284 showIndent(outfile, level) 6285 outfile.write('id = "%s",\n' % (self.id,))
6286 - def exportLiteralChildren(self, outfile, level, name_):
6287 if self.name is not None: 6288 showIndent(outfile, level) 6289 outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
6290 - def build(self, node):
6291 self.buildAttributes(node, node.attrib, []) 6292 for child in node: 6293 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6294 self.buildChildren(child, node, nodeName_)
6295 - def buildAttributes(self, node, attrs, already_processed):
6296 value = find_attr_value_('id', node) 6297 if value is not None and 'id' not in already_processed: 6298 already_processed.append('id') 6299 self.id = value
6300 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6301 if nodeName_ == 'name': 6302 name_ = child_.text 6303 name_ = self.gds_validate_string(name_, node, 'name') 6304 self.name = name_
6305 # end class entityObject 6306 6307
6308 -class uriObject(GeneratedsSuper):
6309 """Uri object. Only required element is uri string itself. There are 6310 elements for each of the broken out elements. The protocol 6311 should be take from the list at http://www.iana.org/assignments 6312 /port-numbers, or if not in that list have the value 'unknown'. 6313 The ipProtocol should be taken from the list 6314 http://www.iana.org/assignments/protocol-numbers/. The elements 6315 correspond to the usual breakdown of a uri into its component 6316 domain, hostname, path, port etc, as described at 6317 http://en.wikipedia.org/wiki/Uniform_Resource_Locator.""" 6318 subclass = None 6319 superclass = None
6320 - def __init__(self, id=None, uriString=None, protocol=None, hostname=None, domain=None, port=None, path=None, ipProtocol=None):
6321 self.id = _cast(None, id) 6322 self.uriString = uriString 6323 self.protocol = protocol 6324 self.hostname = hostname 6325 self.domain = domain 6326 self.port = port 6327 self.path = path 6328 self.ipProtocol = ipProtocol
6329 - def factory(*args_, **kwargs_):
6330 if uriObject.subclass: 6331 return uriObject.subclass(*args_, **kwargs_) 6332 else: 6333 return uriObject(*args_, **kwargs_)
6334 factory = staticmethod(factory)
6335 - def get_uriString(self): return self.uriString
6336 - def set_uriString(self, uriString): self.uriString = uriString
6337 - def validate_NoQuestionMark(self, value):
6338 # Validate type NoQuestionMark, a restriction on xs:string. 6339 pass
6340 - def get_protocol(self): return self.protocol
6341 - def set_protocol(self, protocol): self.protocol = protocol
6342 - def get_hostname(self): return self.hostname
6343 - def set_hostname(self, hostname): self.hostname = hostname
6344 - def get_domain(self): return self.domain
6345 - def set_domain(self, domain): self.domain = domain
6346 - def get_port(self): return self.port
6347 - def set_port(self, port): self.port = port
6348 - def get_path(self): return self.path
6349 - def set_path(self, path): self.path = path
6350 - def get_ipProtocol(self): return self.ipProtocol
6351 - def set_ipProtocol(self, ipProtocol): self.ipProtocol = ipProtocol
6352 - def get_id(self): return self.id
6353 - def set_id(self, id): self.id = id
6354 - def export(self, outfile, level, namespace_='maec:', name_='uriObject', namespacedef_=''):
6355 showIndent(outfile, level) 6356 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6357 already_processed = [] 6358 self.exportAttributes(outfile, level, already_processed, namespace_, name_='uriObject') 6359 if self.hasContent_(): 6360 outfile.write('>\n') 6361 self.exportChildren(outfile, level + 1, namespace_, name_) 6362 showIndent(outfile, level) 6363 outfile.write('</%s%s>\n' % (namespace_, name_)) 6364 else: 6365 outfile.write('/>\n')
6366 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='uriObject'):
6367 if self.id is not None and 'id' not in already_processed: 6368 already_processed.append('id') 6369 outfile.write(' id=%s' % (quote_attrib(self.id), ))
6370 - def exportChildren(self, outfile, level, namespace_='maec:', name_='uriObject', fromsubclass_=False):
6371 if self.uriString is not None: 6372 showIndent(outfile, level) 6373 outfile.write('<%suriString>%s</%suriString>\n' % (namespace_, self.gds_format_string(quote_xml(self.uriString).encode(ExternalEncoding), input_name='uriString'), namespace_)) 6374 if self.protocol is not None: 6375 showIndent(outfile, level) 6376 outfile.write('<%sprotocol>%s</%sprotocol>\n' % (namespace_, self.gds_format_string(quote_xml(self.protocol).encode(ExternalEncoding), input_name='protocol'), namespace_)) 6377 if self.hostname is not None: 6378 showIndent(outfile, level) 6379 outfile.write('<%shostname>%s</%shostname>\n' % (namespace_, self.gds_format_string(quote_xml(self.hostname).encode(ExternalEncoding), input_name='hostname'), namespace_)) 6380 if self.domain is not None: 6381 showIndent(outfile, level) 6382 outfile.write('<%sdomain>%s</%sdomain>\n' % (namespace_, self.gds_format_string(quote_xml(self.domain).encode(ExternalEncoding), input_name='domain'), namespace_)) 6383 if self.port is not None: 6384 showIndent(outfile, level) 6385 outfile.write('<%sport>%s</%sport>\n' % (namespace_, self.gds_format_integer(self.port, input_name='port'), namespace_)) 6386 if self.path is not None: 6387 showIndent(outfile, level) 6388 outfile.write('<%spath>%s</%spath>\n' % (namespace_, self.gds_format_string(quote_xml(self.path).encode(ExternalEncoding), input_name='path'), namespace_)) 6389 if self.ipProtocol is not None: 6390 showIndent(outfile, level) 6391 outfile.write('<%sipProtocol>%s</%sipProtocol>\n' % (namespace_, self.gds_format_string(quote_xml(self.ipProtocol).encode(ExternalEncoding), input_name='ipProtocol'), namespace_))
6392 - def hasContent_(self):
6393 if ( 6394 self.uriString is not None or 6395 self.protocol is not None or 6396 self.hostname is not None or 6397 self.domain is not None or 6398 self.port is not None or 6399 self.path is not None or 6400 self.ipProtocol is not None 6401 ): 6402 return True 6403 else: 6404 return False
6405 - def exportLiteral(self, outfile, level, name_='uriObject'):
6406 level += 1 6407 self.exportLiteralAttributes(outfile, level, [], name_) 6408 if self.hasContent_(): 6409 self.exportLiteralChildren(outfile, level, name_)
6410 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6411 if self.id is not None and 'id' not in already_processed: 6412 already_processed.append('id') 6413 showIndent(outfile, level) 6414 outfile.write('id = "%s",\n' % (self.id,))
6415 - def exportLiteralChildren(self, outfile, level, name_):
6416 if self.uriString is not None: 6417 showIndent(outfile, level) 6418 outfile.write('uriString=%s,\n' % quote_python(self.uriString).encode(ExternalEncoding)) 6419 if self.protocol is not None: 6420 showIndent(outfile, level) 6421 outfile.write('protocol=%s,\n' % quote_python(self.protocol).encode(ExternalEncoding)) 6422 if self.hostname is not None: 6423 showIndent(outfile, level) 6424 outfile.write('hostname=%s,\n' % quote_python(self.hostname).encode(ExternalEncoding)) 6425 if self.domain is not None: 6426 showIndent(outfile, level) 6427 outfile.write('domain=%s,\n' % quote_python(self.domain).encode(ExternalEncoding)) 6428 if self.port is not None: 6429 showIndent(outfile, level) 6430 outfile.write('port=%d,\n' % self.port) 6431 if self.path is not None: 6432 showIndent(outfile, level) 6433 outfile.write('path=%s,\n' % quote_python(self.path).encode(ExternalEncoding)) 6434 if self.ipProtocol is not None: 6435 showIndent(outfile, level) 6436 outfile.write('ipProtocol=%s,\n' % quote_python(self.ipProtocol).encode(ExternalEncoding))
6437 - def build(self, node):
6438 self.buildAttributes(node, node.attrib, []) 6439 for child in node: 6440 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6441 self.buildChildren(child, node, nodeName_)
6442 - def buildAttributes(self, node, attrs, already_processed):
6443 value = find_attr_value_('id', node) 6444 if value is not None and 'id' not in already_processed: 6445 already_processed.append('id') 6446 self.id = value 6447 self.validate_NoQuestionMark(self.id) # validate type NoQuestionMark
6448 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6449 if nodeName_ == 'uriString': 6450 uriString_ = child_.text 6451 uriString_ = self.gds_validate_string(uriString_, node, 'uriString') 6452 self.uriString = uriString_ 6453 self.validate_NoQuestionMark(self.uriString) # validate type NoQuestionMark 6454 elif nodeName_ == 'protocol': 6455 protocol_ = child_.text 6456 protocol_ = self.gds_validate_string(protocol_, node, 'protocol') 6457 self.protocol = protocol_ 6458 elif nodeName_ == 'hostname': 6459 hostname_ = child_.text 6460 hostname_ = self.gds_validate_string(hostname_, node, 'hostname') 6461 self.hostname = hostname_ 6462 elif nodeName_ == 'domain': 6463 domain_ = child_.text 6464 domain_ = self.gds_validate_string(domain_, node, 'domain') 6465 self.domain = domain_ 6466 elif nodeName_ == 'port': 6467 sval_ = child_.text 6468 try: 6469 ival_ = int(sval_) 6470 except (TypeError, ValueError) as e: 6471 raise_parse_error(child_, 'requires integer: %s' % e) 6472 ival_ = self.gds_validate_integer(ival_, node, 'port') 6473 self.port = ival_ 6474 elif nodeName_ == 'path': 6475 path_ = child_.text 6476 path_ = self.gds_validate_string(path_, node, 'path') 6477 self.path = path_ 6478 elif nodeName_ == 'ipProtocol': 6479 ipProtocol_ = child_.text 6480 ipProtocol_ = self.gds_validate_string(ipProtocol_, node, 'ipProtocol') 6481 self.ipProtocol = ipProtocol_
6482 # end class uriObject 6483 6484
6485 -class IPObject(GeneratedsSuper):
6486 """IP object. Used to hold ipv4, ipv6 ip addresses and address ranges. 6487 The globally unique id is 'startAddress-endAddress'. There are 6488 two required elements, startAddress and endAddress, make these 6489 the same if you are specifying a single address. Thus for ip 6490 range id, would be e.g. 213.23.45.7-213.23.45.19 For a single 6491 ip, id would be e.g. 12.34.56.1-12.34.56.1""" 6492 subclass = None 6493 superclass = None
6494 - def __init__(self, id=None, startAddress=None, endAddress=None):
6495 self.id = _cast(None, id) 6496 self.startAddress = startAddress 6497 self.endAddress = endAddress
6498 - def factory(*args_, **kwargs_):
6499 if IPObject.subclass: 6500 return IPObject.subclass(*args_, **kwargs_) 6501 else: 6502 return IPObject(*args_, **kwargs_)
6503 factory = staticmethod(factory)
6504 - def get_startAddress(self): return self.startAddress
6505 - def set_startAddress(self, startAddress): self.startAddress = startAddress
6506 - def get_endAddress(self): return self.endAddress
6507 - def set_endAddress(self, endAddress): self.endAddress = endAddress
6508 - def get_id(self): return self.id
6509 - def set_id(self, id): self.id = id
6510 - def validate_IPRange(self, value):
6511 # Validate type IPRange, a restriction on xs:string. 6512 pass
6513 - def export(self, outfile, level, namespace_='maec:', name_='IPObject', namespacedef_=''):
6514 showIndent(outfile, level) 6515 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6516 already_processed = [] 6517 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IPObject') 6518 if self.hasContent_(): 6519 outfile.write('>\n') 6520 self.exportChildren(outfile, level + 1, namespace_, name_) 6521 showIndent(outfile, level) 6522 outfile.write('</%s%s>\n' % (namespace_, name_)) 6523 else: 6524 outfile.write('/>\n')
6525 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='IPObject'):
6526 if self.id is not None and 'id' not in already_processed: 6527 already_processed.append('id') 6528 outfile.write(' id=%s' % (quote_attrib(self.id), ))
6529 - def exportChildren(self, outfile, level, namespace_='maec:', name_='IPObject', fromsubclass_=False):
6530 if self.startAddress is not None: 6531 self.startAddress.export(outfile, level, namespace_, name_='startAddress', ) 6532 if self.endAddress is not None: 6533 self.endAddress.export(outfile, level, namespace_, name_='endAddress', )
6534 - def hasContent_(self):
6535 if ( 6536 self.startAddress is not None or 6537 self.endAddress is not None 6538 ): 6539 return True 6540 else: 6541 return False
6542 - def exportLiteral(self, outfile, level, name_='IPObject'):
6543 level += 1 6544 self.exportLiteralAttributes(outfile, level, [], name_) 6545 if self.hasContent_(): 6546 self.exportLiteralChildren(outfile, level, name_)
6547 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6548 if self.id is not None and 'id' not in already_processed: 6549 already_processed.append('id') 6550 showIndent(outfile, level) 6551 outfile.write('id = "%s",\n' % (self.id,))
6552 - def exportLiteralChildren(self, outfile, level, name_):
6553 if self.startAddress is not None: 6554 showIndent(outfile, level) 6555 outfile.write('startAddress=model_.IPAddress(\n') 6556 self.startAddress.exportLiteral(outfile, level, name_='startAddress') 6557 showIndent(outfile, level) 6558 outfile.write('),\n') 6559 if self.endAddress is not None: 6560 showIndent(outfile, level) 6561 outfile.write('endAddress=model_.IPAddress(\n') 6562 self.endAddress.exportLiteral(outfile, level, name_='endAddress') 6563 showIndent(outfile, level) 6564 outfile.write('),\n')
6565 - def build(self, node):
6566 self.buildAttributes(node, node.attrib, []) 6567 for child in node: 6568 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6569 self.buildChildren(child, node, nodeName_)
6570 - def buildAttributes(self, node, attrs, already_processed):
6571 value = find_attr_value_('id', node) 6572 if value is not None and 'id' not in already_processed: 6573 already_processed.append('id') 6574 self.id = value 6575 self.validate_IPRange(self.id) # validate type IPRange
6576 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6577 if nodeName_ == 'startAddress': 6578 obj_ = IPAddress.factory() 6579 obj_.build(child_) 6580 self.set_startAddress(obj_) 6581 elif nodeName_ == 'endAddress': 6582 obj_ = IPAddress.factory() 6583 obj_.build(child_) 6584 self.set_endAddress(obj_)
6585 # end class IPObject 6586 6587
6588 -class IPAddress(GeneratedsSuper):
6589 """ip address - string for the actual address and attribute either 6590 ipv4, ipv6.""" 6591 subclass = None 6592 superclass = None
6593 - def __init__(self, type_=None, valueOf_=None):
6594 self.type_ = _cast(None, type_) 6595 self.valueOf_ = valueOf_
6596 - def factory(*args_, **kwargs_):
6597 if IPAddress.subclass: 6598 return IPAddress.subclass(*args_, **kwargs_) 6599 else: 6600 return IPAddress(*args_, **kwargs_)
6601 factory = staticmethod(factory)
6602 - def get_type(self): return self.type_
6603 - def set_type(self, type_): self.type_ = type_
6604 - def validate_IPTypeEnum(self, value):
6605 # Validate type IPTypeEnum, a restriction on xs:string. 6606 pass
6607 - def get_valueOf_(self): return self.valueOf_
6608 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
6609 - def export(self, outfile, level, namespace_='maec:', name_='IPAddress', namespacedef_=''):
6610 showIndent(outfile, level) 6611 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6612 already_processed = [] 6613 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IPAddress') 6614 if self.hasContent_(): 6615 outfile.write('>') 6616 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 6617 self.exportChildren(outfile, level + 1, namespace_, name_) 6618 outfile.write('</%s%s>\n' % (namespace_, name_)) 6619 else: 6620 outfile.write('/>\n')
6621 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='IPAddress'):
6622 if self.type_ is not None and 'type_' not in already_processed: 6623 already_processed.append('type_') 6624 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
6625 - def exportChildren(self, outfile, level, namespace_='maec:', name_='IPAddress', fromsubclass_=False):
6626 pass
6627 - def hasContent_(self):
6628 if ( 6629 self.valueOf_ 6630 ): 6631 return True 6632 else: 6633 return False
6634 - def exportLiteral(self, outfile, level, name_='IPAddress'):
6635 level += 1 6636 self.exportLiteralAttributes(outfile, level, [], name_) 6637 if self.hasContent_(): 6638 self.exportLiteralChildren(outfile, level, name_) 6639 showIndent(outfile, level) 6640 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
6641 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6642 if self.type_ is not None and 'type_' not in already_processed: 6643 already_processed.append('type_') 6644 showIndent(outfile, level) 6645 outfile.write('type_ = "%s",\n' % (self.type_,))
6646 - def exportLiteralChildren(self, outfile, level, name_):
6647 pass
6648 - def build(self, node):
6649 self.buildAttributes(node, node.attrib, []) 6650 self.valueOf_ = get_all_text_(node) 6651 for child in node: 6652 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6653 self.buildChildren(child, node, nodeName_)
6654 - def buildAttributes(self, node, attrs, already_processed):
6655 value = find_attr_value_('type', node) 6656 if value is not None and 'type' not in already_processed: 6657 already_processed.append('type') 6658 self.type_ = value 6659 self.validate_IPTypeEnum(self.type_) # validate type IPTypeEnum
6660 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6661 pass
6662 # end class IPAddress 6663 6664
6665 -class domainObject(GeneratedsSuper):
6666 """Domain object, used to hold internet domains, e.g.yahoo.com. The 6667 globally unique identifier (id attribute) is the domain itself. 6668 whois information on domain is recorded using object properties.""" 6669 subclass = None 6670 superclass = None
6671 - def __init__(self, id=None, domain=None):
6672 self.id = _cast(None, id) 6673 self.domain = domain
6674 - def factory(*args_, **kwargs_):
6675 if domainObject.subclass: 6676 return domainObject.subclass(*args_, **kwargs_) 6677 else: 6678 return domainObject(*args_, **kwargs_)
6679 factory = staticmethod(factory)
6680 - def get_domain(self): return self.domain
6681 - def set_domain(self, domain): self.domain = domain
6682 - def get_id(self): return self.id
6683 - def set_id(self, id): self.id = id
6684 - def export(self, outfile, level, namespace_='maec:', name_='domainObject', namespacedef_=''):
6685 showIndent(outfile, level) 6686 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6687 already_processed = [] 6688 self.exportAttributes(outfile, level, already_processed, namespace_, name_='domainObject') 6689 if self.hasContent_(): 6690 outfile.write('>\n') 6691 self.exportChildren(outfile, level + 1, namespace_, name_) 6692 showIndent(outfile, level) 6693 outfile.write('</%s%s>\n' % (namespace_, name_)) 6694 else: 6695 outfile.write('/>\n')
6696 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='domainObject'):
6697 if self.id is not None and 'id' not in already_processed: 6698 already_processed.append('id') 6699 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
6700 - def exportChildren(self, outfile, level, namespace_='maec:', name_='domainObject', fromsubclass_=False):
6701 if self.domain is not None: 6702 showIndent(outfile, level) 6703 outfile.write('<%sdomain>%s</%sdomain>\n' % (namespace_, self.gds_format_string(quote_xml(self.domain).encode(ExternalEncoding), input_name='domain'), namespace_))
6704 - def hasContent_(self):
6705 if ( 6706 self.domain is not None 6707 ): 6708 return True 6709 else: 6710 return False
6711 - def exportLiteral(self, outfile, level, name_='domainObject'):
6712 level += 1 6713 self.exportLiteralAttributes(outfile, level, [], name_) 6714 if self.hasContent_(): 6715 self.exportLiteralChildren(outfile, level, name_)
6716 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6717 if self.id is not None and 'id' not in already_processed: 6718 already_processed.append('id') 6719 showIndent(outfile, level) 6720 outfile.write('id = "%s",\n' % (self.id,))
6721 - def exportLiteralChildren(self, outfile, level, name_):
6722 if self.domain is not None: 6723 showIndent(outfile, level) 6724 outfile.write('domain=%s,\n' % quote_python(self.domain).encode(ExternalEncoding))
6725 - def build(self, node):
6726 self.buildAttributes(node, node.attrib, []) 6727 for child in node: 6728 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6729 self.buildChildren(child, node, nodeName_)
6730 - def buildAttributes(self, node, attrs, already_processed):
6731 value = find_attr_value_('id', node) 6732 if value is not None and 'id' not in already_processed: 6733 already_processed.append('id') 6734 self.id = value
6735 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6736 if nodeName_ == 'domain': 6737 domain_ = child_.text 6738 domain_ = self.gds_validate_string(domain_, node, 'domain') 6739 self.domain = domain_
6740 # end class domainObject 6741 6742
6743 -class ASNObject(GeneratedsSuper):
6744 """Object used to hold information on Autonomous System Numbers. An 6745 autonomous system (AS) is a collection of connected Internet 6746 Protocol (IP) routing prefixes under the control of one or more 6747 network operators that presents a common, clearly defined 6748 routing policy to the Internet. The id is the number, written as 6749 an integer for both 16 and 32 bit numbers.""" 6750 subclass = None 6751 superclass = None
6752 - def __init__(self, id=None, as_number=None):
6753 self.id = _cast(int, id) 6754 self.as_number = as_number
6755 - def factory(*args_, **kwargs_):
6756 if ASNObject.subclass: 6757 return ASNObject.subclass(*args_, **kwargs_) 6758 else: 6759 return ASNObject(*args_, **kwargs_)
6760 factory = staticmethod(factory)
6761 - def get_as_number(self): return self.as_number
6762 - def set_as_number(self, as_number): self.as_number = as_number
6763 - def get_id(self): return self.id
6764 - def set_id(self, id): self.id = id
6765 - def export(self, outfile, level, namespace_='maec:', name_='ASNObject', namespacedef_=''):
6766 showIndent(outfile, level) 6767 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6768 already_processed = [] 6769 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ASNObject') 6770 if self.hasContent_(): 6771 outfile.write('>\n') 6772 self.exportChildren(outfile, level + 1, namespace_, name_) 6773 showIndent(outfile, level) 6774 outfile.write('</%s%s>\n' % (namespace_, name_)) 6775 else: 6776 outfile.write('/>\n')
6777 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ASNObject'):
6778 if self.id is not None and 'id' not in already_processed: 6779 already_processed.append('id') 6780 outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
6781 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ASNObject', fromsubclass_=False):
6782 if self.as_number is not None: 6783 showIndent(outfile, level) 6784 outfile.write('<%sas-number>%s</%sas-number>\n' % (namespace_, self.gds_format_integer(self.as_number, input_name='as-number'), namespace_))
6785 - def hasContent_(self):
6786 if ( 6787 self.as_number is not None 6788 ): 6789 return True 6790 else: 6791 return False
6792 - def exportLiteral(self, outfile, level, name_='ASNObject'):
6793 level += 1 6794 self.exportLiteralAttributes(outfile, level, [], name_) 6795 if self.hasContent_(): 6796 self.exportLiteralChildren(outfile, level, name_)
6797 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6798 if self.id is not None and 'id' not in already_processed: 6799 already_processed.append('id') 6800 showIndent(outfile, level) 6801 outfile.write('id = %d,\n' % (self.id,))
6802 - def exportLiteralChildren(self, outfile, level, name_):
6803 if self.as_number is not None: 6804 showIndent(outfile, level) 6805 outfile.write('as_number=%d,\n' % self.as_number)
6806 - def build(self, node):
6807 self.buildAttributes(node, node.attrib, []) 6808 for child in node: 6809 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6810 self.buildChildren(child, node, nodeName_)
6811 - def buildAttributes(self, node, attrs, already_processed):
6812 value = find_attr_value_('id', node) 6813 if value is not None and 'id' not in already_processed: 6814 already_processed.append('id') 6815 try: 6816 self.id = int(value) 6817 except ValueError as e: 6818 raise_parse_error(node, 'Bad integer attribute: %s' % e)
6819 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6820 if nodeName_ == 'as-number': 6821 sval_ = child_.text 6822 try: 6823 ival_ = int(sval_) 6824 except (TypeError, ValueError) as e: 6825 raise_parse_error(child_, 'requires integer: %s' % e) 6826 ival_ = self.gds_validate_integer(ival_, node, 'as_number') 6827 self.as_number = ival_
6828 # end class ASNObject 6829 6830
6831 -class classificationObject(GeneratedsSuper):
6832 """Classification object, used to hold names or classifications of 6833 objects. The most common use case for this is detection names 6834 for files from av scanners. However, this object could be used 6835 for general classification. The globally unique id (attribute) 6836 should be created from "Company name:internal classification 6837 name", e.g. "Mcafee:Generic.DX". The other required attribute is 6838 the type of classification, e.g. clean, dirty, unknown. There 6839 are elements to capture the category of the classification. The 6840 category should be entered in the same way to the classification 6841 name, e.g. company name:category name, e..g Mcafee:Trojan.""" 6842 subclass = None 6843 superclass = None
6844 - def __init__(self, type_=None, id=None, classificationName=None, companyName=None, category=None, classificationDetails=None):
6845 self.type_ = _cast(None, type_) 6846 self.id = _cast(None, id) 6847 self.classificationName = classificationName 6848 self.companyName = companyName 6849 self.category = category 6850 self.classificationDetails = classificationDetails
6851 - def factory(*args_, **kwargs_):
6852 if classificationObject.subclass: 6853 return classificationObject.subclass(*args_, **kwargs_) 6854 else: 6855 return classificationObject(*args_, **kwargs_)
6856 factory = staticmethod(factory)
6857 - def get_classificationName(self): return self.classificationName
6858 - def set_classificationName(self, classificationName): self.classificationName = classificationName
6859 - def get_companyName(self): return self.companyName
6860 - def set_companyName(self, companyName): self.companyName = companyName
6861 - def get_category(self): return self.category
6862 - def set_category(self, category): self.category = category
6863 - def get_classificationDetails(self): return self.classificationDetails
6864 - def set_classificationDetails(self, classificationDetails): self.classificationDetails = classificationDetails
6865 - def get_type(self): return self.type_
6866 - def set_type(self, type_): self.type_ = type_
6867 - def validate_ClassificationTypeEnum(self, value):
6868 # Validate type ClassificationTypeEnum, a restriction on xs:string. 6869 pass
6870 - def get_id(self): return self.id
6871 - def set_id(self, id): self.id = id
6872 - def export(self, outfile, level, namespace_='maec:', name_='classificationObject', namespacedef_=''):
6873 showIndent(outfile, level) 6874 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 6875 already_processed = [] 6876 self.exportAttributes(outfile, level, already_processed, namespace_, name_='classificationObject') 6877 if self.hasContent_(): 6878 outfile.write('>\n') 6879 self.exportChildren(outfile, level + 1, namespace_, name_) 6880 showIndent(outfile, level) 6881 outfile.write('</%s%s>\n' % (namespace_, name_)) 6882 else: 6883 outfile.write('/>\n')
6884 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='classificationObject'):
6885 if self.type_ is not None and 'type_' not in already_processed: 6886 already_processed.append('type_') 6887 outfile.write(' type=%s' % (quote_attrib(self.type_), )) 6888 if self.id is not None and 'id' not in already_processed: 6889 already_processed.append('id') 6890 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
6891 - def exportChildren(self, outfile, level, namespace_='maec:', name_='classificationObject', fromsubclass_=False):
6892 if self.classificationName is not None: 6893 showIndent(outfile, level) 6894 outfile.write('<%sclassificationName>%s</%sclassificationName>\n' % (namespace_, self.gds_format_string(quote_xml(self.classificationName).encode(ExternalEncoding), input_name='classificationName'), namespace_)) 6895 if self.companyName is not None: 6896 showIndent(outfile, level) 6897 outfile.write('<%scompanyName>%s</%scompanyName>\n' % (namespace_, self.gds_format_string(quote_xml(self.companyName).encode(ExternalEncoding), input_name='companyName'), namespace_)) 6898 if self.category is not None: 6899 showIndent(outfile, level) 6900 outfile.write('<%scategory>%s</%scategory>\n' % (namespace_, self.gds_format_string(quote_xml(self.category).encode(ExternalEncoding), input_name='category'), namespace_)) 6901 if self.classificationDetails is not None: 6902 self.classificationDetails.export(outfile, level, namespace_, name_='classificationDetails')
6903 - def hasContent_(self):
6904 if ( 6905 self.classificationName is not None or 6906 self.companyName is not None or 6907 self.category is not None or 6908 self.classificationDetails is not None 6909 ): 6910 return True 6911 else: 6912 return False
6913 - def exportLiteral(self, outfile, level, name_='classificationObject'):
6914 level += 1 6915 self.exportLiteralAttributes(outfile, level, [], name_) 6916 if self.hasContent_(): 6917 self.exportLiteralChildren(outfile, level, name_)
6918 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6919 if self.type_ is not None and 'type_' not in already_processed: 6920 already_processed.append('type_') 6921 showIndent(outfile, level) 6922 outfile.write('type_ = "%s",\n' % (self.type_,)) 6923 if self.id is not None and 'id' not in already_processed: 6924 already_processed.append('id') 6925 showIndent(outfile, level) 6926 outfile.write('id = "%s",\n' % (self.id,))
6927 - def exportLiteralChildren(self, outfile, level, name_):
6928 if self.classificationName is not None: 6929 showIndent(outfile, level) 6930 outfile.write('classificationName=%s,\n' % quote_python(self.classificationName).encode(ExternalEncoding)) 6931 if self.companyName is not None: 6932 showIndent(outfile, level) 6933 outfile.write('companyName=%s,\n' % quote_python(self.companyName).encode(ExternalEncoding)) 6934 if self.category is not None: 6935 showIndent(outfile, level) 6936 outfile.write('category=%s,\n' % quote_python(self.category).encode(ExternalEncoding)) 6937 if self.classificationDetails is not None: 6938 showIndent(outfile, level) 6939 outfile.write('classificationDetails=model_.classificationDetailsType(\n') 6940 self.classificationDetails.exportLiteral(outfile, level, name_='classificationDetails') 6941 showIndent(outfile, level) 6942 outfile.write('),\n')
6943 - def build(self, node):
6944 self.buildAttributes(node, node.attrib, []) 6945 for child in node: 6946 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 6947 self.buildChildren(child, node, nodeName_)
6948 - def buildAttributes(self, node, attrs, already_processed):
6949 value = find_attr_value_('type', node) 6950 if value is not None and 'type' not in already_processed: 6951 already_processed.append('type') 6952 self.type_ = value 6953 self.validate_ClassificationTypeEnum(self.type_) # validate type ClassificationTypeEnum 6954 value = find_attr_value_('id', node) 6955 if value is not None and 'id' not in already_processed: 6956 already_processed.append('id') 6957 self.id = value
6958 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6959 if nodeName_ == 'classificationName': 6960 classificationName_ = child_.text 6961 classificationName_ = self.gds_validate_string(classificationName_, node, 'classificationName') 6962 self.classificationName = classificationName_ 6963 elif nodeName_ == 'companyName': 6964 companyName_ = child_.text 6965 companyName_ = self.gds_validate_string(companyName_, node, 'companyName') 6966 self.companyName = companyName_ 6967 elif nodeName_ == 'category': 6968 category_ = child_.text 6969 category_ = self.gds_validate_string(category_, node, 'category') 6970 self.category = category_ 6971 elif nodeName_ == 'classificationDetails': 6972 obj_ = classificationDetailsType.factory() 6973 obj_.build(child_) 6974 self.set_classificationDetails(obj_)
6975 # end class classificationObject 6976 6977
6978 -class fieldDataEntry(GeneratedsSuper):
6979 """Data structure to hold prevalence information. The data includes a 6980 reference to another object (which is an xpath expression 6981 pointing to an object inside the 'ref' element), together with a 6982 time period (startDate -> endDate), an origin - where the object 6983 came from, and various location tags. This allows rich 6984 information on prevalence to be recorded. By convention, time 6985 periods should be wherever possible standard time periods, e.g. 6986 minute, hour, 24 hours, week, month, quarter, year. This will 6987 facilitate combination of data from multiple sources. To 6988 represent a single entry, make startDate == endDate. Commonality 6989 is calculated from the sightings of malware objects (and so such 6990 calculation is easier to automate). Importance is reserved for 6991 cases when “commonality” is not available or if there is a 6992 need to communicate the importance when commonality is low. We 6993 define the commonality on a scale 0 to 100 (0 means “never 6994 found in the field” and 100 means “found very 6995 frequently”). Scaling commonality to 0..100 range instead of 6996 using actual sample counts is to avoid the effect of the user 6997 base size on the commonality. We derive commonality from the 6998 number of affected computers – not from the number of samples 6999 (for example, a hundred parasitic infections of the same virus 7000 on a single computer are to be counted as one). To calculate the 7001 commonality we use two-stage approach and logarithmic scale: - 7002 If the number of affected users exceeds 0.1% of your user base 7003 (more frequent than 1 in a 1000) set commonality to “100” - 7004 Otherwise, calculate the ratio of infected computers amongst 7005 your user base by dividing the real number of affected computers 7006 ‘n’ by the total number ‘N’ - Apply the following 7007 formula to get the commonality –( log2(1+n*1000/N) ) * 100 - 7008 Round to the closest integer Obviously, the calculation above 7009 can only be applied to counting of malware sightings on 7010 desktops. If telemetry is collected from a fraction of such 7011 desktops then an appropriate correction should be used. For all 7012 other cases (e.g. sighting on gateways, in some network security 7013 appliance, on an ISP level, etc.) please exercise your best 7014 judgment and apply provided desktop guideline as an example to 7015 make sure the commonality factor is as comparable as possible. 7016 For a URL object the commonality could reflect, for example, how 7017 widely it was spammed. “Importance” should not be used 7018 together with “commonality” (unless commonality=“0”) to 7019 avoid possible confusion. High “importance”, for example, 7020 can be assigned to samples that are over-hyped by media when 7021 their commonality is still “0”. Use the following guidelines 7022 for “importance” which is also defined on a scale 0..100: 7023 100 – you’d expect your CEO and/or media to call you any 7024 second about this object 80 – you might get a call from your 7025 CEO and/or media 60 – you’d expect your boss to call you any 7026 second 40 – you might get a call from your boss 20 – someone 7027 is very likely to contact you about this object 10 – you might 7028 get contacted about this object 0 – you’d be surprised if 7029 anyone would ever contact you about this object""" 7030 subclass = None 7031 superclass = None
7032 - def __init__(self, references=None, startDate=None, endDate=None, firstSeenDate=None, origin=None, commonality=None, volume=None, importance=None, location=None):
7033 self.references = references 7034 self.startDate = startDate 7035 self.endDate = endDate 7036 self.firstSeenDate = firstSeenDate 7037 self.origin = origin 7038 self.commonality = commonality 7039 if volume is None: 7040 self.volume = [] 7041 else: 7042 self.volume = volume 7043 self.importance = importance 7044 self.location = location
7045 - def factory(*args_, **kwargs_):
7046 if fieldDataEntry.subclass: 7047 return fieldDataEntry.subclass(*args_, **kwargs_) 7048 else: 7049 return fieldDataEntry(*args_, **kwargs_)
7050 factory = staticmethod(factory)
7051 - def get_references(self): return self.references
7052 - def set_references(self, references): self.references = references
7053 - def get_startDate(self): return self.startDate
7054 - def set_startDate(self, startDate): self.startDate = startDate
7055 - def get_endDate(self): return self.endDate
7056 - def set_endDate(self, endDate): self.endDate = endDate
7057 - def get_firstSeenDate(self): return self.firstSeenDate
7058 - def set_firstSeenDate(self, firstSeenDate): self.firstSeenDate = firstSeenDate
7059 - def get_origin(self): return self.origin
7060 - def set_origin(self, origin): self.origin = origin
7061 - def validate_OriginTypeEnum(self, value):
7062 # Validate type OriginTypeEnum, a restriction on xs:string. 7063 pass
7064 - def get_commonality(self): return self.commonality
7065 - def set_commonality(self, commonality): self.commonality = commonality
7066 - def validate_intBetween0and100(self, value):
7067 # Validate type intBetween0and100, a restriction on xs:integer. 7068 pass
7069 - def get_volume(self): return self.volume
7070 - def set_volume(self, volume): self.volume = volume
7071 - def add_volume(self, value): self.volume.append(value)
7072 - def insert_volume(self, index, value): self.volume[index] = value
7073 - def get_importance(self): return self.importance
7074 - def set_importance(self, importance): self.importance = importance
7075 - def get_location(self): return self.location
7076 - def set_location(self, location): self.location = location
7077 - def export(self, outfile, level, namespace_='maec:', name_='fieldDataEntry', namespacedef_=''):
7078 showIndent(outfile, level) 7079 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7080 already_processed = [] 7081 self.exportAttributes(outfile, level, already_processed, namespace_, name_='fieldDataEntry') 7082 if self.hasContent_(): 7083 outfile.write('>\n') 7084 self.exportChildren(outfile, level + 1, namespace_, name_) 7085 showIndent(outfile, level) 7086 outfile.write('</%s%s>\n' % (namespace_, name_)) 7087 else: 7088 outfile.write('/>\n')
7089 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='fieldDataEntry'):
7090 pass
7091 - def exportChildren(self, outfile, level, namespace_='maec:', name_='fieldDataEntry', fromsubclass_=False):
7092 if self.references is not None: 7093 self.references.export(outfile, level, namespace_, name_='references', ) 7094 if self.startDate is not None: 7095 showIndent(outfile, level) 7096 outfile.write('<%sstartDate>%s</%sstartDate>\n' % (namespace_, self.gds_format_string(quote_xml(self.startDate).encode(ExternalEncoding), input_name='startDate'), namespace_)) 7097 if self.endDate is not None: 7098 showIndent(outfile, level) 7099 outfile.write('<%sendDate>%s</%sendDate>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDate).encode(ExternalEncoding), input_name='endDate'), namespace_)) 7100 if self.firstSeenDate is not None: 7101 showIndent(outfile, level) 7102 outfile.write('<%sfirstSeenDate>%s</%sfirstSeenDate>\n' % (namespace_, self.gds_format_string(quote_xml(self.firstSeenDate).encode(ExternalEncoding), input_name='firstSeenDate'), namespace_)) 7103 if self.origin is not None: 7104 showIndent(outfile, level) 7105 outfile.write('<%sorigin>%s</%sorigin>\n' % (namespace_, self.gds_format_string(quote_xml(self.origin).encode(ExternalEncoding), input_name='origin'), namespace_)) 7106 if self.commonality is not None: 7107 showIndent(outfile, level) 7108 outfile.write('<%scommonality>%s</%scommonality>\n' % (namespace_, self.gds_format_integer(self.commonality, input_name='commonality'), namespace_)) 7109 for volume_ in self.volume: 7110 volume_.export(outfile, level, namespace_, name_='volume') 7111 if self.importance is not None: 7112 showIndent(outfile, level) 7113 outfile.write('<%simportance>%s</%simportance>\n' % (namespace_, self.gds_format_integer(self.importance, input_name='importance'), namespace_)) 7114 if self.location is not None: 7115 self.location.export(outfile, level, namespace_, name_='location')
7116 - def hasContent_(self):
7117 if ( 7118 self.references is not None or 7119 self.startDate is not None or 7120 self.endDate is not None or 7121 self.firstSeenDate is not None or 7122 self.origin is not None or 7123 self.commonality is not None or 7124 self.volume or 7125 self.importance is not None or 7126 self.location is not None 7127 ): 7128 return True 7129 else: 7130 return False
7131 - def exportLiteral(self, outfile, level, name_='fieldDataEntry'):
7132 level += 1 7133 self.exportLiteralAttributes(outfile, level, [], name_) 7134 if self.hasContent_(): 7135 self.exportLiteralChildren(outfile, level, name_)
7136 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7137 pass
7138 - def exportLiteralChildren(self, outfile, level, name_):
7139 if self.references is not None: 7140 showIndent(outfile, level) 7141 outfile.write('references=model_.referencesType(\n') 7142 self.references.exportLiteral(outfile, level, name_='references') 7143 showIndent(outfile, level) 7144 outfile.write('),\n') 7145 if self.startDate is not None: 7146 showIndent(outfile, level) 7147 outfile.write('startDate=%s,\n' % quote_python(self.startDate).encode(ExternalEncoding)) 7148 if self.endDate is not None: 7149 showIndent(outfile, level) 7150 outfile.write('endDate=%s,\n' % quote_python(self.endDate).encode(ExternalEncoding)) 7151 if self.firstSeenDate is not None: 7152 showIndent(outfile, level) 7153 outfile.write('firstSeenDate=%s,\n' % quote_python(self.firstSeenDate).encode(ExternalEncoding)) 7154 if self.origin is not None: 7155 showIndent(outfile, level) 7156 outfile.write('origin=%s,\n' % quote_python(self.origin).encode(ExternalEncoding)) 7157 if self.commonality is not None: 7158 showIndent(outfile, level) 7159 outfile.write('commonality=%d,\n' % self.commonality) 7160 showIndent(outfile, level) 7161 outfile.write('volume=[\n') 7162 level += 1 7163 for volume_ in self.volume: 7164 showIndent(outfile, level) 7165 outfile.write('model_.volumeType(\n') 7166 volume_.exportLiteral(outfile, level, name_='volumeType') 7167 showIndent(outfile, level) 7168 outfile.write('),\n') 7169 level -= 1 7170 showIndent(outfile, level) 7171 outfile.write('],\n') 7172 if self.importance is not None: 7173 showIndent(outfile, level) 7174 outfile.write('importance=%d,\n' % self.importance) 7175 if self.location is not None: 7176 showIndent(outfile, level) 7177 outfile.write('location=model_.locationType(\n') 7178 self.location.exportLiteral(outfile, level, name_='location') 7179 showIndent(outfile, level) 7180 outfile.write('),\n')
7181 - def build(self, node):
7182 self.buildAttributes(node, node.attrib, []) 7183 for child in node: 7184 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 7185 self.buildChildren(child, node, nodeName_)
7186 - def buildAttributes(self, node, attrs, already_processed):
7187 pass
7188 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7189 if nodeName_ == 'references': 7190 obj_ = referencesType.factory() 7191 obj_.build(child_) 7192 self.set_references(obj_) 7193 elif nodeName_ == 'startDate': 7194 startDate_ = child_.text 7195 startDate_ = self.gds_validate_string(startDate_, node, 'startDate') 7196 self.startDate = startDate_ 7197 elif nodeName_ == 'endDate': 7198 endDate_ = child_.text 7199 endDate_ = self.gds_validate_string(endDate_, node, 'endDate') 7200 self.endDate = endDate_ 7201 elif nodeName_ == 'firstSeenDate': 7202 firstSeenDate_ = child_.text 7203 firstSeenDate_ = self.gds_validate_string(firstSeenDate_, node, 'firstSeenDate') 7204 self.firstSeenDate = firstSeenDate_ 7205 elif nodeName_ == 'origin': 7206 origin_ = child_.text 7207 origin_ = self.gds_validate_string(origin_, node, 'origin') 7208 self.origin = origin_ 7209 self.validate_OriginTypeEnum(self.origin) # validate type OriginTypeEnum 7210 elif nodeName_ == 'commonality': 7211 sval_ = child_.text 7212 try: 7213 ival_ = int(sval_) 7214 except (TypeError, ValueError), exp: 7215 raise_parse_error(child_, 'requires integer: %s' % exp) 7216 ival_ = self.gds_validate_integer(ival_, node, 'commonality') 7217 self.commonality = ival_ 7218 self.validate_intBetween0and100(self.commonality) # validate type intBetween0and100 7219 elif nodeName_ == 'volume': 7220 obj_ = volumeType.factory() 7221 obj_.build(child_) 7222 self.volume.append(obj_) 7223 elif nodeName_ == 'importance': 7224 sval_ = child_.text 7225 try: 7226 ival_ = int(sval_) 7227 except (TypeError, ValueError) as e: 7228 raise_parse_error(child_, 'requires integer: %s' % e) 7229 ival_ = self.gds_validate_integer(ival_, node, 'importance') 7230 self.importance = ival_ 7231 self.validate_intBetween0and100(self.importance) # validate type intBetween0and100 7232 elif nodeName_ == 'location': 7233 obj_ = locationType.factory() 7234 obj_.build(child_) 7235 self.set_location(obj_)
7236 # end class fieldDataEntry 7237 7238
7239 -class reference(GeneratedsSuper):
7240 """Reference element used to hold xpath expressions to objects, for 7241 example file[@id="12345"].""" 7242 subclass = None 7243 superclass = None
7244 - def __init__(self, valueOf_=None):
7245 self.valueOf_ = valueOf_
7246 - def factory(*args_, **kwargs_):
7247 if reference.subclass: 7248 return reference.subclass(*args_, **kwargs_) 7249 else: 7250 return reference(*args_, **kwargs_)
7251 factory = staticmethod(factory)
7252 - def get_valueOf_(self): return self.valueOf_
7253 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
7254 - def export(self, outfile, level, namespace_='maec:', name_='reference', namespacedef_=''):
7255 showIndent(outfile, level) 7256 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7257 already_processed = [] 7258 self.exportAttributes(outfile, level, already_processed, namespace_, name_='reference') 7259 if self.hasContent_(): 7260 outfile.write('>') 7261 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 7262 self.exportChildren(outfile, level + 1, namespace_, name_) 7263 outfile.write('</%s%s>\n' % (namespace_, name_)) 7264 else: 7265 outfile.write('/>\n')
7266 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='reference'):
7267 pass
7268 - def exportChildren(self, outfile, level, namespace_='maec:', name_='reference', fromsubclass_=False):
7269 pass
7270 - def hasContent_(self):
7271 if ( 7272 self.valueOf_ 7273 ): 7274 return True 7275 else: 7276 return False
7277 - def exportLiteral(self, outfile, level, name_='reference'):
7278 level += 1 7279 self.exportLiteralAttributes(outfile, level, [], name_) 7280 if self.hasContent_(): 7281 self.exportLiteralChildren(outfile, level, name_) 7282 showIndent(outfile, level) 7283 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
7284 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7285 pass
7286 - def exportLiteralChildren(self, outfile, level, name_):
7287 pass
7288 - def build(self, node):
7289 self.buildAttributes(node, node.attrib, []) 7290 self.valueOf_ = get_all_text_(node) 7291 for child in node: 7292 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 7293 self.buildChildren(child, node, nodeName_)
7294 - def buildAttributes(self, node, attrs, already_processed):
7295 pass
7296 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7297 pass
7298 # end class reference 7299 7300
7301 -class property(GeneratedsSuper):
7302 """A property.""" 7303 subclass = None 7304 superclass = None
7305 - def __init__(self, type_=None, valueOf_=None):
7306 self.type_ = _cast(None, type_) 7307 self.valueOf_ = valueOf_
7308 - def factory(*args_, **kwargs_):
7309 if property.subclass: 7310 return property.subclass(*args_, **kwargs_) 7311 else: 7312 return property(*args_, **kwargs_)
7313 factory = staticmethod(factory)
7314 - def get_type(self): return self.type_
7315 - def set_type(self, type_): self.type_ = type_
7316 - def validate_PropertyTypeEnum(self, value):
7317 # Validate type PropertyTypeEnum, a restriction on xs:string. 7318 pass
7319 - def get_valueOf_(self): return self.valueOf_
7320 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
7321 - def export(self, outfile, level, namespace_='maec:', name_='property', namespacedef_=''):
7322 showIndent(outfile, level) 7323 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7324 already_processed = [] 7325 self.exportAttributes(outfile, level, already_processed, namespace_, name_='property') 7326 if self.hasContent_(): 7327 outfile.write('>') 7328 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 7329 self.exportChildren(outfile, level + 1, namespace_, name_) 7330 outfile.write('</%s%s>\n' % (namespace_, name_)) 7331 else: 7332 outfile.write('/>\n')
7333 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='property'):
7334 if self.type_ is not None and 'type_' not in already_processed: 7335 already_processed.append('type_') 7336 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
7337 - def exportChildren(self, outfile, level, namespace_='maec:', name_='property', fromsubclass_=False):
7338 pass
7339 - def hasContent_(self):
7340 if ( 7341 self.valueOf_ 7342 ): 7343 return True 7344 else: 7345 return False
7346 - def exportLiteral(self, outfile, level, name_='property'):
7347 level += 1 7348 self.exportLiteralAttributes(outfile, level, [], name_) 7349 if self.hasContent_(): 7350 self.exportLiteralChildren(outfile, level, name_) 7351 showIndent(outfile, level) 7352 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
7353 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7354 if self.type_ is not None and 'type_' not in already_processed: 7355 already_processed.append('type_') 7356 showIndent(outfile, level) 7357 outfile.write('type_ = "%s",\n' % (self.type_,))
7358 - def exportLiteralChildren(self, outfile, level, name_):
7359 pass
7360 - def build(self, node):
7361 self.buildAttributes(node, node.attrib, []) 7362 self.valueOf_ = get_all_text_(node) 7363 for child in node: 7364 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 7365 self.buildChildren(child, node, nodeName_)
7366 - def buildAttributes(self, node, attrs, already_processed):
7367 value = find_attr_value_('type', node) 7368 if value is not None and 'type' not in already_processed: 7369 already_processed.append('type') 7370 self.type_ = value 7371 self.validate_PropertyTypeEnum(self.type_) # validate type PropertyTypeEnum
7372 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7373 pass
7374 # end class property 7375 7376
7377 -class objectProperty(GeneratedsSuper):
7378 """Property; a reference to the object, a timestamp and an unbounded 7379 set of properties. This is used to describe extra information 7380 about an object. For example, to show the url parameter strings 7381 associated with a particular URI object. Or to show file names 7382 associated with a particular file. Properties can also be 7383 applied to relationships, by referencing the relationship by id. 7384 This allows use such as e.g. recording the post data sent in an 7385 http request between a malware (file object) and a uri (uri 7386 object).""" 7387 subclass = None 7388 superclass = None
7389 - def __init__(self, id=None, references=None, timestamp=None, property=None):
7390 self.id = _cast(None, id) 7391 self.references = references 7392 self.timestamp = timestamp 7393 if property is None: 7394 self.property = [] 7395 else: 7396 self.property = property
7397 - def factory(*args_, **kwargs_):
7398 if objectProperty.subclass: 7399 return objectProperty.subclass(*args_, **kwargs_) 7400 else: 7401 return objectProperty(*args_, **kwargs_)
7402 factory = staticmethod(factory)
7403 - def get_references(self): return self.references
7404 - def set_references(self, references): self.references = references
7405 - def get_timestamp(self): return self.timestamp
7406 - def set_timestamp(self, timestamp): self.timestamp = timestamp
7407 - def get_property(self): return self.property
7408 - def set_property(self, property): self.property = property
7409 - def add_property(self, value): self.property.append(value)
7410 - def insert_property(self, index, value): self.property[index] = value
7411 - def get_id(self): return self.id
7412 - def set_id(self, id): self.id = id
7413 - def export(self, outfile, level, namespace_='maec:', name_='objectProperty', namespacedef_=''):
7414 showIndent(outfile, level) 7415 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7416 already_processed = [] 7417 self.exportAttributes(outfile, level, already_processed, namespace_, name_='objectProperty') 7418 if self.hasContent_(): 7419 outfile.write('>\n') 7420 self.exportChildren(outfile, level + 1, namespace_, name_) 7421 showIndent(outfile, level) 7422 outfile.write('</%s%s>\n' % (namespace_, name_)) 7423 else: 7424 outfile.write('/>\n')
7425 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='objectProperty'):
7426 if self.id is not None and 'id' not in already_processed: 7427 already_processed.append('id') 7428 outfile.write(' id=%s' % (quote_attrib(self.id), ))
7429 - def exportChildren(self, outfile, level, namespace_='maec:', name_='objectProperty', fromsubclass_=False):
7430 if self.references is not None: 7431 self.references.export(outfile, level, namespace_, name_='references', ) 7432 if self.timestamp is not None: 7433 showIndent(outfile, level) 7434 outfile.write('<%stimestamp>%s</%stimestamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.timestamp).encode(ExternalEncoding), input_name='timestamp'), namespace_)) 7435 for property_ in self.property: 7436 property_.export(outfile, level, namespace_, name_='property')
7437 - def hasContent_(self):
7438 if ( 7439 self.references is not None or 7440 self.timestamp is not None or 7441 self.property 7442 ): 7443 return True 7444 else: 7445 return False
7446 - def exportLiteral(self, outfile, level, name_='objectProperty'):
7447 level += 1 7448 self.exportLiteralAttributes(outfile, level, [], name_) 7449 if self.hasContent_(): 7450 self.exportLiteralChildren(outfile, level, name_)
7451 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7452 if self.id is not None and 'id' not in already_processed: 7453 already_processed.append('id') 7454 showIndent(outfile, level) 7455 outfile.write('id = %s,\n' % (self.id,))
7456 - def exportLiteralChildren(self, outfile, level, name_):
7457 if self.references is not None: 7458 showIndent(outfile, level) 7459 outfile.write('references=model_.referencesType1(\n') 7460 self.references.exportLiteral(outfile, level, name_='references') 7461 showIndent(outfile, level) 7462 outfile.write('),\n') 7463 if self.timestamp is not None: 7464 showIndent(outfile, level) 7465 outfile.write('timestamp=%s,\n' % quote_python(self.timestamp).encode(ExternalEncoding)) 7466 showIndent(outfile, level) 7467 outfile.write('property=[\n') 7468 level += 1 7469 for property_ in self.property: 7470 showIndent(outfile, level) 7471 outfile.write('model_.property(\n') 7472 property_.exportLiteral(outfile, level) 7473 showIndent(outfile, level) 7474 outfile.write('),\n') 7475 level -= 1 7476 showIndent(outfile, level) 7477 outfile.write('],\n')
7478 - def build(self, node):
7479 self.buildAttributes(node, node.attrib, []) 7480 for child in node: 7481 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 7482 self.buildChildren(child, node, nodeName_)
7483 - def buildAttributes(self, node, attrs, already_processed):
7484 value = find_attr_value_('id', node) 7485 if value is not None and 'id' not in already_processed: 7486 already_processed.append('id') 7487 self.id = value
7488 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7489 if nodeName_ == 'references': 7490 obj_ = referencesType1.factory() 7491 obj_.build(child_) 7492 self.set_references(obj_) 7493 elif nodeName_ == 'timestamp': 7494 timestamp_ = child_.text 7495 timestamp_ = self.gds_validate_string(timestamp_, node, 'timestamp') 7496 self.timestamp = timestamp_ 7497 elif nodeName_ == 'property': 7498 obj_ = property.factory() 7499 obj_.build(child_) 7500 self.property.append(obj_)
7501 # end class objectProperty 7502 7503
7504 -class relationship(GeneratedsSuper):
7505 """Relationships are used to express relationships between objects, and 7506 dates. Relationships have a type (an attribute with a defined 7507 list of allowed relationships), source (a set of xpath 7508 references to the parent end of the relationship), target (xpath 7509 references to the other end of the relationship) and an optional 7510 date. The linking of objects with types is a powerful way of 7511 describing data. The dates can be used to provide context. For 7512 example, to assign a classification to an object, that can done 7513 with an "isClassifiedAs" relationship, with the date meaning 7514 that that was the data that that classification was assigned. To 7515 show urls and the last visited data, this can be expressed as a 7516 "verifiedBy" relationship between the urls and the entity doing 7517 the verification, with the date interpreted as the verification 7518 date.""" 7519 subclass = None 7520 superclass = None
7521 - def __init__(self, type_=None, id=None, source=None, target=None, timestamp=None):
7522 self.type_ = _cast(None, type_) 7523 self.id = _cast(None, id) 7524 self.source = source 7525 self.target = target 7526 self.timestamp = timestamp
7527 - def factory(*args_, **kwargs_):
7528 if relationship.subclass: 7529 return relationship.subclass(*args_, **kwargs_) 7530 else: 7531 return relationship(*args_, **kwargs_)
7532 factory = staticmethod(factory)
7533 - def get_source(self): return self.source
7534 - def set_source(self, source): self.source = source
7535 - def get_target(self): return self.target
7536 - def set_target(self, target): self.target = target
7537 - def get_timestamp(self): return self.timestamp
7538 - def set_timestamp(self, timestamp): self.timestamp = timestamp
7539 - def get_type(self): return self.type_
7540 - def set_type(self, type_): self.type_ = type_
7541 - def validate_RelationshipTypeEnum(self, value):
7542 # Validate type RelationshipTypeEnum, a restriction on xs:string. 7543 pass
7544 - def get_id(self): return self.id
7545 - def set_id(self, id): self.id = id
7546 - def export(self, outfile, level, namespace_='maec:', name_='relationship', namespacedef_=''):
7547 showIndent(outfile, level) 7548 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7549 already_processed = [] 7550 self.exportAttributes(outfile, level, already_processed, namespace_, name_='relationship') 7551 if self.hasContent_(): 7552 outfile.write('>\n') 7553 self.exportChildren(outfile, level + 1, namespace_, name_) 7554 showIndent(outfile, level) 7555 outfile.write('</%s%s>\n' % (namespace_, name_)) 7556 else: 7557 outfile.write('/>\n')
7558 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='relationship'):
7559 if self.type_ is not None and 'type_' not in already_processed: 7560 already_processed.append('type_') 7561 outfile.write(' type=%s' % (quote_attrib(self.type_), )) 7562 if self.id is not None and 'id' not in already_processed: 7563 already_processed.append('id') 7564 outfile.write(' id=%s' % (quote_attrib(self.id), ))
7565 - def exportChildren(self, outfile, level, namespace_='maec:', name_='relationship', fromsubclass_=False):
7566 if self.source is not None: 7567 self.source.export(outfile, level, namespace_, name_='source', ) 7568 if self.target is not None: 7569 self.target.export(outfile, level, namespace_, name_='target', ) 7570 if self.timestamp is not None: 7571 showIndent(outfile, level) 7572 outfile.write('<%stimestamp>%s</%stimestamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.timestamp).encode(ExternalEncoding), input_name='timestamp'), namespace_))
7573 - def hasContent_(self):
7574 if ( 7575 self.source is not None or 7576 self.target is not None or 7577 self.timestamp is not None 7578 ): 7579 return True 7580 else: 7581 return False
7582 - def exportLiteral(self, outfile, level, name_='relationship'):
7583 level += 1 7584 self.exportLiteralAttributes(outfile, level, [], name_) 7585 if self.hasContent_(): 7586 self.exportLiteralChildren(outfile, level, name_)
7587 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7588 if self.type_ is not None and 'type_' not in already_processed: 7589 already_processed.append('type_') 7590 showIndent(outfile, level) 7591 outfile.write('type_ = "%s",\n' % (self.type_,)) 7592 if self.id is not None and 'id' not in already_processed: 7593 already_processed.append('id') 7594 showIndent(outfile, level) 7595 outfile.write('id = %s,\n' % (self.id,))
7596 - def exportLiteralChildren(self, outfile, level, name_):
7597 if self.source is not None: 7598 showIndent(outfile, level) 7599 outfile.write('source=model_.sourceType(\n') 7600 self.source.exportLiteral(outfile, level, name_='source') 7601 showIndent(outfile, level) 7602 outfile.write('),\n') 7603 if self.target is not None: 7604 showIndent(outfile, level) 7605 outfile.write('target=model_.targetType(\n') 7606 self.target.exportLiteral(outfile, level, name_='target') 7607 showIndent(outfile, level) 7608 outfile.write('),\n') 7609 if self.timestamp is not None: 7610 showIndent(outfile, level) 7611 outfile.write('timestamp=%s,\n' % quote_python(self.timestamp).encode(ExternalEncoding))
7612 - def build(self, node):
7613 self.buildAttributes(node, node.attrib, []) 7614 for child in node: 7615 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 7616 self.buildChildren(child, node, nodeName_)
7617 - def buildAttributes(self, node, attrs, already_processed):
7618 value = find_attr_value_('type', node) 7619 if value is not None and 'type' not in already_processed: 7620 already_processed.append('type') 7621 self.type_ = value 7622 self.validate_RelationshipTypeEnum(self.type_) # validate type RelationshipTypeEnum 7623 value = find_attr_value_('id', node) 7624 if value is not None and 'id' not in already_processed: 7625 already_processed.append('id') 7626 self.id = value
7627 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7628 if nodeName_ == 'source': 7629 obj_ = sourceType.factory() 7630 obj_.build(child_) 7631 self.set_source(obj_) 7632 elif nodeName_ == 'target': 7633 obj_ = targetType.factory() 7634 obj_.build(child_) 7635 self.set_target(obj_) 7636 elif nodeName_ == 'timestamp': 7637 timestamp_ = child_.text 7638 timestamp_ = self.gds_validate_string(timestamp_, node, 'timestamp') 7639 self.timestamp = timestamp_
7640 # end class relationship 7641 7642
7643 -class AnalysesType(GeneratedsSuper):
7644 subclass = None 7645 superclass = None
7646 - def __init__(self, Analysis=None):
7647 if Analysis is None: 7648 self.Analysis = [] 7649 else: 7650 self.Analysis = Analysis
7651 - def factory(*args_, **kwargs_):
7652 if AnalysesType.subclass: 7653 return AnalysesType.subclass(*args_, **kwargs_) 7654 else: 7655 return AnalysesType(*args_, **kwargs_)
7656 factory = staticmethod(factory)
7657 - def get_Analysis(self): return self.Analysis
7658 - def set_Analysis(self, Analysis): self.Analysis = Analysis
7659 - def add_Analysis(self, value): self.Analysis.append(value)
7660 - def insert_Analysis(self, index, value): self.Analysis[index] = value
7661 - def export(self, outfile, level, namespace_='maec:', name_='AnalysesType', namespacedef_=''):
7662 showIndent(outfile, level) 7663 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7664 already_processed = [] 7665 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AnalysesType') 7666 if self.hasContent_(): 7667 outfile.write('>\n') 7668 self.exportChildren(outfile, level + 1, namespace_, name_) 7669 showIndent(outfile, level) 7670 outfile.write('</%s%s>\n' % (namespace_, name_)) 7671 else: 7672 outfile.write('/>\n')
7673 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='AnalysesType'):
7674 pass
7675 - def exportChildren(self, outfile, level, namespace_='maec:', name_='AnalysesType', fromsubclass_=False):
7676 for Analysis_ in self.Analysis: 7677 Analysis_.export(outfile, level, namespace_, name_='Analysis')
7678 - def hasContent_(self):
7679 if ( 7680 self.Analysis 7681 ): 7682 return True 7683 else: 7684 return False
7685 - def exportLiteral(self, outfile, level, name_='AnalysesType'):
7686 level += 1 7687 self.exportLiteralAttributes(outfile, level, [], name_) 7688 if self.hasContent_(): 7689 self.exportLiteralChildren(outfile, level, name_)
7690 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7691 pass
7692 - def exportLiteralChildren(self, outfile, level, name_):
7693 showIndent(outfile, level) 7694 outfile.write('Analysis=[\n') 7695 level += 1 7696 for Analysis_ in self.Analysis: 7697 showIndent(outfile, level) 7698 outfile.write('model_.AnalysisType(\n') 7699 Analysis_.exportLiteral(outfile, level, name_='AnalysisType') 7700 showIndent(outfile, level) 7701 outfile.write('),\n') 7702 level -= 1 7703 showIndent(outfile, level) 7704 outfile.write('],\n')
7705 - def build(self, node):
7706 self.buildAttributes(node, node.attrib, []) 7707 for child in node: 7708 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 7709 self.buildChildren(child, node, nodeName_)
7710 - def buildAttributes(self, node, attrs, already_processed):
7711 pass
7712 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7713 if nodeName_ == 'Analysis': 7714 obj_ = AnalysisType.factory() 7715 obj_.build(child_) 7716 self.Analysis.append(obj_)
7717 # end class AnalysesType 7718 7719
7720 -class BehaviorsType(GeneratedsSuper):
7721 subclass = None 7722 superclass = None
7723 - def __init__(self, Behavior=None):
7724 if Behavior is None: 7725 self.Behavior = [] 7726 else: 7727 self.Behavior = Behavior
7728 - def factory(*args_, **kwargs_):
7729 if BehaviorsType.subclass: 7730 return BehaviorsType.subclass(*args_, **kwargs_) 7731 else: 7732 return BehaviorsType(*args_, **kwargs_)
7733 factory = staticmethod(factory)
7734 - def get_Behavior(self): return self.Behavior
7735 - def set_Behavior(self, Behavior): self.Behavior = Behavior
7736 - def add_Behavior(self, value): self.Behavior.append(value)
7737 - def insert_Behavior(self, index, value): self.Behavior[index] = value
7738 - def export(self, outfile, level, namespace_='maec:', name_='BehaviorsType', namespacedef_=''):
7739 showIndent(outfile, level) 7740 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7741 already_processed = [] 7742 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BehaviorsType') 7743 if self.hasContent_(): 7744 outfile.write('>\n') 7745 self.exportChildren(outfile, level + 1, namespace_, name_) 7746 showIndent(outfile, level) 7747 outfile.write('</%s%s>\n' % (namespace_, name_)) 7748 else: 7749 outfile.write('/>\n')
7750 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorsType'):
7751 pass
7752 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BehaviorsType', fromsubclass_=False):
7753 for Behavior_ in self.Behavior: 7754 Behavior_.export(outfile, level, namespace_, name_='Behavior')
7755 - def hasContent_(self):
7756 if ( 7757 self.Behavior 7758 ): 7759 return True 7760 else: 7761 return False
7762 - def exportLiteral(self, outfile, level, name_='BehaviorsType'):
7763 level += 1 7764 self.exportLiteralAttributes(outfile, level, [], name_) 7765 if self.hasContent_(): 7766 self.exportLiteralChildren(outfile, level, name_)
7767 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7768 pass
7769 - def exportLiteralChildren(self, outfile, level, name_):
7770 showIndent(outfile, level) 7771 outfile.write('Behavior=[\n') 7772 level += 1 7773 for Behavior_ in self.Behavior: 7774 showIndent(outfile, level) 7775 outfile.write('model_.BehaviorType(\n') 7776 Behavior_.exportLiteral(outfile, level, name_='BehaviorType') 7777 showIndent(outfile, level) 7778 outfile.write('),\n') 7779 level -= 1 7780 showIndent(outfile, level) 7781 outfile.write('],\n')
7782 - def build(self, node):
7783 self.buildAttributes(node, node.attrib, []) 7784 for child in node: 7785 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 7786 self.buildChildren(child, node, nodeName_)
7787 - def buildAttributes(self, node, attrs, already_processed):
7788 pass
7789 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7790 if nodeName_ == 'Behavior': 7791 obj_ = BehaviorType.factory() 7792 obj_.build(child_) 7793 self.Behavior.append(obj_)
7794 # end class BehaviorsType 7795 7796
7797 -class ActionsType(GeneratedsSuper):
7798 subclass = None 7799 superclass = None
7800 - def __init__(self, Action=None):
7801 if Action is None: 7802 self.Action = [] 7803 else: 7804 self.Action = Action
7805 - def factory(*args_, **kwargs_):
7806 if ActionsType.subclass: 7807 return ActionsType.subclass(*args_, **kwargs_) 7808 else: 7809 return ActionsType(*args_, **kwargs_)
7810 factory = staticmethod(factory)
7811 - def get_Action(self): return self.Action
7812 - def set_Action(self, Action): self.Action = Action
7813 - def add_Action(self, value): self.Action.append(value)
7814 - def insert_Action(self, index, value): self.Action[index] = value
7815 - def export(self, outfile, level, namespace_='maec:', name_='ActionsType', namespacedef_=''):
7816 showIndent(outfile, level) 7817 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7818 already_processed = [] 7819 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionsType') 7820 if self.hasContent_(): 7821 outfile.write('>\n') 7822 self.exportChildren(outfile, level + 1, namespace_, name_) 7823 showIndent(outfile, level) 7824 outfile.write('</%s%s>\n' % (namespace_, name_)) 7825 else: 7826 outfile.write('/>\n')
7827 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionsType'):
7828 pass
7829 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionsType', fromsubclass_=False):
7830 for Action_ in self.Action: 7831 Action_.export(outfile, level, namespace_, name_='Action')
7832 - def hasContent_(self):
7833 if ( 7834 self.Action 7835 ): 7836 return True 7837 else: 7838 return False
7839 - def exportLiteral(self, outfile, level, name_='ActionsType'):
7840 level += 1 7841 self.exportLiteralAttributes(outfile, level, [], name_) 7842 if self.hasContent_(): 7843 self.exportLiteralChildren(outfile, level, name_)
7844 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7845 pass
7846 - def exportLiteralChildren(self, outfile, level, name_):
7847 showIndent(outfile, level) 7848 outfile.write('Action=[\n') 7849 level += 1 7850 for Action_ in self.Action: 7851 showIndent(outfile, level) 7852 outfile.write('model_.ActionType(\n') 7853 Action_.exportLiteral(outfile, level, name_='ActionType') 7854 showIndent(outfile, level) 7855 outfile.write('),\n') 7856 level -= 1 7857 showIndent(outfile, level) 7858 outfile.write('],\n')
7859 - def build(self, node):
7860 self.buildAttributes(node, node.attrib, []) 7861 for child in node: 7862 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 7863 self.buildChildren(child, node, nodeName_)
7864 - def buildAttributes(self, node, attrs, already_processed):
7865 pass
7866 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7867 if nodeName_ == 'Action': 7868 obj_ = ActionType.factory() 7869 obj_.build(child_) 7870 self.Action.append(obj_)
7871 # end class ActionsType 7872 7873
7874 -class PoolsType(GeneratedsSuper):
7875 subclass = None 7876 superclass = None
7877 - def __init__(self, Behavior_Collection_Pool=None, Behavior_Pool=None, Action_Collection_Pool=None, Action_Pool=None, Object_Pool=None, Effect_Pool=None, Object_Collection_Pool=None):
7878 self.Behavior_Collection_Pool = Behavior_Collection_Pool 7879 self.Behavior_Pool = Behavior_Pool 7880 self.Action_Collection_Pool = Action_Collection_Pool 7881 self.Action_Pool = Action_Pool 7882 self.Object_Pool = Object_Pool 7883 self.Effect_Pool = Effect_Pool 7884 self.Object_Collection_Pool = Object_Collection_Pool
7885 - def factory(*args_, **kwargs_):
7886 if PoolsType.subclass: 7887 return PoolsType.subclass(*args_, **kwargs_) 7888 else: 7889 return PoolsType(*args_, **kwargs_)
7890 factory = staticmethod(factory)
7891 - def get_Behavior_Collection_Pool(self): return self.Behavior_Collection_Pool
7892 - def set_Behavior_Collection_Pool(self, Behavior_Collection_Pool): self.Behavior_Collection_Pool = Behavior_Collection_Pool
7893 - def get_Behavior_Pool(self): return self.Behavior_Pool
7894 - def set_Behavior_Pool(self, Behavior_Pool): self.Behavior_Pool = Behavior_Pool
7895 - def get_Action_Collection_Pool(self): return self.Action_Collection_Pool
7896 - def set_Action_Collection_Pool(self, Action_Collection_Pool): self.Action_Collection_Pool = Action_Collection_Pool
7897 - def get_Action_Pool(self): return self.Action_Pool
7898 - def set_Action_Pool(self, Action_Pool): self.Action_Pool = Action_Pool
7899 - def get_Object_Pool(self): return self.Object_Pool
7900 - def set_Object_Pool(self, Object_Pool): self.Object_Pool = Object_Pool
7901 - def get_Effect_Pool(self): return self.Effect_Pool
7902 - def set_Effect_Pool(self, Effect_Pool): self.Effect_Pool = Effect_Pool
7903 - def get_Object_Collection_Pool(self): return self.Object_Collection_Pool
7904 - def set_Object_Collection_Pool(self, Object_Collection_Pool): self.Object_Collection_Pool = Object_Collection_Pool
7905 - def export(self, outfile, level, namespace_='maec:', name_='PoolsType', namespacedef_=''):
7906 showIndent(outfile, level) 7907 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 7908 already_processed = [] 7909 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PoolsType') 7910 if self.hasContent_(): 7911 outfile.write('>\n') 7912 self.exportChildren(outfile, level + 1, namespace_, name_) 7913 showIndent(outfile, level) 7914 outfile.write('</%s%s>\n' % (namespace_, name_)) 7915 else: 7916 outfile.write('/>\n')
7917 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PoolsType'):
7918 pass
7919 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PoolsType', fromsubclass_=False):
7920 if self.Behavior_Collection_Pool is not None: 7921 self.Behavior_Collection_Pool.export(outfile, level, namespace_, name_='Behavior_Collection_Pool') 7922 if self.Behavior_Pool is not None: 7923 self.Behavior_Pool.export(outfile, level, namespace_, name_='Behavior_Pool') 7924 if self.Action_Collection_Pool is not None: 7925 self.Action_Collection_Pool.export(outfile, level, namespace_, name_='Action_Collection_Pool') 7926 if self.Action_Pool is not None: 7927 self.Action_Pool.export(outfile, level, namespace_, name_='Action_Pool') 7928 if self.Object_Pool is not None: 7929 self.Object_Pool.export(outfile, level, namespace_, name_='Object_Pool') 7930 if self.Effect_Pool is not None: 7931 self.Effect_Pool.export(outfile, level, namespace_, name_='Effect_Pool') 7932 if self.Object_Collection_Pool is not None: 7933 self.Object_Collection_Pool.export(outfile, level, namespace_, name_='Object_Collection_Pool')
7934 - def hasContent_(self):
7935 if ( 7936 self.Behavior_Collection_Pool is not None or 7937 self.Behavior_Pool is not None or 7938 self.Action_Collection_Pool is not None or 7939 self.Action_Pool is not None or 7940 self.Object_Pool is not None or 7941 self.Effect_Pool is not None or 7942 self.Object_Collection_Pool is not None 7943 ): 7944 return True 7945 else: 7946 return False
7947 - def exportLiteral(self, outfile, level, name_='PoolsType'):
7948 level += 1 7949 self.exportLiteralAttributes(outfile, level, [], name_) 7950 if self.hasContent_(): 7951 self.exportLiteralChildren(outfile, level, name_)
7952 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7953 pass
7954 - def exportLiteralChildren(self, outfile, level, name_):
7955 if self.Behavior_Collection_Pool is not None: 7956 showIndent(outfile, level) 7957 outfile.write('Behavior_Collection_Pool=model_.Behavior_Collection_PoolType(\n') 7958 self.Behavior_Collection_Pool.exportLiteral(outfile, level, name_='Behavior_Collection_Pool') 7959 showIndent(outfile, level) 7960 outfile.write('),\n') 7961 if self.Behavior_Pool is not None: 7962 showIndent(outfile, level) 7963 outfile.write('Behavior_Pool=model_.Behavior_PoolType(\n') 7964 self.Behavior_Pool.exportLiteral(outfile, level, name_='Behavior_Pool') 7965 showIndent(outfile, level) 7966 outfile.write('),\n') 7967 if self.Action_Collection_Pool is not None: 7968 showIndent(outfile, level) 7969 outfile.write('Action_Collection_Pool=model_.Action_Collection_PoolType(\n') 7970 self.Action_Collection_Pool.exportLiteral(outfile, level, name_='Action_Collection_Pool') 7971 showIndent(outfile, level) 7972 outfile.write('),\n') 7973 if self.Action_Pool is not None: 7974 showIndent(outfile, level) 7975 outfile.write('Action_Pool=model_.Action_PoolType(\n') 7976 self.Action_Pool.exportLiteral(outfile, level, name_='Action_Pool') 7977 showIndent(outfile, level) 7978 outfile.write('),\n') 7979 if self.Object_Pool is not None: 7980 showIndent(outfile, level) 7981 outfile.write('Object_Pool=model_.Object_PoolType(\n') 7982 self.Object_Pool.exportLiteral(outfile, level, name_='Object_Pool') 7983 showIndent(outfile, level) 7984 outfile.write('),\n') 7985 if self.Effect_Pool is not None: 7986 showIndent(outfile, level) 7987 outfile.write('Effect_Pool=model_.Effect_PoolType(\n') 7988 self.Effect_Pool.exportLiteral(outfile, level, name_='Effect_Pool') 7989 showIndent(outfile, level) 7990 outfile.write('),\n') 7991 if self.Object_Collection_Pool is not None: 7992 showIndent(outfile, level) 7993 outfile.write('Object_Collection_Pool=model_.Object_Collection_PoolType(\n') 7994 self.Object_Collection_Pool.exportLiteral(outfile, level, name_='Object_Collection_Pool') 7995 showIndent(outfile, level) 7996 outfile.write('),\n')
7997 - def build(self, node):
7998 self.buildAttributes(node, node.attrib, []) 7999 for child in node: 8000 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8001 self.buildChildren(child, node, nodeName_)
8002 - def buildAttributes(self, node, attrs, already_processed):
8003 pass
8004 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8005 if nodeName_ == 'Behavior_Collection_Pool': 8006 obj_ = Behavior_Collection_PoolType.factory() 8007 obj_.build(child_) 8008 self.set_Behavior_Collection_Pool(obj_) 8009 elif nodeName_ == 'Behavior_Pool': 8010 obj_ = Behavior_PoolType.factory() 8011 obj_.build(child_) 8012 self.set_Behavior_Pool(obj_) 8013 elif nodeName_ == 'Action_Collection_Pool': 8014 obj_ = Action_Collection_PoolType.factory() 8015 obj_.build(child_) 8016 self.set_Action_Collection_Pool(obj_) 8017 elif nodeName_ == 'Action_Pool': 8018 obj_ = Action_PoolType.factory() 8019 obj_.build(child_) 8020 self.set_Action_Pool(obj_) 8021 elif nodeName_ == 'Object_Pool': 8022 obj_ = Object_PoolType.factory() 8023 obj_.build(child_) 8024 self.set_Object_Pool(obj_) 8025 elif nodeName_ == 'Effect_Pool': 8026 obj_ = Effect_PoolType.factory() 8027 obj_.build(child_) 8028 self.set_Effect_Pool(obj_) 8029 elif nodeName_ == 'Object_Collection_Pool': 8030 obj_ = Object_Collection_PoolType.factory() 8031 obj_.build(child_) 8032 self.set_Object_Collection_Pool(obj_)
8033 # end class PoolsType 8034 8035
8036 -class Behavior_Collection_PoolType(GeneratedsSuper):
8037 subclass = None 8038 superclass = None
8039 - def __init__(self, Behavior_Collection=None):
8040 if Behavior_Collection is None: 8041 self.Behavior_Collection = [] 8042 else: 8043 self.Behavior_Collection = Behavior_Collection
8044 - def factory(*args_, **kwargs_):
8045 if Behavior_Collection_PoolType.subclass: 8046 return Behavior_Collection_PoolType.subclass(*args_, **kwargs_) 8047 else: 8048 return Behavior_Collection_PoolType(*args_, **kwargs_)
8049 factory = staticmethod(factory)
8050 - def get_Behavior_Collection(self): return self.Behavior_Collection
8051 - def set_Behavior_Collection(self, Behavior_Collection): self.Behavior_Collection = Behavior_Collection
8052 - def add_Behavior_Collection(self, value): self.Behavior_Collection.append(value)
8053 - def insert_Behavior_Collection(self, index, value): self.Behavior_Collection[index] = value
8054 - def export(self, outfile, level, namespace_='maec:', name_='Behavior_Collection_PoolType', namespacedef_=''):
8055 showIndent(outfile, level) 8056 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8057 already_processed = [] 8058 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Behavior_Collection_PoolType') 8059 if self.hasContent_(): 8060 outfile.write('>\n') 8061 self.exportChildren(outfile, level + 1, namespace_, name_) 8062 showIndent(outfile, level) 8063 outfile.write('</%s%s>\n' % (namespace_, name_)) 8064 else: 8065 outfile.write('/>\n')
8066 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Behavior_Collection_PoolType'):
8067 pass
8068 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Behavior_Collection_PoolType', fromsubclass_=False):
8069 for Behavior_Collection_ in self.Behavior_Collection: 8070 Behavior_Collection_.export(outfile, level, namespace_, name_='Behavior_Collection')
8071 - def hasContent_(self):
8072 if ( 8073 self.Behavior_Collection 8074 ): 8075 return True 8076 else: 8077 return False
8078 - def exportLiteral(self, outfile, level, name_='Behavior_Collection_PoolType'):
8079 level += 1 8080 self.exportLiteralAttributes(outfile, level, [], name_) 8081 if self.hasContent_(): 8082 self.exportLiteralChildren(outfile, level, name_)
8083 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8084 pass
8085 - def exportLiteralChildren(self, outfile, level, name_):
8086 showIndent(outfile, level) 8087 outfile.write('Behavior_Collection=[\n') 8088 level += 1 8089 for Behavior_Collection_ in self.Behavior_Collection: 8090 showIndent(outfile, level) 8091 outfile.write('model_.BehaviorCollectionType(\n') 8092 Behavior_Collection_.exportLiteral(outfile, level, name_='BehaviorCollectionType') 8093 showIndent(outfile, level) 8094 outfile.write('),\n') 8095 level -= 1 8096 showIndent(outfile, level) 8097 outfile.write('],\n')
8098 - def build(self, node):
8099 self.buildAttributes(node, node.attrib, []) 8100 for child in node: 8101 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8102 self.buildChildren(child, node, nodeName_)
8103 - def buildAttributes(self, node, attrs, already_processed):
8104 pass
8105 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8106 if nodeName_ == 'Behavior_Collection': 8107 obj_ = BehaviorCollectionType.factory() 8108 obj_.build(child_) 8109 self.Behavior_Collection.append(obj_)
8110 # end class Behavior_Collection_PoolType 8111 8112
8113 -class Behavior_PoolType(GeneratedsSuper):
8114 subclass = None 8115 superclass = None
8116 - def __init__(self, Behavior=None):
8117 if Behavior is None: 8118 self.Behavior = [] 8119 else: 8120 self.Behavior = Behavior
8121 - def factory(*args_, **kwargs_):
8122 if Behavior_PoolType.subclass: 8123 return Behavior_PoolType.subclass(*args_, **kwargs_) 8124 else: 8125 return Behavior_PoolType(*args_, **kwargs_)
8126 factory = staticmethod(factory)
8127 - def get_Behavior(self): return self.Behavior
8128 - def set_Behavior(self, Behavior): self.Behavior = Behavior
8129 - def add_Behavior(self, value): self.Behavior.append(value)
8130 - def insert_Behavior(self, index, value): self.Behavior[index] = value
8131 - def export(self, outfile, level, namespace_='maec:', name_='Behavior_PoolType', namespacedef_=''):
8132 showIndent(outfile, level) 8133 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8134 already_processed = [] 8135 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Behavior_PoolType') 8136 if self.hasContent_(): 8137 outfile.write('>\n') 8138 self.exportChildren(outfile, level + 1, namespace_, name_) 8139 showIndent(outfile, level) 8140 outfile.write('</%s%s>\n' % (namespace_, name_)) 8141 else: 8142 outfile.write('/>\n')
8143 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Behavior_PoolType'):
8144 pass
8145 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Behavior_PoolType', fromsubclass_=False):
8146 for Behavior_ in self.Behavior: 8147 Behavior_.export(outfile, level, namespace_, name_='Behavior')
8148 - def hasContent_(self):
8149 if ( 8150 self.Behavior 8151 ): 8152 return True 8153 else: 8154 return False
8155 - def exportLiteral(self, outfile, level, name_='Behavior_PoolType'):
8156 level += 1 8157 self.exportLiteralAttributes(outfile, level, [], name_) 8158 if self.hasContent_(): 8159 self.exportLiteralChildren(outfile, level, name_)
8160 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8161 pass
8162 - def exportLiteralChildren(self, outfile, level, name_):
8163 showIndent(outfile, level) 8164 outfile.write('Behavior=[\n') 8165 level += 1 8166 for Behavior_ in self.Behavior: 8167 showIndent(outfile, level) 8168 outfile.write('model_.BehaviorType(\n') 8169 Behavior_.exportLiteral(outfile, level, name_='BehaviorType') 8170 showIndent(outfile, level) 8171 outfile.write('),\n') 8172 level -= 1 8173 showIndent(outfile, level) 8174 outfile.write('],\n')
8175 - def build(self, node):
8176 self.buildAttributes(node, node.attrib, []) 8177 for child in node: 8178 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8179 self.buildChildren(child, node, nodeName_)
8180 - def buildAttributes(self, node, attrs, already_processed):
8181 pass
8182 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8183 if nodeName_ == 'Behavior': 8184 obj_ = BehaviorType.factory() 8185 obj_.build(child_) 8186 self.Behavior.append(obj_)
8187 # end class Behavior_PoolType 8188 8189
8190 -class Action_Collection_PoolType(GeneratedsSuper):
8191 subclass = None 8192 superclass = None
8193 - def __init__(self, Action_Collection=None):
8194 if Action_Collection is None: 8195 self.Action_Collection = [] 8196 else: 8197 self.Action_Collection = Action_Collection
8198 - def factory(*args_, **kwargs_):
8199 if Action_Collection_PoolType.subclass: 8200 return Action_Collection_PoolType.subclass(*args_, **kwargs_) 8201 else: 8202 return Action_Collection_PoolType(*args_, **kwargs_)
8203 factory = staticmethod(factory)
8204 - def get_Action_Collection(self): return self.Action_Collection
8205 - def set_Action_Collection(self, Action_Collection): self.Action_Collection = Action_Collection
8206 - def add_Action_Collection(self, value): self.Action_Collection.append(value)
8207 - def insert_Action_Collection(self, index, value): self.Action_Collection[index] = value
8208 - def export(self, outfile, level, namespace_='maec:', name_='Action_Collection_PoolType', namespacedef_=''):
8209 showIndent(outfile, level) 8210 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8211 already_processed = [] 8212 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Action_Collection_PoolType') 8213 if self.hasContent_(): 8214 outfile.write('>\n') 8215 self.exportChildren(outfile, level + 1, namespace_, name_) 8216 showIndent(outfile, level) 8217 outfile.write('</%s%s>\n' % (namespace_, name_)) 8218 else: 8219 outfile.write('/>\n')
8220 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Action_Collection_PoolType'):
8221 pass
8222 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Action_Collection_PoolType', fromsubclass_=False):
8223 for Action_Collection_ in self.Action_Collection: 8224 Action_Collection_.export(outfile, level, namespace_, name_='Action_Collection')
8225 - def hasContent_(self):
8226 if ( 8227 self.Action_Collection 8228 ): 8229 return True 8230 else: 8231 return False
8232 - def exportLiteral(self, outfile, level, name_='Action_Collection_PoolType'):
8233 level += 1 8234 self.exportLiteralAttributes(outfile, level, [], name_) 8235 if self.hasContent_(): 8236 self.exportLiteralChildren(outfile, level, name_)
8237 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8238 pass
8239 - def exportLiteralChildren(self, outfile, level, name_):
8240 showIndent(outfile, level) 8241 outfile.write('Action_Collection=[\n') 8242 level += 1 8243 for Action_Collection_ in self.Action_Collection: 8244 showIndent(outfile, level) 8245 outfile.write('model_.ActionCollectionType(\n') 8246 Action_Collection_.exportLiteral(outfile, level, name_='ActionCollectionType') 8247 showIndent(outfile, level) 8248 outfile.write('),\n') 8249 level -= 1 8250 showIndent(outfile, level) 8251 outfile.write('],\n')
8252 - def build(self, node):
8253 self.buildAttributes(node, node.attrib, []) 8254 for child in node: 8255 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8256 self.buildChildren(child, node, nodeName_)
8257 - def buildAttributes(self, node, attrs, already_processed):
8258 pass
8259 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8260 if nodeName_ == 'Action_Collection': 8261 obj_ = ActionCollectionType.factory() 8262 obj_.build(child_) 8263 self.Action_Collection.append(obj_)
8264 # end class Action_Collection_PoolType 8265 8266
8267 -class Action_PoolType(GeneratedsSuper):
8268 subclass = None 8269 superclass = None
8270 - def __init__(self, Action=None):
8271 if Action is None: 8272 self.Action = [] 8273 else: 8274 self.Action = Action
8275 - def factory(*args_, **kwargs_):
8276 if Action_PoolType.subclass: 8277 return Action_PoolType.subclass(*args_, **kwargs_) 8278 else: 8279 return Action_PoolType(*args_, **kwargs_)
8280 factory = staticmethod(factory)
8281 - def get_Action(self): return self.Action
8282 - def set_Action(self, Action): self.Action = Action
8283 - def add_Action(self, value): self.Action.append(value)
8284 - def insert_Action(self, index, value): self.Action[index] = value
8285 - def export(self, outfile, level, namespace_='maec:', name_='Action_PoolType', namespacedef_=''):
8286 showIndent(outfile, level) 8287 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8288 already_processed = [] 8289 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Action_PoolType') 8290 if self.hasContent_(): 8291 outfile.write('>\n') 8292 self.exportChildren(outfile, level + 1, namespace_, name_) 8293 showIndent(outfile, level) 8294 outfile.write('</%s%s>\n' % (namespace_, name_)) 8295 else: 8296 outfile.write('/>\n')
8297 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Action_PoolType'):
8298 pass
8299 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Action_PoolType', fromsubclass_=False):
8300 for Action_ in self.Action: 8301 Action_.export(outfile, level, namespace_, name_='Action')
8302 - def hasContent_(self):
8303 if ( 8304 self.Action 8305 ): 8306 return True 8307 else: 8308 return False
8309 - def exportLiteral(self, outfile, level, name_='Action_PoolType'):
8310 level += 1 8311 self.exportLiteralAttributes(outfile, level, [], name_) 8312 if self.hasContent_(): 8313 self.exportLiteralChildren(outfile, level, name_)
8314 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8315 pass
8316 - def exportLiteralChildren(self, outfile, level, name_):
8317 showIndent(outfile, level) 8318 outfile.write('Action=[\n') 8319 level += 1 8320 for Action_ in self.Action: 8321 showIndent(outfile, level) 8322 outfile.write('model_.ActionType(\n') 8323 Action_.exportLiteral(outfile, level, name_='ActionType') 8324 showIndent(outfile, level) 8325 outfile.write('),\n') 8326 level -= 1 8327 showIndent(outfile, level) 8328 outfile.write('],\n')
8329 - def build(self, node):
8330 self.buildAttributes(node, node.attrib, []) 8331 for child in node: 8332 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8333 self.buildChildren(child, node, nodeName_)
8334 - def buildAttributes(self, node, attrs, already_processed):
8335 pass
8336 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8337 if nodeName_ == 'Action': 8338 obj_ = ActionType.factory() 8339 obj_.build(child_) 8340 self.Action.append(obj_)
8341 # end class Action_PoolType 8342 8343
8344 -class Object_PoolType(GeneratedsSuper):
8345 subclass = None 8346 superclass = None
8347 - def __init__(self, Object=None):
8348 if Object is None: 8349 self.Object = [] 8350 else: 8351 self.Object = Object
8352 - def factory(*args_, **kwargs_):
8353 if Object_PoolType.subclass: 8354 return Object_PoolType.subclass(*args_, **kwargs_) 8355 else: 8356 return Object_PoolType(*args_, **kwargs_)
8357 factory = staticmethod(factory)
8358 - def get_Object(self): return self.Object
8359 - def set_Object(self, Object): self.Object = Object
8360 - def add_Object(self, value): self.Object.append(value)
8361 - def insert_Object(self, index, value): self.Object[index] = value
8362 - def export(self, outfile, level, namespace_='maec:', name_='Object_PoolType', namespacedef_=''):
8363 showIndent(outfile, level) 8364 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8365 already_processed = [] 8366 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Object_PoolType') 8367 if self.hasContent_(): 8368 outfile.write('>\n') 8369 self.exportChildren(outfile, level + 1, namespace_, name_) 8370 showIndent(outfile, level) 8371 outfile.write('</%s%s>\n' % (namespace_, name_)) 8372 else: 8373 outfile.write('/>\n')
8374 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Object_PoolType'):
8375 pass
8376 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Object_PoolType', fromsubclass_=False):
8377 for Object_ in self.Object: 8378 Object_.export(outfile, level, namespace_, name_='Object')
8379 - def hasContent_(self):
8380 if ( 8381 self.Object 8382 ): 8383 return True 8384 else: 8385 return False
8386 - def exportLiteral(self, outfile, level, name_='Object_PoolType'):
8387 level += 1 8388 self.exportLiteralAttributes(outfile, level, [], name_) 8389 if self.hasContent_(): 8390 self.exportLiteralChildren(outfile, level, name_)
8391 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8392 pass
8393 - def exportLiteralChildren(self, outfile, level, name_):
8394 showIndent(outfile, level) 8395 outfile.write('Object=[\n') 8396 level += 1 8397 for Object_ in self.Object: 8398 showIndent(outfile, level) 8399 outfile.write('model_.ObjectType(\n') 8400 Object_.exportLiteral(outfile, level, name_='ObjectType') 8401 showIndent(outfile, level) 8402 outfile.write('),\n') 8403 level -= 1 8404 showIndent(outfile, level) 8405 outfile.write('],\n')
8406 - def build(self, node):
8407 self.buildAttributes(node, node.attrib, []) 8408 for child in node: 8409 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8410 self.buildChildren(child, node, nodeName_)
8411 - def buildAttributes(self, node, attrs, already_processed):
8412 pass
8413 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8414 if nodeName_ == 'Object': 8415 obj_ = ObjectType.factory() 8416 obj_.build(child_) 8417 self.Object.append(obj_)
8418 # end class Object_PoolType 8419 8420
8421 -class Effect_PoolType(GeneratedsSuper):
8422 subclass = None 8423 superclass = None
8424 - def __init__(self, Effect=None):
8425 if Effect is None: 8426 self.Effect = [] 8427 else: 8428 self.Effect = Effect
8429 - def factory(*args_, **kwargs_):
8430 if Effect_PoolType.subclass: 8431 return Effect_PoolType.subclass(*args_, **kwargs_) 8432 else: 8433 return Effect_PoolType(*args_, **kwargs_)
8434 factory = staticmethod(factory)
8435 - def get_Effect(self): return self.Effect
8436 - def set_Effect(self, Effect): self.Effect = Effect
8437 - def add_Effect(self, value): self.Effect.append(value)
8438 - def insert_Effect(self, index, value): self.Effect[index] = value
8439 - def export(self, outfile, level, namespace_='maec:', name_='Effect_PoolType', namespacedef_=''):
8440 showIndent(outfile, level) 8441 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8442 already_processed = [] 8443 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Effect_PoolType') 8444 if self.hasContent_(): 8445 outfile.write('>\n') 8446 self.exportChildren(outfile, level + 1, namespace_, name_) 8447 showIndent(outfile, level) 8448 outfile.write('</%s%s>\n' % (namespace_, name_)) 8449 else: 8450 outfile.write('/>\n')
8451 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Effect_PoolType'):
8452 pass
8453 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Effect_PoolType', fromsubclass_=False):
8454 for Effect_ in self.Effect: 8455 Effect_.export(outfile, level, namespace_, name_='Effect')
8456 - def hasContent_(self):
8457 if ( 8458 self.Effect 8459 ): 8460 return True 8461 else: 8462 return False
8463 - def exportLiteral(self, outfile, level, name_='Effect_PoolType'):
8464 level += 1 8465 self.exportLiteralAttributes(outfile, level, [], name_) 8466 if self.hasContent_(): 8467 self.exportLiteralChildren(outfile, level, name_)
8468 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8469 pass
8470 - def exportLiteralChildren(self, outfile, level, name_):
8471 showIndent(outfile, level) 8472 outfile.write('Effect=[\n') 8473 level += 1 8474 for Effect_ in self.Effect: 8475 showIndent(outfile, level) 8476 outfile.write('model_.EffectType(\n') 8477 Effect_.exportLiteral(outfile, level, name_='EffectType') 8478 showIndent(outfile, level) 8479 outfile.write('),\n') 8480 level -= 1 8481 showIndent(outfile, level) 8482 outfile.write('],\n')
8483 - def build(self, node):
8484 self.buildAttributes(node, node.attrib, []) 8485 for child in node: 8486 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8487 self.buildChildren(child, node, nodeName_)
8488 - def buildAttributes(self, node, attrs, already_processed):
8489 pass
8490 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8491 if nodeName_ == 'Effect': 8492 obj_ = EffectType.factory() 8493 obj_.build(child_) 8494 self.Effect.append(obj_)
8495 # end class Effect_PoolType 8496 8497
8498 -class Object_Collection_PoolType(GeneratedsSuper):
8499 subclass = None 8500 superclass = None
8501 - def __init__(self, Object_Collection=None):
8502 if Object_Collection is None: 8503 self.Object_Collection = [] 8504 else: 8505 self.Object_Collection = Object_Collection
8506 - def factory(*args_, **kwargs_):
8507 if Object_Collection_PoolType.subclass: 8508 return Object_Collection_PoolType.subclass(*args_, **kwargs_) 8509 else: 8510 return Object_Collection_PoolType(*args_, **kwargs_)
8511 factory = staticmethod(factory)
8512 - def get_Object_Collection(self): return self.Object_Collection
8513 - def set_Object_Collection(self, Object_Collection): self.Object_Collection = Object_Collection
8514 - def add_Object_Collection(self, value): self.Object_Collection.append(value)
8515 - def insert_Object_Collection(self, index, value): self.Object_Collection[index] = value
8516 - def export(self, outfile, level, namespace_='maec:', name_='Object_Collection_PoolType', namespacedef_=''):
8517 showIndent(outfile, level) 8518 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8519 already_processed = [] 8520 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Object_Collection_PoolType') 8521 if self.hasContent_(): 8522 outfile.write('>\n') 8523 self.exportChildren(outfile, level + 1, namespace_, name_) 8524 showIndent(outfile, level) 8525 outfile.write('</%s%s>\n' % (namespace_, name_)) 8526 else: 8527 outfile.write('/>\n')
8528 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Object_Collection_PoolType'):
8529 pass
8530 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Object_Collection_PoolType', fromsubclass_=False):
8531 for Object_Collection_ in self.Object_Collection: 8532 Object_Collection_.export(outfile, level, namespace_, name_='Object_Collection')
8533 - def hasContent_(self):
8534 if ( 8535 self.Object_Collection 8536 ): 8537 return True 8538 else: 8539 return False
8540 - def exportLiteral(self, outfile, level, name_='Object_Collection_PoolType'):
8541 level += 1 8542 self.exportLiteralAttributes(outfile, level, [], name_) 8543 if self.hasContent_(): 8544 self.exportLiteralChildren(outfile, level, name_)
8545 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8546 pass
8547 - def exportLiteralChildren(self, outfile, level, name_):
8548 showIndent(outfile, level) 8549 outfile.write('Object_Collection=[\n') 8550 level += 1 8551 for Object_Collection_ in self.Object_Collection: 8552 showIndent(outfile, level) 8553 outfile.write('model_.ObjectCollectionType(\n') 8554 Object_Collection_.exportLiteral(outfile, level, name_='ObjectCollectionType') 8555 showIndent(outfile, level) 8556 outfile.write('),\n') 8557 level -= 1 8558 showIndent(outfile, level) 8559 outfile.write('],\n')
8560 - def build(self, node):
8561 self.buildAttributes(node, node.attrib, []) 8562 for child in node: 8563 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8564 self.buildChildren(child, node, nodeName_)
8565 - def buildAttributes(self, node, attrs, already_processed):
8566 pass
8567 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8568 if nodeName_ == 'Object_Collection': 8569 obj_ = ObjectCollectionType.factory() 8570 obj_.build(child_) 8571 self.Object_Collection.append(obj_)
8572 # end class Object_Collection_PoolType 8573 8574
8575 -class EffectsType(GeneratedsSuper):
8576 subclass = None 8577 superclass = None
8578 - def __init__(self, Effect=None):
8579 if Effect is None: 8580 self.Effect = [] 8581 else: 8582 self.Effect = Effect
8583 - def factory(*args_, **kwargs_):
8584 if EffectsType.subclass: 8585 return EffectsType.subclass(*args_, **kwargs_) 8586 else: 8587 return EffectsType(*args_, **kwargs_)
8588 factory = staticmethod(factory)
8589 - def get_Effect(self): return self.Effect
8590 - def set_Effect(self, Effect): self.Effect = Effect
8591 - def add_Effect(self, value): self.Effect.append(value)
8592 - def insert_Effect(self, index, value): self.Effect[index] = value
8593 - def export(self, outfile, level, namespace_='maec:', name_='EffectsType', namespacedef_=''):
8594 showIndent(outfile, level) 8595 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8596 already_processed = [] 8597 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectsType') 8598 if self.hasContent_(): 8599 outfile.write('>\n') 8600 self.exportChildren(outfile, level + 1, namespace_, name_) 8601 showIndent(outfile, level) 8602 outfile.write('</%s%s>\n' % (namespace_, name_)) 8603 else: 8604 outfile.write('/>\n')
8605 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectsType'):
8606 pass
8607 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectsType', fromsubclass_=False):
8608 for Effect_ in self.Effect: 8609 Effect_.export(outfile, level, namespace_, name_='Effect')
8610 - def hasContent_(self):
8611 if ( 8612 self.Effect 8613 ): 8614 return True 8615 else: 8616 return False
8617 - def exportLiteral(self, outfile, level, name_='EffectsType'):
8618 level += 1 8619 self.exportLiteralAttributes(outfile, level, [], name_) 8620 if self.hasContent_(): 8621 self.exportLiteralChildren(outfile, level, name_)
8622 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8623 pass
8624 - def exportLiteralChildren(self, outfile, level, name_):
8625 showIndent(outfile, level) 8626 outfile.write('Effect=[\n') 8627 level += 1 8628 for Effect_ in self.Effect: 8629 showIndent(outfile, level) 8630 outfile.write('model_.EffectType(\n') 8631 Effect_.exportLiteral(outfile, level, name_='EffectType') 8632 showIndent(outfile, level) 8633 outfile.write('),\n') 8634 level -= 1 8635 showIndent(outfile, level) 8636 outfile.write('],\n')
8637 - def build(self, node):
8638 self.buildAttributes(node, node.attrib, []) 8639 for child in node: 8640 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8641 self.buildChildren(child, node, nodeName_)
8642 - def buildAttributes(self, node, attrs, already_processed):
8643 pass
8644 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8645 if nodeName_ == 'Effect': 8646 obj_ = EffectType.factory() 8647 obj_.build(child_) 8648 self.Effect.append(obj_)
8649 # end class EffectsType 8650 8651
8652 -class PurposeType(GeneratedsSuper):
8653 subclass = None 8654 superclass = None
8655 - def __init__(self, Description=None, Attempted_Vulnerability_Exploit=None):
8656 self.Description = Description 8657 self.Attempted_Vulnerability_Exploit = Attempted_Vulnerability_Exploit
8658 - def factory(*args_, **kwargs_):
8659 if PurposeType.subclass: 8660 return PurposeType.subclass(*args_, **kwargs_) 8661 else: 8662 return PurposeType(*args_, **kwargs_)
8663 factory = staticmethod(factory)
8664 - def get_Description(self): return self.Description
8665 - def set_Description(self, Description): self.Description = Description
8666 - def get_Attempted_Vulnerability_Exploit(self): return self.Attempted_Vulnerability_Exploit
8667 - def set_Attempted_Vulnerability_Exploit(self, Attempted_Vulnerability_Exploit): self.Attempted_Vulnerability_Exploit = Attempted_Vulnerability_Exploit
8668 - def export(self, outfile, level, namespace_='maec:', name_='PurposeType', namespacedef_=''):
8669 showIndent(outfile, level) 8670 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8671 already_processed = [] 8672 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PurposeType') 8673 if self.hasContent_(): 8674 outfile.write('>\n') 8675 self.exportChildren(outfile, level + 1, namespace_, name_) 8676 showIndent(outfile, level) 8677 outfile.write('</%s%s>\n' % (namespace_, name_)) 8678 else: 8679 outfile.write('/>\n')
8680 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PurposeType'):
8681 pass
8682 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PurposeType', fromsubclass_=False):
8683 if self.Description is not None: 8684 self.Description.export(outfile, level, namespace_, name_='Description') 8685 if self.Attempted_Vulnerability_Exploit is not None: 8686 self.Attempted_Vulnerability_Exploit.export(outfile, level, namespace_, name_='Attempted_Vulnerability_Exploit')
8687 - def hasContent_(self):
8688 if ( 8689 self.Description is not None or 8690 self.Attempted_Vulnerability_Exploit is not None 8691 ): 8692 return True 8693 else: 8694 return False
8695 - def exportLiteral(self, outfile, level, name_='PurposeType'):
8696 level += 1 8697 self.exportLiteralAttributes(outfile, level, [], name_) 8698 if self.hasContent_(): 8699 self.exportLiteralChildren(outfile, level, name_)
8700 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8701 pass
8702 - def exportLiteralChildren(self, outfile, level, name_):
8703 if self.Description is not None: 8704 showIndent(outfile, level) 8705 outfile.write('Description=model_.StructuredTextType(\n') 8706 self.Description.exportLiteral(outfile, level, name_='Description') 8707 showIndent(outfile, level) 8708 outfile.write('),\n') 8709 if self.Attempted_Vulnerability_Exploit is not None: 8710 showIndent(outfile, level) 8711 outfile.write('Attempted_Vulnerability_Exploit=model_.Attempted_Vulnerability_ExploitType(\n') 8712 self.Attempted_Vulnerability_Exploit.exportLiteral(outfile, level, name_='Attempted_Vulnerability_Exploit') 8713 showIndent(outfile, level) 8714 outfile.write('),\n')
8715 - def build(self, node):
8716 self.buildAttributes(node, node.attrib, []) 8717 for child in node: 8718 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8719 self.buildChildren(child, node, nodeName_)
8720 - def buildAttributes(self, node, attrs, already_processed):
8721 pass
8722 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8723 if nodeName_ == 'Description': 8724 obj_ = StructuredTextType.factory() 8725 obj_.build(child_) 8726 self.set_Description(obj_) 8727 elif nodeName_ == 'Attempted_Vulnerability_Exploit': 8728 obj_ = Attempted_Vulnerability_ExploitType.factory() 8729 obj_.build(child_) 8730 self.set_Attempted_Vulnerability_Exploit(obj_)
8731 # end class PurposeType 8732 8733
8734 -class Attempted_Vulnerability_ExploitType(GeneratedsSuper):
8735 """This field refers to whether the vulnerability that is being 8736 exploited is known or unknown. Only known vulnerabilities will 8737 have an associated CPE identifier. Possible values: Known, 8738 Unknown.""" 8739 subclass = None 8740 superclass = None
8741 - def __init__(self, vulnerability_type=None, Known_Exploit=None):
8742 self.vulnerability_type = _cast(None, vulnerability_type) 8743 self.Known_Exploit = Known_Exploit
8744 - def factory(*args_, **kwargs_):
8745 if Attempted_Vulnerability_ExploitType.subclass: 8746 return Attempted_Vulnerability_ExploitType.subclass(*args_, **kwargs_) 8747 else: 8748 return Attempted_Vulnerability_ExploitType(*args_, **kwargs_)
8749 factory = staticmethod(factory)
8750 - def get_Known_Exploit(self): return self.Known_Exploit
8751 - def set_Known_Exploit(self, Known_Exploit): self.Known_Exploit = Known_Exploit
8752 - def get_vulnerability_type(self): return self.vulnerability_type
8753 - def set_vulnerability_type(self, vulnerability_type): self.vulnerability_type = vulnerability_type
8754 - def export(self, outfile, level, namespace_='maec:', name_='Attempted_Vulnerability_ExploitType', namespacedef_=''):
8755 showIndent(outfile, level) 8756 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8757 already_processed = [] 8758 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Attempted_Vulnerability_ExploitType') 8759 if self.hasContent_(): 8760 outfile.write('>\n') 8761 self.exportChildren(outfile, level + 1, namespace_, name_) 8762 showIndent(outfile, level) 8763 outfile.write('</%s%s>\n' % (namespace_, name_)) 8764 else: 8765 outfile.write('/>\n')
8766 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Attempted_Vulnerability_ExploitType'):
8767 if self.vulnerability_type is not None and 'vulnerability_type' not in already_processed: 8768 already_processed.append('vulnerability_type') 8769 outfile.write(' vulnerability_type=%s' % (self.gds_format_string(quote_attrib(self.vulnerability_type).encode(ExternalEncoding), input_name='vulnerability_type'), ))
8770 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Attempted_Vulnerability_ExploitType', fromsubclass_=False):
8771 if self.Known_Exploit is not None: 8772 self.Known_Exploit.export(outfile, level, namespace_, name_='Known_Exploit', )
8773 - def hasContent_(self):
8774 if ( 8775 self.Known_Exploit is not None 8776 ): 8777 return True 8778 else: 8779 return False
8780 - def exportLiteral(self, outfile, level, name_='Attempted_Vulnerability_ExploitType'):
8781 level += 1 8782 self.exportLiteralAttributes(outfile, level, [], name_) 8783 if self.hasContent_(): 8784 self.exportLiteralChildren(outfile, level, name_)
8785 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8786 if self.vulnerability_type is not None and 'vulnerability_type' not in already_processed: 8787 already_processed.append('vulnerability_type') 8788 showIndent(outfile, level) 8789 outfile.write('vulnerability_type = "%s",\n' % (self.vulnerability_type,))
8790 - def exportLiteralChildren(self, outfile, level, name_):
8791 if self.Known_Exploit is not None: 8792 showIndent(outfile, level) 8793 outfile.write('Known_Exploit=model_.CVEVulnerabilityType(\n') 8794 self.Known_Exploit.exportLiteral(outfile, level, name_='Known_Exploit') 8795 showIndent(outfile, level) 8796 outfile.write('),\n')
8797 - def build(self, node):
8798 self.buildAttributes(node, node.attrib, []) 8799 for child in node: 8800 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8801 self.buildChildren(child, node, nodeName_)
8802 - def buildAttributes(self, node, attrs, already_processed):
8803 value = find_attr_value_('vulnerability_type', node) 8804 if value is not None and 'vulnerability_type' not in already_processed: 8805 already_processed.append('vulnerability_type') 8806 self.vulnerability_type = value
8807 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8808 if nodeName_ == 'Known_Exploit': 8809 obj_ = CVEVulnerabilityType.factory() 8810 obj_.build(child_) 8811 self.set_Known_Exploit(obj_)
8812 # end class Attempted_Vulnerability_ExploitType 8813 8814
8815 -class ActionsType1(GeneratedsSuper):
8816 subclass = None 8817 superclass = None
8818 - def __init__(self, Action_Collection=None, Action=None, Action_Reference=None):
8819 if Action_Collection is None: 8820 self.Action_Collection = [] 8821 else: 8822 self.Action_Collection = Action_Collection 8823 if Action is None: 8824 self.Action = [] 8825 else: 8826 self.Action = Action 8827 if Action_Reference is None: 8828 self.Action_Reference = [] 8829 else: 8830 self.Action_Reference = Action_Reference
8831 - def factory(*args_, **kwargs_):
8832 if ActionsType1.subclass: 8833 return ActionsType1.subclass(*args_, **kwargs_) 8834 else: 8835 return ActionsType1(*args_, **kwargs_)
8836 factory = staticmethod(factory)
8837 - def get_Action_Collection(self): return self.Action_Collection
8838 - def set_Action_Collection(self, Action_Collection): self.Action_Collection = Action_Collection
8839 - def add_Action_Collection(self, value): self.Action_Collection.append(value)
8840 - def insert_Action_Collection(self, index, value): self.Action_Collection[index] = value
8841 - def get_Action(self): return self.Action
8842 - def set_Action(self, Action): self.Action = Action
8843 - def add_Action(self, value): self.Action.append(value)
8844 - def insert_Action(self, index, value): self.Action[index] = value
8845 - def get_Action_Reference(self): return self.Action_Reference
8846 - def set_Action_Reference(self, Action_Reference): self.Action_Reference = Action_Reference
8847 - def add_Action_Reference(self, value): self.Action_Reference.append(value)
8848 - def insert_Action_Reference(self, index, value): self.Action_Reference[index] = value
8849 - def export(self, outfile, level, namespace_='maec:', name_='ActionsType1', namespacedef_=''):
8850 showIndent(outfile, level) 8851 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8852 already_processed = [] 8853 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionsType1') 8854 if self.hasContent_(): 8855 outfile.write('>\n') 8856 self.exportChildren(outfile, level + 1, namespace_, name_) 8857 showIndent(outfile, level) 8858 outfile.write('</%s%s>\n' % (namespace_, name_)) 8859 else: 8860 outfile.write('/>\n')
8861 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionsType1'):
8862 pass
8863 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionsType1', fromsubclass_=False):
8864 for Action_Collection_ in self.Action_Collection: 8865 Action_Collection_.export(outfile, level, namespace_, name_='Action_Collection') 8866 for Action_ in self.Action: 8867 Action_.export(outfile, level, namespace_, name_='Action') 8868 for Action_Reference_ in self.Action_Reference: 8869 Action_Reference_.export(outfile, level, namespace_, name_='Action_Reference')
8870 - def hasContent_(self):
8871 if ( 8872 self.Action_Collection or 8873 self.Action or 8874 self.Action_Reference 8875 ): 8876 return True 8877 else: 8878 return False
8879 - def exportLiteral(self, outfile, level, name_='ActionsType1'):
8880 level += 1 8881 self.exportLiteralAttributes(outfile, level, [], name_) 8882 if self.hasContent_(): 8883 self.exportLiteralChildren(outfile, level, name_)
8884 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
8885 pass
8886 - def exportLiteralChildren(self, outfile, level, name_):
8887 showIndent(outfile, level) 8888 outfile.write('Action_Collection=[\n') 8889 level += 1 8890 for Action_Collection_ in self.Action_Collection: 8891 showIndent(outfile, level) 8892 outfile.write('model_.ActionCollectionType(\n') 8893 Action_Collection_.exportLiteral(outfile, level, name_='ActionCollectionType') 8894 showIndent(outfile, level) 8895 outfile.write('),\n') 8896 level -= 1 8897 showIndent(outfile, level) 8898 outfile.write('],\n') 8899 showIndent(outfile, level) 8900 outfile.write('Action=[\n') 8901 level += 1 8902 for Action_ in self.Action: 8903 showIndent(outfile, level) 8904 outfile.write('model_.ActionType(\n') 8905 Action_.exportLiteral(outfile, level, name_='ActionType') 8906 showIndent(outfile, level) 8907 outfile.write('),\n') 8908 level -= 1 8909 showIndent(outfile, level) 8910 outfile.write('],\n') 8911 showIndent(outfile, level) 8912 outfile.write('Action_Reference=[\n') 8913 level += 1 8914 for Action_Reference_ in self.Action_Reference: 8915 showIndent(outfile, level) 8916 outfile.write('model_.ActionReferenceType(\n') 8917 Action_Reference_.exportLiteral(outfile, level, name_='ActionReferenceType') 8918 showIndent(outfile, level) 8919 outfile.write('),\n') 8920 level -= 1 8921 showIndent(outfile, level) 8922 outfile.write('],\n')
8923 - def build(self, node):
8924 self.buildAttributes(node, node.attrib, []) 8925 for child in node: 8926 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 8927 self.buildChildren(child, node, nodeName_)
8928 - def buildAttributes(self, node, attrs, already_processed):
8929 pass
8930 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8931 if nodeName_ == 'Action_Collection': 8932 obj_ = ActionCollectionType.factory() 8933 obj_.build(child_) 8934 self.Action_Collection.append(obj_) 8935 elif nodeName_ == 'Action': 8936 obj_ = ActionType.factory() 8937 obj_.build(child_) 8938 self.Action.append(obj_) 8939 elif nodeName_ == 'Action_Reference': 8940 obj_ = ActionReferenceType.factory() 8941 obj_.build(child_) 8942 self.Action_Reference.append(obj_)
8943 # end class ActionsType1 8944 8945
8946 -class ObjectsType(GeneratedsSuper):
8947 subclass = None 8948 superclass = None
8949 - def __init__(self, Object_Reference=None, Object=None):
8950 if Object_Reference is None: 8951 self.Object_Reference = [] 8952 else: 8953 self.Object_Reference = Object_Reference 8954 if Object is None: 8955 self.Object = [] 8956 else: 8957 self.Object = Object
8958 - def factory(*args_, **kwargs_):
8959 if ObjectsType.subclass: 8960 return ObjectsType.subclass(*args_, **kwargs_) 8961 else: 8962 return ObjectsType(*args_, **kwargs_)
8963 factory = staticmethod(factory)
8964 - def get_Object_Reference(self): return self.Object_Reference
8965 - def set_Object_Reference(self, Object_Reference): self.Object_Reference = Object_Reference
8966 - def add_Object_Reference(self, value): self.Object_Reference.append(value)
8967 - def insert_Object_Reference(self, index, value): self.Object_Reference[index] = value
8968 - def get_Object(self): return self.Object
8969 - def set_Object(self, Object): self.Object = Object
8970 - def add_Object(self, value): self.Object.append(value)
8971 - def insert_Object(self, index, value): self.Object[index] = value
8972 - def export(self, outfile, level, namespace_='maec:', name_='ObjectsType', namespacedef_=''):
8973 showIndent(outfile, level) 8974 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 8975 already_processed = [] 8976 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectsType') 8977 if self.hasContent_(): 8978 outfile.write('>\n') 8979 self.exportChildren(outfile, level + 1, namespace_, name_) 8980 showIndent(outfile, level) 8981 outfile.write('</%s%s>\n' % (namespace_, name_)) 8982 else: 8983 outfile.write('/>\n')
8984 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectsType'):
8985 pass
8986 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectsType', fromsubclass_=False):
8987 for Object_Reference_ in self.Object_Reference: 8988 Object_Reference_.export(outfile, level, namespace_, name_='Object_Reference') 8989 for Object_ in self.Object: 8990 Object_.export(outfile, level, namespace_, name_='Object')
8991 - def hasContent_(self):
8992 if ( 8993 self.Object_Reference or 8994 self.Object 8995 ): 8996 return True 8997 else: 8998 return False
8999 - def exportLiteral(self, outfile, level, name_='ObjectsType'):
9000 level += 1 9001 self.exportLiteralAttributes(outfile, level, [], name_) 9002 if self.hasContent_(): 9003 self.exportLiteralChildren(outfile, level, name_)
9004 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
9005 pass
9006 - def exportLiteralChildren(self, outfile, level, name_):
9007 showIndent(outfile, level) 9008 outfile.write('Object_Reference=[\n') 9009 level += 1 9010 for Object_Reference_ in self.Object_Reference: 9011 showIndent(outfile, level) 9012 outfile.write('model_.ObjectReferenceType(\n') 9013 Object_Reference_.exportLiteral(outfile, level, name_='ObjectReferenceType') 9014 showIndent(outfile, level) 9015 outfile.write('),\n') 9016 level -= 1 9017 showIndent(outfile, level) 9018 outfile.write('],\n') 9019 showIndent(outfile, level) 9020 outfile.write('Object=[\n') 9021 level += 1 9022 for Object_ in self.Object: 9023 showIndent(outfile, level) 9024 outfile.write('model_.ObjectType(\n') 9025 Object_.exportLiteral(outfile, level, name_='ObjectType') 9026 showIndent(outfile, level) 9027 outfile.write('),\n') 9028 level -= 1 9029 showIndent(outfile, level) 9030 outfile.write('],\n')
9031 - def build(self, node):
9032 self.buildAttributes(node, node.attrib, []) 9033 for child in node: 9034 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 9035 self.buildChildren(child, node, nodeName_)
9036 - def buildAttributes(self, node, attrs, already_processed):
9037 pass
9038 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9039 if nodeName_ == 'Object_Reference': 9040 obj_ = ObjectReferenceType.factory() 9041 obj_.build(child_) 9042 self.Object_Reference.append(obj_) 9043 elif nodeName_ == 'Object': 9044 obj_ = ObjectType.factory() 9045 obj_.build(child_) 9046 self.Object.append(obj_)
9047 # end class ObjectsType 9048 9049
9050 -class EffectsType1(GeneratedsSuper):
9051 subclass = None 9052 superclass = None
9053 - def __init__(self, Effect=None, Effect_Reference=None):
9054 if Effect is None: 9055 self.Effect = [] 9056 else: 9057 self.Effect = Effect 9058 if Effect_Reference is None: 9059 self.Effect_Reference = [] 9060 else: 9061 self.Effect_Reference = Effect_Reference
9062 - def factory(*args_, **kwargs_):
9063 if EffectsType1.subclass: 9064 return EffectsType1.subclass(*args_, **kwargs_) 9065 else: 9066 return EffectsType1(*args_, **kwargs_)
9067 factory = staticmethod(factory)
9068 - def get_Effect(self): return self.Effect
9069 - def set_Effect(self, Effect): self.Effect = Effect
9070 - def add_Effect(self, value): self.Effect.append(value)
9071 - def insert_Effect(self, index, value): self.Effect[index] = value
9072 - def get_Effect_Reference(self): return self.Effect_Reference
9073 - def set_Effect_Reference(self, Effect_Reference): self.Effect_Reference = Effect_Reference
9074 - def add_Effect_Reference(self, value): self.Effect_Reference.append(value)
9075 - def insert_Effect_Reference(self, index, value): self.Effect_Reference[index] = value
9076 - def export(self, outfile, level, namespace_='maec:', name_='EffectsType1', namespacedef_=''):
9077 showIndent(outfile, level) 9078 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 9079 already_processed = [] 9080 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectsType1') 9081 if self.hasContent_(): 9082 outfile.write('>\n') 9083 self.exportChildren(outfile, level + 1, namespace_, name_) 9084 showIndent(outfile, level) 9085 outfile.write('</%s%s>\n' % (namespace_, name_)) 9086 else: 9087 outfile.write('/>\n')
9088 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectsType1'):
9089 pass
9090 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectsType1', fromsubclass_=False):
9091 for Effect_ in self.Effect: 9092 Effect_.export(outfile, level, namespace_, name_='Effect') 9093 for Effect_Reference_ in self.Effect_Reference: 9094 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
9095 - def hasContent_(self):
9096 if ( 9097 self.Effect or 9098 self.Effect_Reference 9099 ): 9100 return True 9101 else: 9102 return False
9103 - def exportLiteral(self, outfile, level, name_='EffectsType1'):
9104 level += 1 9105 self.exportLiteralAttributes(outfile, level, [], name_) 9106 if self.hasContent_(): 9107 self.exportLiteralChildren(outfile, level, name_)
9108 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
9109 pass
9110 - def exportLiteralChildren(self, outfile, level, name_):
9111 showIndent(outfile, level) 9112 outfile.write('Effect=[\n') 9113 level += 1 9114 for Effect_ in self.Effect: 9115 showIndent(outfile, level) 9116 outfile.write('model_.EffectType(\n') 9117 Effect_.exportLiteral(outfile, level, name_='EffectType') 9118 showIndent(outfile, level) 9119 outfile.write('),\n') 9120 level -= 1 9121 showIndent(outfile, level) 9122 outfile.write('],\n') 9123 showIndent(outfile, level) 9124 outfile.write('Effect_Reference=[\n') 9125 level += 1 9126 for Effect_Reference_ in self.Effect_Reference: 9127 showIndent(outfile, level) 9128 outfile.write('model_.EffectReferenceType(\n') 9129 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType') 9130 showIndent(outfile, level) 9131 outfile.write('),\n') 9132 level -= 1 9133 showIndent(outfile, level) 9134 outfile.write('],\n')
9135 - def build(self, node):
9136 self.buildAttributes(node, node.attrib, []) 9137 for child in node: 9138 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 9139 self.buildChildren(child, node, nodeName_)
9140 - def buildAttributes(self, node, attrs, already_processed):
9141 pass
9142 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9143 if nodeName_ == 'Effect': 9144 obj_ = EffectType.factory() 9145 obj_.build(child_) 9146 self.Effect.append(obj_) 9147 elif nodeName_ == 'Effect_Reference': 9148 obj_ = EffectReferenceType.factory() 9149 obj_.build(child_) 9150 self.Effect_Reference.append(obj_)
9151 # end class EffectsType1 9152 9153 9228 # end class Related_BehaviorsType 9229 9230 9308 # end class Related_BehaviorType 9309 9310
9311 -class Nature_of_Relationship(GeneratedsSuper):
9312 """This field defines the relationship between the characterized 9313 behavior and the one being referenced. Possible values: 9314 Following_Dependency, Preceding_Dependency, Other.""" 9315 subclass = None 9316 superclass = None
9317 - def __init__(self):
9318 pass
9319 - def factory(*args_, **kwargs_):
9320 if Nature_of_Relationship.subclass: 9321 return Nature_of_Relationship.subclass(*args_, **kwargs_) 9322 else: 9323 return Nature_of_Relationship(*args_, **kwargs_)
9324 factory = staticmethod(factory)
9325 - def export(self, outfile, level, namespace_='maec:', name_='Nature_of_Relationship', namespacedef_=''):
9326 showIndent(outfile, level) 9327 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 9328 already_processed = [] 9329 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Nature_of_Relationship') 9330 if self.hasContent_(): 9331 outfile.write('>\n') 9332 self.exportChildren(outfile, level + 1, namespace_, name_) 9333 outfile.write('</%s%s>\n' % (namespace_, name_)) 9334 else: 9335 outfile.write('/>\n')
9336 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Nature_of_Relationship'):
9337 pass
9338 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Nature_of_Relationship', fromsubclass_=False):
9339 pass
9340 - def hasContent_(self):
9341 if ( 9342 9343 ): 9344 return True 9345 else: 9346 return False
9347 - def exportLiteral(self, outfile, level, name_='Nature_of_Relationship'):
9348 level += 1 9349 self.exportLiteralAttributes(outfile, level, [], name_) 9350 if self.hasContent_(): 9351 self.exportLiteralChildren(outfile, level, name_)
9352 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
9353 pass
9354 - def exportLiteralChildren(self, outfile, level, name_):
9355 pass
9356 - def build(self, node):
9357 self.buildAttributes(node, node.attrib, []) 9358 for child in node: 9359 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 9360 self.buildChildren(child, node, nodeName_)
9361 - def buildAttributes(self, node, attrs, already_processed):
9362 pass
9363 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9364 pass
9365 # end class Nature_of_Relationship 9366 9367
9368 -class EffectsType2(GeneratedsSuper):
9369 subclass = None 9370 superclass = None
9371 - def __init__(self, Effect=None, Effect_Reference=None):
9372 if Effect is None: 9373 self.Effect = [] 9374 else: 9375 self.Effect = Effect 9376 if Effect_Reference is None: 9377 self.Effect_Reference = [] 9378 else: 9379 self.Effect_Reference = Effect_Reference
9380 - def factory(*args_, **kwargs_):
9381 if EffectsType2.subclass: 9382 return EffectsType2.subclass(*args_, **kwargs_) 9383 else: 9384 return EffectsType2(*args_, **kwargs_)
9385 factory = staticmethod(factory)
9386 - def get_Effect(self): return self.Effect
9387 - def set_Effect(self, Effect): self.Effect = Effect
9388 - def add_Effect(self, value): self.Effect.append(value)
9389 - def insert_Effect(self, index, value): self.Effect[index] = value
9390 - def get_Effect_Reference(self): return self.Effect_Reference
9391 - def set_Effect_Reference(self, Effect_Reference): self.Effect_Reference = Effect_Reference
9392 - def add_Effect_Reference(self, value): self.Effect_Reference.append(value)
9393 - def insert_Effect_Reference(self, index, value): self.Effect_Reference[index] = value
9394 - def export(self, outfile, level, namespace_='maec:', name_='EffectsType2', namespacedef_=''):
9395 showIndent(outfile, level) 9396 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 9397 already_processed = [] 9398 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectsType2') 9399 if self.hasContent_(): 9400 outfile.write('>\n') 9401 self.exportChildren(outfile, level + 1, namespace_, name_) 9402 showIndent(outfile, level) 9403 outfile.write('</%s%s>\n' % (namespace_, name_)) 9404 else: 9405 outfile.write('/>\n')
9406 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectsType2'):
9407 pass
9408 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectsType2', fromsubclass_=False):
9409 for Effect_ in self.Effect: 9410 Effect_.export(outfile, level, namespace_, name_='Effect') 9411 for Effect_Reference_ in self.Effect_Reference: 9412 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
9413 - def hasContent_(self):
9414 if ( 9415 self.Effect or 9416 self.Effect_Reference 9417 ): 9418 return True 9419 else: 9420 return False
9421 - def exportLiteral(self, outfile, level, name_='EffectsType2'):
9422 level += 1 9423 self.exportLiteralAttributes(outfile, level, [], name_) 9424 if self.hasContent_(): 9425 self.exportLiteralChildren(outfile, level, name_)
9426 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
9427 pass
9428 - def exportLiteralChildren(self, outfile, level, name_):
9429 showIndent(outfile, level) 9430 outfile.write('Effect=[\n') 9431 level += 1 9432 for Effect_ in self.Effect: 9433 showIndent(outfile, level) 9434 outfile.write('model_.EffectType(\n') 9435 Effect_.exportLiteral(outfile, level, name_='EffectType') 9436 showIndent(outfile, level) 9437 outfile.write('),\n') 9438 level -= 1 9439 showIndent(outfile, level) 9440 outfile.write('],\n') 9441 showIndent(outfile, level) 9442 outfile.write('Effect_Reference=[\n') 9443 level += 1 9444 for Effect_Reference_ in self.Effect_Reference: 9445 showIndent(outfile, level) 9446 outfile.write('model_.EffectReferenceType(\n') 9447 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType') 9448 showIndent(outfile, level) 9449 outfile.write('),\n') 9450 level -= 1 9451 showIndent(outfile, level) 9452 outfile.write('],\n')
9453 - def build(self, node):
9454 self.buildAttributes(node, node.attrib, []) 9455 for child in node: 9456 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 9457 self.buildChildren(child, node, nodeName_)
9458 - def buildAttributes(self, node, attrs, already_processed):
9459 pass
9460 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9461 if nodeName_ == 'Effect': 9462 obj_ = EffectType.factory() 9463 obj_.build(child_) 9464 self.Effect.append(obj_) 9465 elif nodeName_ == 'Effect_Reference': 9466 obj_ = EffectReferenceType.factory() 9467 obj_.build(child_) 9468 self.Effect_Reference.append(obj_)
9469 # end class EffectsType2 9470 9471
9472 -class Action_InitiatorType(GeneratedsSuper):
9473 """This attribute is used to state the type of object which initiated 9474 the action. Possible values: Process, Other.""" 9475 subclass = None 9476 superclass = None
9477 - def __init__(self, type_=None, Initiator_Object=None):
9478 self.type_ = _cast(None, type_) 9479 self.Initiator_Object = Initiator_Object
9480 - def factory(*args_, **kwargs_):
9481 if Action_InitiatorType.subclass: 9482 return Action_InitiatorType.subclass(*args_, **kwargs_) 9483 else: 9484 return Action_InitiatorType(*args_, **kwargs_)
9485 factory = staticmethod(factory)
9486 - def get_Initiator_Object(self): return self.Initiator_Object
9487 - def set_Initiator_Object(self, Initiator_Object): self.Initiator_Object = Initiator_Object
9488 - def get_type(self): return self.type_
9489 - def set_type(self, type_): self.type_ = type_
9490 - def export(self, outfile, level, namespace_='maec:', name_='Action_InitiatorType', namespacedef_=''):
9491 showIndent(outfile, level) 9492 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 9493 already_processed = [] 9494 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Action_InitiatorType') 9495 if self.hasContent_(): 9496 outfile.write('>\n') 9497 self.exportChildren(outfile, level + 1, namespace_, name_) 9498 showIndent(outfile, level) 9499 outfile.write('</%s%s>\n' % (namespace_, name_)) 9500 else: 9501 outfile.write('/>\n')
9502 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Action_InitiatorType'):
9503 if self.type_ is not None and 'type_' not in already_processed: 9504 already_processed.append('type_') 9505 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
9506 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Action_InitiatorType', fromsubclass_=False):
9507 if self.Initiator_Object is not None: 9508 self.Initiator_Object.export(outfile, level, namespace_, name_='Initiator_Object')
9509 - def hasContent_(self):
9510 if ( 9511 self.Initiator_Object is not None 9512 ): 9513 return True 9514 else: 9515 return False
9516 - def exportLiteral(self, outfile, level, name_='Action_InitiatorType'):
9517 level += 1 9518 self.exportLiteralAttributes(outfile, level, [], name_) 9519 if self.hasContent_(): 9520 self.exportLiteralChildren(outfile, level, name_)
9521 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
9522 if self.type_ is not None and 'type_' not in already_processed: 9523 already_processed.append('type_') 9524 showIndent(outfile, level) 9525 outfile.write('type_ = "%s",\n' % (self.type_,))
9526 - def exportLiteralChildren(self, outfile, level, name_):
9527 if self.Initiator_Object is not None: 9528 showIndent(outfile, level) 9529 outfile.write('Initiator_Object=model_.ObjectReferenceType(\n') 9530 self.Initiator_Object.exportLiteral(outfile, level, name_='Initiator_Object') 9531 showIndent(outfile, level) 9532 outfile.write('),\n')
9533 - def build(self, node):
9534 self.buildAttributes(node, node.attrib, []) 9535 for child in node: 9536 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 9537 self.buildChildren(child, node, nodeName_)
9538 - def buildAttributes(self, node, attrs, already_processed):
9539 value = find_attr_value_('type', node) 9540 if value is not None and 'type' not in already_processed: 9541 already_processed.append('type') 9542 self.type_ = value
9543 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9544 if nodeName_ == 'Initiator_Object': 9545 obj_ = ObjectReferenceType.factory() 9546 obj_.build(child_) 9547 self.set_Initiator_Object(obj_)
9548 # end class Action_InitiatorType 9549 9550
9551 -class ObjectsType1(GeneratedsSuper):
9552 subclass = None 9553 superclass = None
9554 - def __init__(self, Object_Reference=None, Object=None):
9555 if Object_Reference is None: 9556 self.Object_Reference = [] 9557 else: 9558 self.Object_Reference = Object_Reference 9559 if Object is None: 9560 self.Object = [] 9561 else: 9562 self.Object = Object
9563 - def factory(*args_, **kwargs_):
9564 if ObjectsType1.subclass: 9565 return ObjectsType1.subclass(*args_, **kwargs_) 9566 else: 9567 return ObjectsType1(*args_, **kwargs_)
9568 factory = staticmethod(factory)
9569 - def get_Object_Reference(self): return self.Object_Reference
9570 - def set_Object_Reference(self, Object_Reference): self.Object_Reference = Object_Reference
9571 - def add_Object_Reference(self, value): self.Object_Reference.append(value)
9572 - def insert_Object_Reference(self, index, value): self.Object_Reference[index] = value
9573 - def get_Object(self): return self.Object
9574 - def set_Object(self, Object): self.Object = Object
9575 - def add_Object(self, value): self.Object.append(value)
9576 - def insert_Object(self, index, value): self.Object[index] = value
9577 - def export(self, outfile, level, namespace_='maec:', name_='ObjectsType1', namespacedef_=''):
9578 showIndent(outfile, level) 9579 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 9580 already_processed = [] 9581 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectsType1') 9582 if self.hasContent_(): 9583 outfile.write('>\n') 9584 self.exportChildren(outfile, level + 1, namespace_, name_) 9585 showIndent(outfile, level) 9586 outfile.write('</%s%s>\n' % (namespace_, name_)) 9587 else: 9588 outfile.write('/>\n')
9589 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectsType1'):
9590 pass
9591 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectsType1', fromsubclass_=False):
9592 for Object_Reference_ in self.Object_Reference: 9593 Object_Reference_.export(outfile, level, namespace_, name_='Object_Reference') 9594 for Object_ in self.Object: 9595 Object_.export(outfile, level, namespace_, name_='Object')
9596 - def hasContent_(self):
9597 if ( 9598 self.Object_Reference or 9599 self.Object 9600 ): 9601 return True 9602 else: 9603 return False
9604 - def exportLiteral(self, outfile, level, name_='ObjectsType1'):
9605 level += 1 9606 self.exportLiteralAttributes(outfile, level, [], name_) 9607 if self.hasContent_(): 9608 self.exportLiteralChildren(outfile, level, name_)
9609 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
9610 pass
9611 - def exportLiteralChildren(self, outfile, level, name_):
9612 showIndent(outfile, level) 9613 outfile.write('Object_Reference=[\n') 9614 level += 1 9615 for Object_Reference_ in self.Object_Reference: 9616 showIndent(outfile, level) 9617 outfile.write('model_.ObjectReferenceType(\n') 9618 Object_Reference_.exportLiteral(outfile, level, name_='ObjectReferenceType') 9619 showIndent(outfile, level) 9620 outfile.write('),\n') 9621 level -= 1 9622 showIndent(outfile, level) 9623 outfile.write('],\n') 9624 showIndent(outfile, level) 9625 outfile.write('Object=[\n') 9626 level += 1 9627 for Object_ in self.Object: 9628 showIndent(outfile, level) 9629 outfile.write('model_.ObjectType(\n') 9630 Object_.exportLiteral(outfile, level, name_='ObjectType') 9631 showIndent(outfile, level) 9632 outfile.write('),\n') 9633 level -= 1 9634 showIndent(outfile, level) 9635 outfile.write('],\n')
9636 - def build(self, node):
9637 self.buildAttributes(node, node.attrib, []) 9638 for child in node: 9639 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 9640 self.buildChildren(child, node, nodeName_)
9641 - def buildAttributes(self, node, attrs, already_processed):
9642 pass
9643 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9644 if nodeName_ == 'Object_Reference': 9645 obj_ = ObjectReferenceType.factory() 9646 obj_.build(child_) 9647 self.Object_Reference.append(obj_) 9648 elif nodeName_ == 'Object': 9649 obj_ = ObjectType.factory() 9650 obj_.build(child_) 9651 self.Object.append(obj_)
9652 # end class ObjectsType1 9653 9654
9655 -class EffectsType3(GeneratedsSuper):
9656 subclass = None 9657 superclass = None
9658 - def __init__(self, Effect=None, Effect_Reference=None):
9659 if Effect is None: 9660 self.Effect = [] 9661 else: 9662 self.Effect = Effect 9663 if Effect_Reference is None: 9664 self.Effect_Reference = [] 9665 else: 9666 self.Effect_Reference = Effect_Reference
9667 - def factory(*args_, **kwargs_):
9668 if EffectsType3.subclass: 9669 return EffectsType3.subclass(*args_, **kwargs_) 9670 else: 9671 return EffectsType3(*args_, **kwargs_)
9672 factory = staticmethod(factory)
9673 - def get_Effect(self): return self.Effect
9674 - def set_Effect(self, Effect): self.Effect = Effect
9675 - def add_Effect(self, value): self.Effect.append(value)
9676 - def insert_Effect(self, index, value): self.Effect[index] = value
9677 - def get_Effect_Reference(self): return self.Effect_Reference
9678 - def set_Effect_Reference(self, Effect_Reference): self.Effect_Reference = Effect_Reference
9679 - def add_Effect_Reference(self, value): self.Effect_Reference.append(value)
9680 - def insert_Effect_Reference(self, index, value): self.Effect_Reference[index] = value
9681 - def export(self, outfile, level, namespace_='maec:', name_='EffectsType3', namespacedef_=''):
9682 showIndent(outfile, level) 9683 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 9684 already_processed = [] 9685 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectsType3') 9686 if self.hasContent_(): 9687 outfile.write('>\n') 9688 self.exportChildren(outfile, level + 1, namespace_, name_) 9689 showIndent(outfile, level) 9690 outfile.write('</%s%s>\n' % (namespace_, name_)) 9691 else: 9692 outfile.write('/>\n')
9693 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectsType3'):
9694 pass
9695 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectsType3', fromsubclass_=False):
9696 for Effect_ in self.Effect: 9697 Effect_.export(outfile, level, namespace_, name_='Effect') 9698 for Effect_Reference_ in self.Effect_Reference: 9699 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
9700 - def hasContent_(self):
9701 if ( 9702 self.Effect or 9703 self.Effect_Reference 9704 ): 9705 return True 9706 else: 9707 return False
9708 - def exportLiteral(self, outfile, level, name_='EffectsType3'):
9709 level += 1 9710 self.exportLiteralAttributes(outfile, level, [], name_) 9711 if self.hasContent_(): 9712 self.exportLiteralChildren(outfile, level, name_)
9713 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
9714 pass
9715 - def exportLiteralChildren(self, outfile, level, name_):
9716 showIndent(outfile, level) 9717 outfile.write('Effect=[\n') 9718 level += 1 9719 for Effect_ in self.Effect: 9720 showIndent(outfile, level) 9721 outfile.write('model_.EffectType(\n') 9722 Effect_.exportLiteral(outfile, level, name_='EffectType') 9723 showIndent(outfile, level) 9724 outfile.write('),\n') 9725 level -= 1 9726 showIndent(outfile, level) 9727 outfile.write('],\n') 9728 showIndent(outfile, level) 9729 outfile.write('Effect_Reference=[\n') 9730 level += 1 9731 for Effect_Reference_ in self.Effect_Reference: 9732 showIndent(outfile, level) 9733 outfile.write('model_.EffectReferenceType(\n') 9734 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType') 9735 showIndent(outfile, level) 9736 outfile.write('),\n') 9737 level -= 1 9738 showIndent(outfile, level) 9739 outfile.write('],\n')
9740 - def build(self, node):
9741 self.buildAttributes(node, node.attrib, []) 9742 for child in node: 9743 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 9744 self.buildChildren(child, node, nodeName_)
9745 - def buildAttributes(self, node, attrs, already_processed):
9746 pass
9747 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9748 if nodeName_ == 'Effect': 9749 obj_ = EffectType.factory() 9750 obj_.build(child_) 9751 self.Effect.append(obj_) 9752 elif nodeName_ == 'Effect_Reference': 9753 obj_ = EffectReferenceType.factory() 9754 obj_.build(child_) 9755 self.Effect_Reference.append(obj_)
9756 # end class EffectsType3 9757 9758 9833 # end class Related_ActionsType 9834 9835 9913 # end class Related_ActionType 9914 9915
9916 -class Object_SizeType(GeneratedsSuper):
9917 """This attribute represents the Units used in the object size field. 9918 Possible values are: Bytes, Kilobytes, Megabytes.""" 9919 subclass = None 9920 superclass = None
9921 - def __init__(self, units=None, valueOf_=None):
9922 self.units = _cast(None, units) 9923 self.valueOf_ = valueOf_
9924 - def factory(*args_, **kwargs_):
9925 if Object_SizeType.subclass: 9926 return Object_SizeType.subclass(*args_, **kwargs_) 9927 else: 9928 return Object_SizeType(*args_, **kwargs_)
9929 factory = staticmethod(factory)
9930 - def get_units(self): return self.units
9931 - def set_units(self, units): self.units = units
9932 - def get_valueOf_(self): return self.valueOf_
9933 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
9934 - def export(self, outfile, level, namespace_='maec:', name_='Object_SizeType', namespacedef_=''):
9935 showIndent(outfile, level) 9936 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 9937 already_processed = [] 9938 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Object_SizeType') 9939 if self.hasContent_(): 9940 outfile.write('>') 9941 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 9942 self.exportChildren(outfile, level + 1, namespace_, name_) 9943 outfile.write('</%s%s>\n' % (namespace_, name_)) 9944 else: 9945 outfile.write('/>\n')
9946 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Object_SizeType'):
9947 if self.units is not None and 'units' not in already_processed: 9948 already_processed.append('units') 9949 outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
9950 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Object_SizeType', fromsubclass_=False):
9951 pass
9952 - def hasContent_(self):
9953 if ( 9954 self.valueOf_ 9955 ): 9956 return True 9957 else: 9958 return False
9959 - def exportLiteral(self, outfile, level, name_='Object_SizeType'):
9960 level += 1 9961 self.exportLiteralAttributes(outfile, level, [], name_) 9962 if self.hasContent_(): 9963 self.exportLiteralChildren(outfile, level, name_) 9964 showIndent(outfile, level) 9965 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
9966 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
9967 if self.units is not None and 'units' not in already_processed: 9968 already_processed.append('units') 9969 showIndent(outfile, level) 9970 outfile.write('units = "%s",\n' % (self.units,))
9971 - def exportLiteralChildren(self, outfile, level, name_):
9972 pass
9973 - def build(self, node):
9974 self.buildAttributes(node, node.attrib, []) 9975 self.valueOf_ = get_all_text_(node) 9976 for child in node: 9977 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 9978 self.buildChildren(child, node, nodeName_)
9979 - def buildAttributes(self, node, attrs, already_processed):
9980 value = find_attr_value_('units', node) 9981 if value is not None and 'units' not in already_processed: 9982 already_processed.append('units') 9983 self.units = value
9984 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9985 pass
9986 # end class Object_SizeType 9987 9988
9989 -class ClassificationsType(GeneratedsSuper):
9990 subclass = None 9991 superclass = None
9992 - def __init__(self, Classification=None):
9993 if Classification is None: 9994 self.Classification = [] 9995 else: 9996 self.Classification = Classification
9997 - def factory(*args_, **kwargs_):
9998 if ClassificationsType.subclass: 9999 return ClassificationsType.subclass(*args_, **kwargs_) 10000 else: 10001 return ClassificationsType(*args_, **kwargs_)
10002 factory = staticmethod(factory)
10003 - def get_Classification(self): return self.Classification
10004 - def set_Classification(self, Classification): self.Classification = Classification
10005 - def add_Classification(self, value): self.Classification.append(value)
10006 - def insert_Classification(self, index, value): self.Classification[index] = value
10007 - def export(self, outfile, level, namespace_='maec:', name_='ClassificationsType', namespacedef_=''):
10008 showIndent(outfile, level) 10009 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10010 already_processed = [] 10011 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClassificationsType') 10012 if self.hasContent_(): 10013 outfile.write('>\n') 10014 self.exportChildren(outfile, level + 1, namespace_, name_) 10015 showIndent(outfile, level) 10016 outfile.write('</%s%s>\n' % (namespace_, name_)) 10017 else: 10018 outfile.write('/>\n')
10019 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ClassificationsType'):
10020 pass
10021 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ClassificationsType', fromsubclass_=False):
10022 for Classification_ in self.Classification: 10023 Classification_.export(outfile, level, namespace_, name_='Classification')
10024 - def hasContent_(self):
10025 if ( 10026 self.Classification 10027 ): 10028 return True 10029 else: 10030 return False
10031 - def exportLiteral(self, outfile, level, name_='ClassificationsType'):
10032 level += 1 10033 self.exportLiteralAttributes(outfile, level, [], name_) 10034 if self.hasContent_(): 10035 self.exportLiteralChildren(outfile, level, name_)
10036 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10037 pass
10038 - def exportLiteralChildren(self, outfile, level, name_):
10039 showIndent(outfile, level) 10040 outfile.write('Classification=[\n') 10041 level += 1 10042 for Classification_ in self.Classification: 10043 showIndent(outfile, level) 10044 outfile.write('model_.classificationObject(\n') 10045 Classification_.exportLiteral(outfile, level, name_='classificationObject') 10046 showIndent(outfile, level) 10047 outfile.write('),\n') 10048 level -= 1 10049 showIndent(outfile, level) 10050 outfile.write('],\n')
10051 - def build(self, node):
10052 self.buildAttributes(node, node.attrib, []) 10053 for child in node: 10054 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10055 self.buildChildren(child, node, nodeName_)
10056 - def buildAttributes(self, node, attrs, already_processed):
10057 pass
10058 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10059 if nodeName_ == 'Classification': 10060 obj_ = classificationObject.factory() 10061 obj_.build(child_) 10062 self.Classification.append(obj_)
10063 # end class ClassificationsType 10064 10065
10066 -class Associated_CodeType(GeneratedsSuper):
10067 subclass = None 10068 superclass = None
10069 - def __init__(self, Associated_Code_Snippet=None):
10070 if Associated_Code_Snippet is None: 10071 self.Associated_Code_Snippet = [] 10072 else: 10073 self.Associated_Code_Snippet = Associated_Code_Snippet
10074 - def factory(*args_, **kwargs_):
10075 if Associated_CodeType.subclass: 10076 return Associated_CodeType.subclass(*args_, **kwargs_) 10077 else: 10078 return Associated_CodeType(*args_, **kwargs_)
10079 factory = staticmethod(factory)
10080 - def get_Associated_Code_Snippet(self): return self.Associated_Code_Snippet
10081 - def set_Associated_Code_Snippet(self, Associated_Code_Snippet): self.Associated_Code_Snippet = Associated_Code_Snippet
10082 - def add_Associated_Code_Snippet(self, value): self.Associated_Code_Snippet.append(value)
10083 - def insert_Associated_Code_Snippet(self, index, value): self.Associated_Code_Snippet[index] = value
10084 - def export(self, outfile, level, namespace_='maec:', name_='Associated_CodeType', namespacedef_=''):
10085 showIndent(outfile, level) 10086 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10087 already_processed = [] 10088 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Associated_CodeType') 10089 if self.hasContent_(): 10090 outfile.write('>\n') 10091 self.exportChildren(outfile, level + 1, namespace_, name_) 10092 showIndent(outfile, level) 10093 outfile.write('</%s%s>\n' % (namespace_, name_)) 10094 else: 10095 outfile.write('/>\n')
10096 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Associated_CodeType'):
10097 pass
10098 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Associated_CodeType', fromsubclass_=False):
10099 for Associated_Code_Snippet_ in self.Associated_Code_Snippet: 10100 Associated_Code_Snippet_.export(outfile, level, namespace_, name_='Associated_Code_Snippet')
10101 - def hasContent_(self):
10102 if ( 10103 self.Associated_Code_Snippet 10104 ): 10105 return True 10106 else: 10107 return False
10108 - def exportLiteral(self, outfile, level, name_='Associated_CodeType'):
10109 level += 1 10110 self.exportLiteralAttributes(outfile, level, [], name_) 10111 if self.hasContent_(): 10112 self.exportLiteralChildren(outfile, level, name_)
10113 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10114 pass
10115 - def exportLiteralChildren(self, outfile, level, name_):
10116 showIndent(outfile, level) 10117 outfile.write('Associated_Code_Snippet=[\n') 10118 level += 1 10119 for Associated_Code_Snippet_ in self.Associated_Code_Snippet: 10120 showIndent(outfile, level) 10121 outfile.write('model_.Associated_Code_SnippetType(\n') 10122 Associated_Code_Snippet_.exportLiteral(outfile, level, name_='Associated_Code_SnippetType') 10123 showIndent(outfile, level) 10124 outfile.write('),\n') 10125 level -= 1 10126 showIndent(outfile, level) 10127 outfile.write('],\n')
10128 - def build(self, node):
10129 self.buildAttributes(node, node.attrib, []) 10130 for child in node: 10131 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10132 self.buildChildren(child, node, nodeName_)
10133 - def buildAttributes(self, node, attrs, already_processed):
10134 pass
10135 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10136 if nodeName_ == 'Associated_Code_Snippet': 10137 obj_ = Associated_Code_SnippetType.factory() 10138 obj_.build(child_) 10139 self.Associated_Code_Snippet.append(obj_)
10140 # end class Associated_CodeType 10141 10142
10143 -class Associated_Code_SnippetType(GeneratedsSuper):
10144 subclass = None 10145 superclass = None
10146 - def __init__(self, Code_Snippet=None, Nature_Of_Relationship=None):
10147 self.Code_Snippet = Code_Snippet 10148 self.Nature_Of_Relationship = Nature_Of_Relationship
10149 - def factory(*args_, **kwargs_):
10150 if Associated_Code_SnippetType.subclass: 10151 return Associated_Code_SnippetType.subclass(*args_, **kwargs_) 10152 else: 10153 return Associated_Code_SnippetType(*args_, **kwargs_)
10154 factory = staticmethod(factory)
10155 - def get_Code_Snippet(self): return self.Code_Snippet
10156 - def set_Code_Snippet(self, Code_Snippet): self.Code_Snippet = Code_Snippet
10158 - def set_Nature_Of_Relationship(self, Nature_Of_Relationship): self.Nature_Of_Relationship = Nature_Of_Relationship
10159 - def export(self, outfile, level, namespace_='maec:', name_='Associated_Code_SnippetType', namespacedef_=''):
10160 showIndent(outfile, level) 10161 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10162 already_processed = [] 10163 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Associated_Code_SnippetType') 10164 if self.hasContent_(): 10165 outfile.write('>\n') 10166 self.exportChildren(outfile, level + 1, namespace_, name_) 10167 showIndent(outfile, level) 10168 outfile.write('</%s%s>\n' % (namespace_, name_)) 10169 else: 10170 outfile.write('/>\n')
10171 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Associated_Code_SnippetType'):
10172 pass
10173 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Associated_Code_SnippetType', fromsubclass_=False):
10174 if self.Code_Snippet is not None: 10175 self.Code_Snippet.export(outfile, level, namespace_, name_='Code_Snippet', ) 10176 if self.Nature_Of_Relationship is not None: 10177 showIndent(outfile, level) 10178 outfile.write('<%sNature_Of_Relationship>%s</%sNature_Of_Relationship>\n' % (namespace_, self.gds_format_string(quote_xml(self.Nature_Of_Relationship).encode(ExternalEncoding), input_name='Nature_Of_Relationship'), namespace_))
10179 - def hasContent_(self):
10180 if ( 10181 self.Code_Snippet is not None or 10182 self.Nature_Of_Relationship is not None 10183 ): 10184 return True 10185 else: 10186 return False
10187 - def exportLiteral(self, outfile, level, name_='Associated_Code_SnippetType'):
10188 level += 1 10189 self.exportLiteralAttributes(outfile, level, [], name_) 10190 if self.hasContent_(): 10191 self.exportLiteralChildren(outfile, level, name_)
10192 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10193 pass
10194 - def exportLiteralChildren(self, outfile, level, name_):
10195 if self.Code_Snippet is not None: 10196 showIndent(outfile, level) 10197 outfile.write('Code_Snippet=model_.CodeType(\n') 10198 self.Code_Snippet.exportLiteral(outfile, level, name_='Code_Snippet') 10199 showIndent(outfile, level) 10200 outfile.write('),\n') 10201 if self.Nature_Of_Relationship is not None: 10202 showIndent(outfile, level) 10203 outfile.write('Nature_Of_Relationship=%s,\n' % quote_python(self.Nature_Of_Relationship).encode(ExternalEncoding))
10204 - def build(self, node):
10205 self.buildAttributes(node, node.attrib, []) 10206 for child in node: 10207 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10208 self.buildChildren(child, node, nodeName_)
10209 - def buildAttributes(self, node, attrs, already_processed):
10210 pass
10211 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10212 if nodeName_ == 'Code_Snippet': 10213 obj_ = CodeType.factory() 10214 obj_.build(child_) 10215 self.set_Code_Snippet(obj_) 10216 elif nodeName_ == 'Nature_Of_Relationship': 10217 Nature_Of_Relationship_ = child_.text 10218 Nature_Of_Relationship_ = self.gds_validate_string(Nature_Of_Relationship_, node, 'Nature_Of_Relationship') 10219 self.Nature_Of_Relationship = Nature_Of_Relationship_
10220 # end class Associated_Code_SnippetType 10221 10222
10223 -class Nature_Of_Relationship(GeneratedsSuper):
10224 """This field defines the relationship between the object and code 10225 segment referenced in this element. Possible values: 10226 Contained_Inside, Created_By, Other.""" 10227 subclass = None 10228 superclass = None
10229 - def __init__(self):
10230 pass
10231 - def factory(*args_, **kwargs_):
10232 if Nature_Of_Relationship.subclass: 10233 return Nature_Of_Relationship.subclass(*args_, **kwargs_) 10234 else: 10235 return Nature_Of_Relationship(*args_, **kwargs_)
10236 factory = staticmethod(factory)
10237 - def export(self, outfile, level, namespace_='maec:', name_='Nature_Of_Relationship', namespacedef_=''):
10238 showIndent(outfile, level) 10239 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10240 already_processed = [] 10241 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Nature_Of_Relationship') 10242 if self.hasContent_(): 10243 outfile.write('>\n') 10244 self.exportChildren(outfile, level + 1, namespace_, name_) 10245 outfile.write('</%s%s>\n' % (namespace_, name_)) 10246 else: 10247 outfile.write('/>\n')
10248 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Nature_Of_Relationship'):
10249 pass
10250 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Nature_Of_Relationship', fromsubclass_=False):
10251 pass
10252 - def hasContent_(self):
10253 if ( 10254 10255 ): 10256 return True 10257 else: 10258 return False
10259 - def exportLiteral(self, outfile, level, name_='Nature_Of_Relationship'):
10260 level += 1 10261 self.exportLiteralAttributes(outfile, level, [], name_) 10262 if self.hasContent_(): 10263 self.exportLiteralChildren(outfile, level, name_)
10264 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10265 pass
10266 - def exportLiteralChildren(self, outfile, level, name_):
10267 pass
10268 - def build(self, node):
10269 self.buildAttributes(node, node.attrib, []) 10270 for child in node: 10271 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10272 self.buildChildren(child, node, nodeName_)
10273 - def buildAttributes(self, node, attrs, already_processed):
10274 pass
10275 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10276 pass
10277 # end class Nature_Of_Relationship 10278 10279 10354 # end class Related_ObjectsType 10355 10356 10434 # end class Related_ObjectType 10435 10436
10437 -class File_System_Object_AttributesType(GeneratedsSuper):
10438 subclass = None 10439 superclass = None
10440 - def __init__(self, DateTime_Created=None, DateTime_Modified=None, Path=None, Hashes=None, Permissions=None, File_Type=None, Packing=None, Pipe_Mode=None, Maximum_Instances=None, Security_Attributes=None, Origin=None, File_Type_Attributes=None):
10441 self.DateTime_Created = DateTime_Created 10442 self.DateTime_Modified = DateTime_Modified 10443 self.Path = Path 10444 self.Hashes = Hashes 10445 self.Permissions = Permissions 10446 self.File_Type = File_Type 10447 self.Packing = Packing 10448 self.Pipe_Mode = Pipe_Mode 10449 self.Maximum_Instances = Maximum_Instances 10450 self.Security_Attributes = Security_Attributes 10451 self.Origin = Origin 10452 self.File_Type_Attributes = File_Type_Attributes
10453 - def factory(*args_, **kwargs_):
10454 if File_System_Object_AttributesType.subclass: 10455 return File_System_Object_AttributesType.subclass(*args_, **kwargs_) 10456 else: 10457 return File_System_Object_AttributesType(*args_, **kwargs_)
10458 factory = staticmethod(factory)
10459 - def get_DateTime_Created(self): return self.DateTime_Created
10460 - def set_DateTime_Created(self, DateTime_Created): self.DateTime_Created = DateTime_Created
10461 - def get_DateTime_Modified(self): return self.DateTime_Modified
10462 - def set_DateTime_Modified(self, DateTime_Modified): self.DateTime_Modified = DateTime_Modified
10463 - def get_Path(self): return self.Path
10464 - def set_Path(self, Path): self.Path = Path
10465 - def get_Hashes(self): return self.Hashes
10466 - def set_Hashes(self, Hashes): self.Hashes = Hashes
10467 - def get_Permissions(self): return self.Permissions
10468 - def set_Permissions(self, Permissions): self.Permissions = Permissions
10469 - def get_File_Type(self): return self.File_Type
10470 - def set_File_Type(self, File_Type): self.File_Type = File_Type
10471 - def get_Packing(self): return self.Packing
10472 - def set_Packing(self, Packing): self.Packing = Packing
10473 - def get_Pipe_Mode(self): return self.Pipe_Mode
10474 - def set_Pipe_Mode(self, Pipe_Mode): self.Pipe_Mode = Pipe_Mode
10475 - def get_Maximum_Instances(self): return self.Maximum_Instances
10476 - def set_Maximum_Instances(self, Maximum_Instances): self.Maximum_Instances = Maximum_Instances
10477 - def get_Security_Attributes(self): return self.Security_Attributes
10478 - def set_Security_Attributes(self, Security_Attributes): self.Security_Attributes = Security_Attributes
10479 - def get_Origin(self): return self.Origin
10480 - def set_Origin(self, Origin): self.Origin = Origin
10481 - def get_File_Type_Attributes(self): return self.File_Type_Attributes
10482 - def set_File_Type_Attributes(self, File_Type_Attributes): self.File_Type_Attributes = File_Type_Attributes
10483 - def export(self, outfile, level, namespace_='maec:', name_='File_System_Object_AttributesType', namespacedef_=''):
10484 showIndent(outfile, level) 10485 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10486 already_processed = [] 10487 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_System_Object_AttributesType') 10488 if self.hasContent_(): 10489 outfile.write('>\n') 10490 self.exportChildren(outfile, level + 1, namespace_, name_) 10491 showIndent(outfile, level) 10492 outfile.write('</%s%s>\n' % (namespace_, name_)) 10493 else: 10494 outfile.write('/>\n')
10495 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_System_Object_AttributesType'):
10496 pass
10497 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_System_Object_AttributesType', fromsubclass_=False):
10498 if self.DateTime_Created is not None: 10499 showIndent(outfile, level) 10500 outfile.write('<%sDateTime_Created>%s</%sDateTime_Created>\n' % (namespace_, self.gds_format_string(quote_xml(self.DateTime_Created).encode(ExternalEncoding), input_name='DateTime_Created'), namespace_)) 10501 if self.DateTime_Modified is not None: 10502 showIndent(outfile, level) 10503 outfile.write('<%sDateTime_Modified>%s</%sDateTime_Modified>\n' % (namespace_, self.gds_format_string(quote_xml(self.DateTime_Modified).encode(ExternalEncoding), input_name='DateTime_Modified'), namespace_)) 10504 if self.Path is not None: 10505 self.Path.export(outfile, level, namespace_, name_='Path') 10506 if self.Hashes is not None: 10507 self.Hashes.export(outfile, level, namespace_, name_='Hashes') 10508 if self.Permissions is not None: 10509 showIndent(outfile, level) 10510 outfile.write('<%sPermissions>%s</%sPermissions>\n' % (namespace_, self.gds_format_string(quote_xml(self.Permissions).encode(ExternalEncoding), input_name='Permissions'), namespace_)) 10511 if self.File_Type is not None: 10512 self.File_Type.export(outfile, level, namespace_, name_='File_Type') 10513 if self.Packing is not None: 10514 self.Packing.export(outfile, level, namespace_, name_='Packing') 10515 if self.Pipe_Mode is not None: 10516 showIndent(outfile, level) 10517 outfile.write('<%sPipe_Mode>%s</%sPipe_Mode>\n' % (namespace_, self.gds_format_string(quote_xml(self.Pipe_Mode).encode(ExternalEncoding), input_name='Pipe_Mode'), namespace_)) 10518 if self.Maximum_Instances is not None: 10519 showIndent(outfile, level) 10520 outfile.write('<%sMaximum_Instances>%s</%sMaximum_Instances>\n' % (namespace_, self.gds_format_integer(self.Maximum_Instances, input_name='Maximum_Instances'), namespace_)) 10521 if self.Security_Attributes is not None: 10522 showIndent(outfile, level) 10523 outfile.write('<%sSecurity_Attributes>%s</%sSecurity_Attributes>\n' % (namespace_, self.gds_format_string(quote_xml(self.Security_Attributes).encode(ExternalEncoding), input_name='Security_Attributes'), namespace_)) 10524 if self.Origin is not None: 10525 self.Origin.export(outfile, level, namespace_, name_='Origin') 10526 if self.File_Type_Attributes is not None: 10527 self.File_Type_Attributes.export(outfile, level, namespace_, name_='File_Type_Attributes')
10528 - def hasContent_(self):
10529 if ( 10530 self.DateTime_Created is not None or 10531 self.DateTime_Modified is not None or 10532 self.Path is not None or 10533 self.Hashes is not None or 10534 self.Permissions is not None or 10535 self.File_Type is not None or 10536 self.Packing is not None or 10537 self.Pipe_Mode is not None or 10538 self.Maximum_Instances is not None or 10539 self.Security_Attributes is not None or 10540 self.Origin is not None or 10541 self.File_Type_Attributes is not None 10542 ): 10543 return True 10544 else: 10545 return False
10546 - def exportLiteral(self, outfile, level, name_='File_System_Object_AttributesType'):
10547 level += 1 10548 self.exportLiteralAttributes(outfile, level, [], name_) 10549 if self.hasContent_(): 10550 self.exportLiteralChildren(outfile, level, name_)
10551 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10552 pass
10553 - def exportLiteralChildren(self, outfile, level, name_):
10554 if self.DateTime_Created is not None: 10555 showIndent(outfile, level) 10556 outfile.write('DateTime_Created=%s,\n' % quote_python(self.DateTime_Created).encode(ExternalEncoding)) 10557 if self.DateTime_Modified is not None: 10558 showIndent(outfile, level) 10559 outfile.write('DateTime_Modified=%s,\n' % quote_python(self.DateTime_Modified).encode(ExternalEncoding)) 10560 if self.Path is not None: 10561 showIndent(outfile, level) 10562 outfile.write('Path=model_.PathType(\n') 10563 self.Path.exportLiteral(outfile, level, name_='Path') 10564 showIndent(outfile, level) 10565 outfile.write('),\n') 10566 if self.Hashes is not None: 10567 showIndent(outfile, level) 10568 outfile.write('Hashes=model_.HashesType(\n') 10569 self.Hashes.exportLiteral(outfile, level, name_='Hashes') 10570 showIndent(outfile, level) 10571 outfile.write('),\n') 10572 if self.Permissions is not None: 10573 showIndent(outfile, level) 10574 outfile.write('Permissions=%s,\n' % quote_python(self.Permissions).encode(ExternalEncoding)) 10575 if self.File_Type is not None: 10576 showIndent(outfile, level) 10577 outfile.write('File_Type=model_.File_TypeType(\n') 10578 self.File_Type.exportLiteral(outfile, level, name_='File_Type') 10579 showIndent(outfile, level) 10580 outfile.write('),\n') 10581 if self.Packing is not None: 10582 showIndent(outfile, level) 10583 outfile.write('Packing=model_.PackingType(\n') 10584 self.Packing.exportLiteral(outfile, level, name_='Packing') 10585 showIndent(outfile, level) 10586 outfile.write('),\n') 10587 if self.Pipe_Mode is not None: 10588 showIndent(outfile, level) 10589 outfile.write('Pipe_Mode=%s,\n' % quote_python(self.Pipe_Mode).encode(ExternalEncoding)) 10590 if self.Maximum_Instances is not None: 10591 showIndent(outfile, level) 10592 outfile.write('Maximum_Instances=%d,\n' % self.Maximum_Instances) 10593 if self.Security_Attributes is not None: 10594 showIndent(outfile, level) 10595 outfile.write('Security_Attributes=%s,\n' % quote_python(self.Security_Attributes).encode(ExternalEncoding)) 10596 if self.Origin is not None: 10597 showIndent(outfile, level) 10598 outfile.write('Origin=model_.uriObject(\n') 10599 self.Origin.exportLiteral(outfile, level, name_='Origin') 10600 showIndent(outfile, level) 10601 outfile.write('),\n') 10602 if self.File_Type_Attributes is not None: 10603 showIndent(outfile, level) 10604 outfile.write('File_Type_Attributes=model_.File_Type_AttributesType(\n') 10605 self.File_Type_Attributes.exportLiteral(outfile, level, name_='File_Type_Attributes') 10606 showIndent(outfile, level) 10607 outfile.write('),\n')
10608 - def build(self, node):
10609 self.buildAttributes(node, node.attrib, []) 10610 for child in node: 10611 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10612 self.buildChildren(child, node, nodeName_)
10613 - def buildAttributes(self, node, attrs, already_processed):
10614 pass
10615 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10616 if nodeName_ == 'DateTime_Created': 10617 DateTime_Created_ = child_.text 10618 DateTime_Created_ = self.gds_validate_string(DateTime_Created_, node, 'DateTime_Created') 10619 self.DateTime_Created = DateTime_Created_ 10620 elif nodeName_ == 'DateTime_Modified': 10621 DateTime_Modified_ = child_.text 10622 DateTime_Modified_ = self.gds_validate_string(DateTime_Modified_, node, 'DateTime_Modified') 10623 self.DateTime_Modified = DateTime_Modified_ 10624 elif nodeName_ == 'Path': 10625 obj_ = PathType.factory() 10626 obj_.build(child_) 10627 self.set_Path(obj_) 10628 elif nodeName_ == 'Hashes': 10629 obj_ = HashesType.factory() 10630 obj_.build(child_) 10631 self.set_Hashes(obj_) 10632 elif nodeName_ == 'Permissions': 10633 Permissions_ = child_.text 10634 Permissions_ = self.gds_validate_string(Permissions_, node, 'Permissions') 10635 self.Permissions = Permissions_ 10636 elif nodeName_ == 'File_Type': 10637 obj_ = File_TypeType.factory() 10638 obj_.build(child_) 10639 self.set_File_Type(obj_) 10640 elif nodeName_ == 'Packing': 10641 obj_ = PackingType.factory() 10642 obj_.build(child_) 10643 self.set_Packing(obj_) 10644 elif nodeName_ == 'Pipe_Mode': 10645 Pipe_Mode_ = child_.text 10646 Pipe_Mode_ = self.gds_validate_string(Pipe_Mode_, node, 'Pipe_Mode') 10647 self.Pipe_Mode = Pipe_Mode_ 10648 elif nodeName_ == 'Maximum_Instances': 10649 sval_ = child_.text 10650 try: 10651 ival_ = int(sval_) 10652 except (TypeError, ValueError) as e: 10653 raise_parse_error(child_, 'requires integer: %s' % e) 10654 ival_ = self.gds_validate_integer(ival_, node, 'Maximum_Instances') 10655 self.Maximum_Instances = ival_ 10656 elif nodeName_ == 'Security_Attributes': 10657 Security_Attributes_ = child_.text 10658 Security_Attributes_ = self.gds_validate_string(Security_Attributes_, node, 'Security_Attributes') 10659 self.Security_Attributes = Security_Attributes_ 10660 elif nodeName_ == 'Origin': 10661 obj_ = uriObject.factory() 10662 obj_.build(child_) 10663 self.set_Origin(obj_) 10664 elif nodeName_ == 'File_Type_Attributes': 10665 obj_ = File_Type_AttributesType.factory() 10666 obj_.build(child_) 10667 self.set_File_Type_Attributes(obj_)
10668 # end class File_System_Object_AttributesType 10669 10670
10671 -class PathType(GeneratedsSuper):
10672 """This attribute refers to the type of path that this element refers 10673 to. Possible values: Fully_Qualified, Relative.""" 10674 subclass = None 10675 superclass = None
10676 - def __init__(self, type_=None, valueOf_=None):
10677 self.type_ = _cast(None, type_) 10678 self.valueOf_ = valueOf_
10679 - def factory(*args_, **kwargs_):
10680 if PathType.subclass: 10681 return PathType.subclass(*args_, **kwargs_) 10682 else: 10683 return PathType(*args_, **kwargs_)
10684 factory = staticmethod(factory)
10685 - def get_type(self): return self.type_
10686 - def set_type(self, type_): self.type_ = type_
10687 - def get_valueOf_(self): return self.valueOf_
10688 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
10689 - def export(self, outfile, level, namespace_='maec:', name_='PathType', namespacedef_=''):
10690 showIndent(outfile, level) 10691 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10692 already_processed = [] 10693 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PathType') 10694 if self.hasContent_(): 10695 outfile.write('>') 10696 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 10697 self.exportChildren(outfile, level + 1, namespace_, name_) 10698 outfile.write('</%s%s>\n' % (namespace_, name_)) 10699 else: 10700 outfile.write('/>\n')
10701 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PathType'):
10702 if self.type_ is not None and 'type_' not in already_processed: 10703 already_processed.append('type_') 10704 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
10705 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PathType', fromsubclass_=False):
10706 pass
10707 - def hasContent_(self):
10708 if ( 10709 self.valueOf_ 10710 ): 10711 return True 10712 else: 10713 return False
10714 - def exportLiteral(self, outfile, level, name_='PathType'):
10715 level += 1 10716 self.exportLiteralAttributes(outfile, level, [], name_) 10717 if self.hasContent_(): 10718 self.exportLiteralChildren(outfile, level, name_) 10719 showIndent(outfile, level) 10720 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
10721 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10722 if self.type_ is not None and 'type_' not in already_processed: 10723 already_processed.append('type_') 10724 showIndent(outfile, level) 10725 outfile.write('type_ = "%s",\n' % (self.type_,))
10726 - def exportLiteralChildren(self, outfile, level, name_):
10727 pass
10728 - def build(self, node):
10729 self.buildAttributes(node, node.attrib, []) 10730 self.valueOf_ = get_all_text_(node) 10731 for child in node: 10732 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10733 self.buildChildren(child, node, nodeName_)
10734 - def buildAttributes(self, node, attrs, already_processed):
10735 value = find_attr_value_('type', node) 10736 if value is not None and 'type' not in already_processed: 10737 already_processed.append('type') 10738 self.type_ = value
10739 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10740 pass
10741 # end class PathType 10742 10743
10744 -class HashesType(GeneratedsSuper):
10745 subclass = None 10746 superclass = None
10747 - def __init__(self, Hash=None):
10748 if Hash is None: 10749 self.Hash = [] 10750 else: 10751 self.Hash = Hash
10752 - def factory(*args_, **kwargs_):
10753 if HashesType.subclass: 10754 return HashesType.subclass(*args_, **kwargs_) 10755 else: 10756 return HashesType(*args_, **kwargs_)
10757 factory = staticmethod(factory)
10758 - def get_Hash(self): return self.Hash
10759 - def set_Hash(self, Hash): self.Hash = Hash
10760 - def add_Hash(self, value): self.Hash.append(value)
10761 - def insert_Hash(self, index, value): self.Hash[index] = value
10762 - def export(self, outfile, level, namespace_='maec:', name_='HashesType', namespacedef_=''):
10763 showIndent(outfile, level) 10764 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10765 already_processed = [] 10766 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType') 10767 if self.hasContent_(): 10768 outfile.write('>\n') 10769 self.exportChildren(outfile, level + 1, namespace_, name_) 10770 showIndent(outfile, level) 10771 outfile.write('</%s%s>\n' % (namespace_, name_)) 10772 else: 10773 outfile.write('/>\n')
10774 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType'):
10775 pass
10776 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType', fromsubclass_=False):
10777 for Hash_ in self.Hash: 10778 Hash_.export(outfile, level, namespace_, name_='Hash')
10779 - def hasContent_(self):
10780 if ( 10781 self.Hash 10782 ): 10783 return True 10784 else: 10785 return False
10786 - def exportLiteral(self, outfile, level, name_='HashesType'):
10787 level += 1 10788 self.exportLiteralAttributes(outfile, level, [], name_) 10789 if self.hasContent_(): 10790 self.exportLiteralChildren(outfile, level, name_)
10791 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10792 pass
10793 - def exportLiteralChildren(self, outfile, level, name_):
10794 showIndent(outfile, level) 10795 outfile.write('Hash=[\n') 10796 level += 1 10797 for Hash_ in self.Hash: 10798 showIndent(outfile, level) 10799 outfile.write('model_.HashType(\n') 10800 Hash_.exportLiteral(outfile, level, name_='HashType') 10801 showIndent(outfile, level) 10802 outfile.write('),\n') 10803 level -= 1 10804 showIndent(outfile, level) 10805 outfile.write('],\n')
10806 - def build(self, node):
10807 self.buildAttributes(node, node.attrib, []) 10808 for child in node: 10809 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10810 self.buildChildren(child, node, nodeName_)
10811 - def buildAttributes(self, node, attrs, already_processed):
10812 pass
10813 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10814 if nodeName_ == 'Hash': 10815 obj_ = HashType.factory() 10816 obj_.build(child_) 10817 self.Hash.append(obj_)
10818 # end class HashesType 10819 10820
10821 -class File_TypeType(GeneratedsSuper):
10822 """The type attribute is meant to provide a general way of 10823 characterizing file type, through MAEC's FileType enumeration. 10824 Possible values: PE, JS, PDF, ZIP, TXT, ASM, DOC, DOCX, XLS, 10825 XLSX, PPT, PPTX, Other.""" 10826 subclass = None 10827 superclass = None
10828 - def __init__(self, type_=None, TrID_Type=None, Discovery_Method=None):
10829 self.type_ = _cast(None, type_) 10830 self.TrID_Type = TrID_Type 10831 self.Discovery_Method = Discovery_Method
10832 - def factory(*args_, **kwargs_):
10833 if File_TypeType.subclass: 10834 return File_TypeType.subclass(*args_, **kwargs_) 10835 else: 10836 return File_TypeType(*args_, **kwargs_)
10837 factory = staticmethod(factory)
10838 - def get_TrID_Type(self): return self.TrID_Type
10839 - def set_TrID_Type(self, TrID_Type): self.TrID_Type = TrID_Type
10840 - def get_Discovery_Method(self): return self.Discovery_Method
10841 - def set_Discovery_Method(self, Discovery_Method): self.Discovery_Method = Discovery_Method
10842 - def get_type(self): return self.type_
10843 - def set_type(self, type_): self.type_ = type_
10844 - def export(self, outfile, level, namespace_='maec:', name_='File_TypeType', namespacedef_=''):
10845 showIndent(outfile, level) 10846 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10847 already_processed = [] 10848 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_TypeType') 10849 if self.hasContent_(): 10850 outfile.write('>\n') 10851 self.exportChildren(outfile, level + 1, namespace_, name_) 10852 showIndent(outfile, level) 10853 outfile.write('</%s%s>\n' % (namespace_, name_)) 10854 else: 10855 outfile.write('/>\n')
10856 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_TypeType'):
10857 if self.type_ is not None and 'type_' not in already_processed: 10858 already_processed.append('type_') 10859 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
10860 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_TypeType', fromsubclass_=False):
10861 if self.TrID_Type is not None: 10862 self.TrID_Type.export(outfile, level, namespace_, name_='TrID_Type') 10863 if self.Discovery_Method is not None: 10864 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method')
10865 - def hasContent_(self):
10866 if ( 10867 self.TrID_Type is not None or 10868 self.Discovery_Method is not None 10869 ): 10870 return True 10871 else: 10872 return False
10873 - def exportLiteral(self, outfile, level, name_='File_TypeType'):
10874 level += 1 10875 self.exportLiteralAttributes(outfile, level, [], name_) 10876 if self.hasContent_(): 10877 self.exportLiteralChildren(outfile, level, name_)
10878 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10879 if self.type_ is not None and 'type_' not in already_processed: 10880 already_processed.append('type_') 10881 showIndent(outfile, level) 10882 outfile.write('type_ = %s,\n' % (self.type_,))
10883 - def exportLiteralChildren(self, outfile, level, name_):
10884 if self.TrID_Type is not None: 10885 showIndent(outfile, level) 10886 outfile.write('TrID_Type=model_.TrID_TypeType(\n') 10887 self.TrID_Type.exportLiteral(outfile, level, name_='TrID_Type') 10888 showIndent(outfile, level) 10889 outfile.write('),\n') 10890 if self.Discovery_Method is not None: 10891 showIndent(outfile, level) 10892 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n') 10893 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method') 10894 showIndent(outfile, level) 10895 outfile.write('),\n')
10896 - def build(self, node):
10897 self.buildAttributes(node, node.attrib, []) 10898 for child in node: 10899 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10900 self.buildChildren(child, node, nodeName_)
10901 - def buildAttributes(self, node, attrs, already_processed):
10902 value = find_attr_value_('type', node) 10903 if value is not None and 'type' not in already_processed: 10904 already_processed.append('type') 10905 self.type_ = value
10906 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10907 if nodeName_ == 'TrID_Type': 10908 obj_ = TrID_TypeType.factory() 10909 obj_.build(child_) 10910 self.set_TrID_Type(obj_) 10911 elif nodeName_ == 'Discovery_Method': 10912 obj_ = DiscoveryMethod.factory() 10913 obj_.build(child_) 10914 self.set_Discovery_Method(obj_)
10915 # end class File_TypeType 10916 10917
10918 -class TrID_TypeType(GeneratedsSuper):
10919 subclass = None 10920 superclass = None
10921 - def __init__(self, TriD_ID=None, TRID_Confidence=None):
10922 self.TriD_ID = TriD_ID 10923 self.TRID_Confidence = TRID_Confidence
10924 - def factory(*args_, **kwargs_):
10925 if TrID_TypeType.subclass: 10926 return TrID_TypeType.subclass(*args_, **kwargs_) 10927 else: 10928 return TrID_TypeType(*args_, **kwargs_)
10929 factory = staticmethod(factory)
10930 - def get_TriD_ID(self): return self.TriD_ID
10931 - def set_TriD_ID(self, TriD_ID): self.TriD_ID = TriD_ID
10932 - def get_TRID_Confidence(self): return self.TRID_Confidence
10933 - def set_TRID_Confidence(self, TRID_Confidence): self.TRID_Confidence = TRID_Confidence
10934 - def export(self, outfile, level, namespace_='maec:', name_='TrID_TypeType', namespacedef_=''):
10935 showIndent(outfile, level) 10936 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 10937 already_processed = [] 10938 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrID_TypeType') 10939 if self.hasContent_(): 10940 outfile.write('>\n') 10941 self.exportChildren(outfile, level + 1, namespace_, name_) 10942 showIndent(outfile, level) 10943 outfile.write('</%s%s>\n' % (namespace_, name_)) 10944 else: 10945 outfile.write('/>\n')
10946 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='TrID_TypeType'):
10947 pass
10948 - def exportChildren(self, outfile, level, namespace_='maec:', name_='TrID_TypeType', fromsubclass_=False):
10949 if self.TriD_ID is not None: 10950 showIndent(outfile, level) 10951 outfile.write('<%sTriD_ID>%s</%sTriD_ID>\n' % (namespace_, self.gds_format_string(quote_xml(self.TriD_ID).encode(ExternalEncoding), input_name='TriD_ID'), namespace_)) 10952 if self.TRID_Confidence is not None: 10953 showIndent(outfile, level) 10954 outfile.write('<%sTRID_Confidence>%s</%sTRID_Confidence>\n' % (namespace_, self.gds_format_float(self.TRID_Confidence, input_name='TRID_Confidence'), namespace_))
10955 - def hasContent_(self):
10956 if ( 10957 self.TriD_ID is not None or 10958 self.TRID_Confidence is not None 10959 ): 10960 return True 10961 else: 10962 return False
10963 - def exportLiteral(self, outfile, level, name_='TrID_TypeType'):
10964 level += 1 10965 self.exportLiteralAttributes(outfile, level, [], name_) 10966 if self.hasContent_(): 10967 self.exportLiteralChildren(outfile, level, name_)
10968 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
10969 pass
10970 - def exportLiteralChildren(self, outfile, level, name_):
10971 if self.TriD_ID is not None: 10972 showIndent(outfile, level) 10973 outfile.write('TriD_ID=%s,\n' % quote_python(self.TriD_ID).encode(ExternalEncoding)) 10974 if self.TRID_Confidence is not None: 10975 showIndent(outfile, level) 10976 outfile.write('TRID_Confidence=%f,\n' % self.TRID_Confidence)
10977 - def build(self, node):
10978 self.buildAttributes(node, node.attrib, []) 10979 for child in node: 10980 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 10981 self.buildChildren(child, node, nodeName_)
10982 - def buildAttributes(self, node, attrs, already_processed):
10983 pass
10984 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10985 if nodeName_ == 'TriD_ID': 10986 TriD_ID_ = child_.text 10987 TriD_ID_ = self.gds_validate_string(TriD_ID_, node, 'TriD_ID') 10988 self.TriD_ID = TriD_ID_ 10989 elif nodeName_ == 'TRID_Confidence': 10990 sval_ = child_.text 10991 try: 10992 fval_ = float(sval_) 10993 except (TypeError, ValueError) as e: 10994 raise_parse_error(child_, 'requires float or double: %s' % e) 10995 fval_ = self.gds_validate_float(fval_, node, 'TRID_Confidence') 10996 self.TRID_Confidence = fval_
10997 # end class TrID_TypeType 10998 10999
11000 -class PackingType(GeneratedsSuper):
11001 """The is_packed attribute is used to indicate whether the file system 11002 object is packed or not.""" 11003 subclass = None 11004 superclass = None
11005 - def __init__(self, is_packed=None, Packer_Type=None):
11006 self.is_packed = _cast(bool, is_packed) 11007 if Packer_Type is None: 11008 self.Packer_Type = [] 11009 else: 11010 self.Packer_Type = Packer_Type
11011 - def factory(*args_, **kwargs_):
11012 if PackingType.subclass: 11013 return PackingType.subclass(*args_, **kwargs_) 11014 else: 11015 return PackingType(*args_, **kwargs_)
11016 factory = staticmethod(factory)
11017 - def get_Packer_Type(self): return self.Packer_Type
11018 - def set_Packer_Type(self, Packer_Type): self.Packer_Type = Packer_Type
11019 - def add_Packer_Type(self, value): self.Packer_Type.append(value)
11020 - def insert_Packer_Type(self, index, value): self.Packer_Type[index] = value
11021 - def get_is_packed(self): return self.is_packed
11022 - def set_is_packed(self, is_packed): self.is_packed = is_packed
11023 - def export(self, outfile, level, namespace_='maec:', name_='PackingType', namespacedef_=''):
11024 showIndent(outfile, level) 11025 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 11026 already_processed = [] 11027 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackingType') 11028 if self.hasContent_(): 11029 outfile.write('>\n') 11030 self.exportChildren(outfile, level + 1, namespace_, name_) 11031 showIndent(outfile, level) 11032 outfile.write('</%s%s>\n' % (namespace_, name_)) 11033 else: 11034 outfile.write('/>\n')
11035 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PackingType'):
11036 if self.is_packed is not None and 'is_packed' not in already_processed: 11037 already_processed.append('is_packed') 11038 outfile.write(' is_packed="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.is_packed)), input_name='is_packed'))
11039 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PackingType', fromsubclass_=False):
11040 for Packer_Type_ in self.Packer_Type: 11041 Packer_Type_.export(outfile, level, namespace_, name_='Packer_Type')
11042 - def hasContent_(self):
11043 if ( 11044 self.Packer_Type 11045 ): 11046 return True 11047 else: 11048 return False
11049 - def exportLiteral(self, outfile, level, name_='PackingType'):
11050 level += 1 11051 self.exportLiteralAttributes(outfile, level, [], name_) 11052 if self.hasContent_(): 11053 self.exportLiteralChildren(outfile, level, name_)
11054 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
11055 if self.is_packed is not None and 'is_packed' not in already_processed: 11056 already_processed.append('is_packed') 11057 showIndent(outfile, level) 11058 outfile.write('is_packed = %s,\n' % (self.is_packed,))
11059 - def exportLiteralChildren(self, outfile, level, name_):
11060 showIndent(outfile, level) 11061 outfile.write('Packer_Type=[\n') 11062 level += 1 11063 for Packer_Type_ in self.Packer_Type: 11064 showIndent(outfile, level) 11065 outfile.write('model_.Packer_TypeType(\n') 11066 Packer_Type_.exportLiteral(outfile, level, name_='Packer_TypeType') 11067 showIndent(outfile, level) 11068 outfile.write('),\n') 11069 level -= 1 11070 showIndent(outfile, level) 11071 outfile.write('],\n')
11072 - def build(self, node):
11073 self.buildAttributes(node, node.attrib, []) 11074 for child in node: 11075 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 11076 self.buildChildren(child, node, nodeName_)
11077 - def buildAttributes(self, node, attrs, already_processed):
11078 value = find_attr_value_('is_packed', node) 11079 if value is not None and 'is_packed' not in already_processed: 11080 already_processed.append('is_packed') 11081 if value in ('true', '1'): 11082 self.is_packed = True 11083 elif value in ('false', '0'): 11084 self.is_packed = False 11085 else: 11086 raise_parse_error(node, 'Bad boolean attribute')
11087 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11088 if nodeName_ == 'Packer_Type': 11089 obj_ = Packer_TypeType.factory() 11090 obj_.build(child_) 11091 self.Packer_Type.append(obj_)
11092 # end class PackingType 11093 11094
11095 -class Packer_TypeType(GeneratedsSuper):
11096 """This is intended to characterize the type of packer characterized in 11097 this element. Possible values: Archiver, Installer, Self- 11098 Extracting_Archiver, Crypter, Packer, Protector, Bundler, Other.""" 11099 subclass = None 11100 superclass = None
11101 - def __init__(self, type_=None, id=None, Name=None, Version=None, Discovery_Method=None):
11102 self.type_ = _cast(None, type_) 11103 self.id = _cast(None, id) 11104 self.Name = Name 11105 self.Version = Version 11106 self.Discovery_Method = Discovery_Method
11107 - def factory(*args_, **kwargs_):
11108 if Packer_TypeType.subclass: 11109 return Packer_TypeType.subclass(*args_, **kwargs_) 11110 else: 11111 return Packer_TypeType(*args_, **kwargs_)
11112 factory = staticmethod(factory)
11113 - def get_Name(self): return self.Name
11114 - def set_Name(self, Name): self.Name = Name
11115 - def get_Version(self): return self.Version
11116 - def set_Version(self, Version): self.Version = Version
11117 - def get_Discovery_Method(self): return self.Discovery_Method
11118 - def set_Discovery_Method(self, Discovery_Method): self.Discovery_Method = Discovery_Method
11119 - def get_type(self): return self.type_
11120 - def set_type(self, type_): self.type_ = type_
11121 - def get_id(self): return self.id
11122 - def set_id(self, id): self.id = id
11123 - def export(self, outfile, level, namespace_='maec:', name_='Packer_TypeType', namespacedef_=''):
11124 showIndent(outfile, level) 11125 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 11126 already_processed = [] 11127 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Packer_TypeType') 11128 if self.hasContent_(): 11129 outfile.write('>\n') 11130 self.exportChildren(outfile, level + 1, namespace_, name_) 11131 showIndent(outfile, level) 11132 outfile.write('</%s%s>\n' % (namespace_, name_)) 11133 else: 11134 outfile.write('/>\n')
11135 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Packer_TypeType'):
11136 if self.type_ is not None and 'type_' not in already_processed: 11137 already_processed.append('type_') 11138 outfile.write(' type=%s' % (quote_attrib(self.type_), )) 11139 if self.id is not None and 'id' not in already_processed: 11140 already_processed.append('id') 11141 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
11142 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Packer_TypeType', fromsubclass_=False):
11143 if self.Name is not None: 11144 showIndent(outfile, level) 11145 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) 11146 if self.Version is not None: 11147 showIndent(outfile, level) 11148 outfile.write('<%sVersion>%s</%sVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.Version).encode(ExternalEncoding), input_name='Version'), namespace_)) 11149 if self.Discovery_Method is not None: 11150 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method')
11151 - def hasContent_(self):
11152 if ( 11153 self.Name is not None or 11154 self.Version is not None or 11155 self.Discovery_Method is not None 11156 ): 11157 return True 11158 else: 11159 return False
11160 - def exportLiteral(self, outfile, level, name_='Packer_TypeType'):
11161 level += 1 11162 self.exportLiteralAttributes(outfile, level, [], name_) 11163 if self.hasContent_(): 11164 self.exportLiteralChildren(outfile, level, name_)
11165 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
11166 if self.type_ is not None and 'type_' not in already_processed: 11167 already_processed.append('type_') 11168 showIndent(outfile, level) 11169 outfile.write('type_ = %s,\n' % (self.type_,)) 11170 if self.id is not None and 'id' not in already_processed: 11171 already_processed.append('id') 11172 showIndent(outfile, level) 11173 outfile.write('id = "%s",\n' % (self.id,))
11174 - def exportLiteralChildren(self, outfile, level, name_):
11175 if self.Name is not None: 11176 showIndent(outfile, level) 11177 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) 11178 if self.Version is not None: 11179 showIndent(outfile, level) 11180 outfile.write('Version=%s,\n' % quote_python(self.Version).encode(ExternalEncoding)) 11181 if self.Discovery_Method is not None: 11182 showIndent(outfile, level) 11183 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n') 11184 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method') 11185 showIndent(outfile, level) 11186 outfile.write('),\n')
11187 - def build(self, node):
11188 self.buildAttributes(node, node.attrib, []) 11189 for child in node: 11190 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 11191 self.buildChildren(child, node, nodeName_)
11192 - def buildAttributes(self, node, attrs, already_processed):
11193 value = find_attr_value_('type', node) 11194 if value is not None and 'type' not in already_processed: 11195 already_processed.append('type') 11196 self.type_ = value 11197 value = find_attr_value_('id', node) 11198 if value is not None and 'id' not in already_processed: 11199 already_processed.append('id') 11200 self.id = value
11201 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11202 if nodeName_ == 'Name': 11203 Name_ = child_.text 11204 Name_ = self.gds_validate_string(Name_, node, 'Name') 11205 self.Name = Name_ 11206 elif nodeName_ == 'Version': 11207 Version_ = child_.text 11208 Version_ = self.gds_validate_string(Version_, node, 'Version') 11209 self.Version = Version_ 11210 elif nodeName_ == 'Discovery_Method': 11211 obj_ = DiscoveryMethod.factory() 11212 obj_.build(child_) 11213 self.set_Discovery_Method(obj_)
11214 # end class Packer_TypeType 11215 11216
11217 -class File_Type_AttributesType(GeneratedsSuper):
11218 subclass = None 11219 superclass = None
11220 - def __init__(self, PE_Binary_Attributes=None):
11221 self.PE_Binary_Attributes = PE_Binary_Attributes
11222 - def factory(*args_, **kwargs_):
11223 if File_Type_AttributesType.subclass: 11224 return File_Type_AttributesType.subclass(*args_, **kwargs_) 11225 else: 11226 return File_Type_AttributesType(*args_, **kwargs_)
11227 factory = staticmethod(factory)
11228 - def get_PE_Binary_Attributes(self): return self.PE_Binary_Attributes
11229 - def set_PE_Binary_Attributes(self, PE_Binary_Attributes): self.PE_Binary_Attributes = PE_Binary_Attributes
11230 - def export(self, outfile, level, namespace_='maec:', name_='File_Type_AttributesType', namespacedef_=''):
11231 showIndent(outfile, level) 11232 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 11233 already_processed = [] 11234 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_Type_AttributesType') 11235 if self.hasContent_(): 11236 outfile.write('>\n') 11237 self.exportChildren(outfile, level + 1, namespace_, name_) 11238 showIndent(outfile, level) 11239 outfile.write('</%s%s>\n' % (namespace_, name_)) 11240 else: 11241 outfile.write('/>\n')
11242 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_Type_AttributesType'):
11243 pass
11244 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_Type_AttributesType', fromsubclass_=False):
11245 if self.PE_Binary_Attributes is not None: 11246 self.PE_Binary_Attributes.export(outfile, level, namespace_, name_='PE_Binary_Attributes')
11247 - def hasContent_(self):
11248 if ( 11249 self.PE_Binary_Attributes is not None 11250 ): 11251 return True 11252 else: 11253 return False
11254 - def exportLiteral(self, outfile, level, name_='File_Type_AttributesType'):
11255 level += 1 11256 self.exportLiteralAttributes(outfile, level, [], name_) 11257 if self.hasContent_(): 11258 self.exportLiteralChildren(outfile, level, name_)
11259 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
11260 pass
11261 - def exportLiteralChildren(self, outfile, level, name_):
11262 if self.PE_Binary_Attributes is not None: 11263 showIndent(outfile, level) 11264 outfile.write('PE_Binary_Attributes=model_.PE_Binary_AttributesType(\n') 11265 self.PE_Binary_Attributes.exportLiteral(outfile, level, name_='PE_Binary_Attributes') 11266 showIndent(outfile, level) 11267 outfile.write('),\n')
11268 - def build(self, node):
11269 self.buildAttributes(node, node.attrib, []) 11270 for child in node: 11271 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 11272 self.buildChildren(child, node, nodeName_)
11273 - def buildAttributes(self, node, attrs, already_processed):
11274 pass
11275 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11276 if nodeName_ == 'PE_Binary_Attributes': 11277 obj_ = PE_Binary_AttributesType.factory() 11278 obj_.build(child_) 11279 self.set_PE_Binary_Attributes(obj_)
11280 # end class File_Type_AttributesType 11281 11282
11283 -class PE_Binary_AttributesType(GeneratedsSuper):
11284 """The type attribute is used to define the type of PE file being 11285 characterized. Possible values: EXE, DLL.The dll_count attribute 11286 is used to define the number of DLLs loaded by a PE file.""" 11287 subclass = None 11288 superclass = None
11289 - def __init__(self, dll_count=None, type_=None, Version_Block=None, Headers=None, Strings=None, Imports=None, Exports=None, Resources=None, Sections=None, Digital_Certificates=None):
11290 self.dll_count = _cast(int, dll_count) 11291 self.type_ = _cast(None, type_) 11292 self.Version_Block = Version_Block 11293 self.Headers = Headers 11294 self.Strings = Strings 11295 self.Imports = Imports 11296 self.Exports = Exports 11297 self.Resources = Resources 11298 self.Sections = Sections 11299 self.Digital_Certificates = Digital_Certificates
11300 - def factory(*args_, **kwargs_):
11301 if PE_Binary_AttributesType.subclass: 11302 return PE_Binary_AttributesType.subclass(*args_, **kwargs_) 11303 else: 11304 return PE_Binary_AttributesType(*args_, **kwargs_)
11305 factory = staticmethod(factory)
11306 - def get_Version_Block(self): return self.Version_Block
11307 - def set_Version_Block(self, Version_Block): self.Version_Block = Version_Block
11308 - def get_Headers(self): return self.Headers
11309 - def set_Headers(self, Headers): self.Headers = Headers
11310 - def get_Strings(self): return self.Strings
11311 - def set_Strings(self, Strings): self.Strings = Strings
11312 - def get_Imports(self): return self.Imports
11313 - def set_Imports(self, Imports): self.Imports = Imports
11314 - def get_Exports(self): return self.Exports
11315 - def set_Exports(self, Exports): self.Exports = Exports
11316 - def get_Resources(self): return self.Resources
11317 - def set_Resources(self, Resources): self.Resources = Resources
11318 - def get_Sections(self): return self.Sections
11319 - def set_Sections(self, Sections): self.Sections = Sections
11320 - def get_Digital_Certificates(self): return self.Digital_Certificates
11321 - def set_Digital_Certificates(self, Digital_Certificates): self.Digital_Certificates = Digital_Certificates
11322 - def get_dll_count(self): return self.dll_count
11323 - def set_dll_count(self, dll_count): self.dll_count = dll_count
11324 - def get_type(self): return self.type_
11325 - def set_type(self, type_): self.type_ = type_
11326 - def export(self, outfile, level, namespace_='maec:', name_='PE_Binary_AttributesType', namespacedef_=''):
11327 showIndent(outfile, level) 11328 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 11329 already_processed = [] 11330 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PE_Binary_AttributesType') 11331 if self.hasContent_(): 11332 outfile.write('>\n') 11333 self.exportChildren(outfile, level + 1, namespace_, name_) 11334 showIndent(outfile, level) 11335 outfile.write('</%s%s>\n' % (namespace_, name_)) 11336 else: 11337 outfile.write('/>\n')
11338 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PE_Binary_AttributesType'):
11339 if self.dll_count is not None and 'dll_count' not in already_processed: 11340 already_processed.append('dll_count') 11341 outfile.write(' dll_count="%s"' % self.gds_format_integer(self.dll_count, input_name='dll_count')) 11342 if self.type_ is not None and 'type_' not in already_processed: 11343 already_processed.append('type_') 11344 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
11345 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PE_Binary_AttributesType', fromsubclass_=False):
11346 if self.Version_Block is not None: 11347 self.Version_Block.export(outfile, level, namespace_, name_='Version_Block') 11348 if self.Headers is not None: 11349 self.Headers.export(outfile, level, namespace_, name_='Headers') 11350 if self.Strings is not None: 11351 self.Strings.export(outfile, level, namespace_, name_='Strings') 11352 if self.Imports is not None: 11353 self.Imports.export(outfile, level, namespace_, name_='Imports') 11354 if self.Exports is not None: 11355 self.Exports.export(outfile, level, namespace_, name_='Exports') 11356 if self.Resources is not None: 11357 self.Resources.export(outfile, level, namespace_, name_='Resources') 11358 if self.Sections is not None: 11359 self.Sections.export(outfile, level, namespace_, name_='Sections') 11360 if self.Digital_Certificates is not None: 11361 self.Digital_Certificates.export(outfile, level, namespace_, name_='Digital_Certificates')
11362 - def hasContent_(self):
11363 if ( 11364 self.Version_Block is not None or 11365 self.Headers is not None or 11366 self.Strings is not None or 11367 self.Imports is not None or 11368 self.Exports is not None or 11369 self.Resources is not None or 11370 self.Sections is not None or 11371 self.Digital_Certificates is not None 11372 ): 11373 return True 11374 else: 11375 return False
11376 - def exportLiteral(self, outfile, level, name_='PE_Binary_AttributesType'):
11377 level += 1 11378 self.exportLiteralAttributes(outfile, level, [], name_) 11379 if self.hasContent_(): 11380 self.exportLiteralChildren(outfile, level, name_)
11381 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
11382 if self.dll_count is not None and 'dll_count' not in already_processed: 11383 already_processed.append('dll_count') 11384 showIndent(outfile, level) 11385 outfile.write('dll_count = %d,\n' % (self.dll_count,)) 11386 if self.type_ is not None and 'type_' not in already_processed: 11387 already_processed.append('type_') 11388 showIndent(outfile, level) 11389 outfile.write('type_ = "%s",\n' % (self.type_,))
11390 - def exportLiteralChildren(self, outfile, level, name_):
11391 if self.Version_Block is not None: 11392 showIndent(outfile, level) 11393 outfile.write('Version_Block=model_.Version_BlockType(\n') 11394 self.Version_Block.exportLiteral(outfile, level, name_='Version_Block') 11395 showIndent(outfile, level) 11396 outfile.write('),\n') 11397 if self.Headers is not None: 11398 showIndent(outfile, level) 11399 outfile.write('Headers=model_.HeadersType(\n') 11400 self.Headers.exportLiteral(outfile, level, name_='Headers') 11401 showIndent(outfile, level) 11402 outfile.write('),\n') 11403 if self.Strings is not None: 11404 showIndent(outfile, level) 11405 outfile.write('Strings=model_.StringsType(\n') 11406 self.Strings.exportLiteral(outfile, level, name_='Strings') 11407 showIndent(outfile, level) 11408 outfile.write('),\n') 11409 if self.Imports is not None: 11410 showIndent(outfile, level) 11411 outfile.write('Imports=model_.ImportsType(\n') 11412 self.Imports.exportLiteral(outfile, level, name_='Imports') 11413 showIndent(outfile, level) 11414 outfile.write('),\n') 11415 if self.Exports is not None: 11416 showIndent(outfile, level) 11417 outfile.write('Exports=model_.ExportsType(\n') 11418 self.Exports.exportLiteral(outfile, level, name_='Exports') 11419 showIndent(outfile, level) 11420 outfile.write('),\n') 11421 if self.Resources is not None: 11422 showIndent(outfile, level) 11423 outfile.write('Resources=model_.ResourcesType(\n') 11424 self.Resources.exportLiteral(outfile, level, name_='Resources') 11425 showIndent(outfile, level) 11426 outfile.write('),\n') 11427 if self.Sections is not None: 11428 showIndent(outfile, level) 11429 outfile.write('Sections=model_.SectionsType(\n') 11430 self.Sections.exportLiteral(outfile, level, name_='Sections') 11431 showIndent(outfile, level) 11432 outfile.write('),\n') 11433 if self.Digital_Certificates is not None: 11434 showIndent(outfile, level) 11435 outfile.write('Digital_Certificates=model_.Digital_CertificatesType(\n') 11436 self.Digital_Certificates.exportLiteral(outfile, level, name_='Digital_Certificates') 11437 showIndent(outfile, level) 11438 outfile.write('),\n')
11439 - def build(self, node):
11440 self.buildAttributes(node, node.attrib, []) 11441 for child in node: 11442 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 11443 self.buildChildren(child, node, nodeName_)
11444 - def buildAttributes(self, node, attrs, already_processed):
11445 value = find_attr_value_('dll_count', node) 11446 if value is not None and 'dll_count' not in already_processed: 11447 already_processed.append('dll_count') 11448 try: 11449 self.dll_count = int(value) 11450 except ValueError as e: 11451 raise_parse_error(node, 'Bad integer attribute: %s' % e) 11452 value = find_attr_value_('type', node) 11453 if value is not None and 'type' not in already_processed: 11454 already_processed.append('type') 11455 self.type_ = value
11456 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11457 if nodeName_ == 'Version_Block': 11458 obj_ = Version_BlockType.factory() 11459 obj_.build(child_) 11460 self.set_Version_Block(obj_) 11461 elif nodeName_ == 'Headers': 11462 obj_ = HeadersType.factory() 11463 obj_.build(child_) 11464 self.set_Headers(obj_) 11465 elif nodeName_ == 'Strings': 11466 obj_ = StringsType.factory() 11467 obj_.build(child_) 11468 self.set_Strings(obj_) 11469 elif nodeName_ == 'Imports': 11470 obj_ = ImportsType.factory() 11471 obj_.build(child_) 11472 self.set_Imports(obj_) 11473 elif nodeName_ == 'Exports': 11474 obj_ = ExportsType.factory() 11475 obj_.build(child_) 11476 self.set_Exports(obj_) 11477 elif nodeName_ == 'Resources': 11478 obj_ = ResourcesType.factory() 11479 obj_.build(child_) 11480 self.set_Resources(obj_) 11481 elif nodeName_ == 'Sections': 11482 obj_ = SectionsType.factory() 11483 obj_.build(child_) 11484 self.set_Sections(obj_) 11485 elif nodeName_ == 'Digital_Certificates': 11486 obj_ = Digital_CertificatesType.factory() 11487 obj_.build(child_) 11488 self.set_Digital_Certificates(obj_)
11489 # end class PE_Binary_AttributesType 11490 11491
11492 -class Version_BlockType(GeneratedsSuper):
11493 subclass = None 11494 superclass = None
11495 - def __init__(self, Internal_Name=None, Product_Name=None, Company_Name=None, Legal_Copyright=None, Product_Version_Text=None, File_Description=None, File_Version_Text=None, Original_File_Name=None):
11496 self.Internal_Name = Internal_Name 11497 self.Product_Name = Product_Name 11498 self.Company_Name = Company_Name 11499 self.Legal_Copyright = Legal_Copyright 11500 self.Product_Version_Text = Product_Version_Text 11501 self.File_Description = File_Description 11502 self.File_Version_Text = File_Version_Text 11503 self.Original_File_Name = Original_File_Name
11504 - def factory(*args_, **kwargs_):
11505 if Version_BlockType.subclass: 11506 return Version_BlockType.subclass(*args_, **kwargs_) 11507 else: 11508 return Version_BlockType(*args_, **kwargs_)
11509 factory = staticmethod(factory)
11510 - def get_Internal_Name(self): return self.Internal_Name
11511 - def set_Internal_Name(self, Internal_Name): self.Internal_Name = Internal_Name
11512 - def get_Product_Name(self): return self.Product_Name
11513 - def set_Product_Name(self, Product_Name): self.Product_Name = Product_Name
11514 - def get_Company_Name(self): return self.Company_Name
11515 - def set_Company_Name(self, Company_Name): self.Company_Name = Company_Name
11518 - def get_Product_Version_Text(self): return self.Product_Version_Text
11519 - def set_Product_Version_Text(self, Product_Version_Text): self.Product_Version_Text = Product_Version_Text
11520 - def get_File_Description(self): return self.File_Description
11521 - def set_File_Description(self, File_Description): self.File_Description = File_Description
11522 - def get_File_Version_Text(self): return self.File_Version_Text
11523 - def set_File_Version_Text(self, File_Version_Text): self.File_Version_Text = File_Version_Text
11524 - def get_Original_File_Name(self): return self.Original_File_Name
11525 - def set_Original_File_Name(self, Original_File_Name): self.Original_File_Name = Original_File_Name
11526 - def export(self, outfile, level, namespace_='maec:', name_='Version_BlockType', namespacedef_=''):
11527 showIndent(outfile, level) 11528 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 11529 already_processed = [] 11530 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Version_BlockType') 11531 if self.hasContent_(): 11532 outfile.write('>\n') 11533 self.exportChildren(outfile, level + 1, namespace_, name_) 11534 showIndent(outfile, level) 11535 outfile.write('</%s%s>\n' % (namespace_, name_)) 11536 else: 11537 outfile.write('/>\n')
11538 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Version_BlockType'):
11539 pass
11540 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Version_BlockType', fromsubclass_=False):
11541 if self.Internal_Name is not None: 11542 showIndent(outfile, level) 11543 outfile.write('<%sInternal_Name>%s</%sInternal_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Internal_Name).encode(ExternalEncoding), input_name='Internal_Name'), namespace_)) 11544 if self.Product_Name is not None: 11545 showIndent(outfile, level) 11546 outfile.write('<%sProduct_Name>%s</%sProduct_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Product_Name).encode(ExternalEncoding), input_name='Product_Name'), namespace_)) 11547 if self.Company_Name is not None: 11548 showIndent(outfile, level) 11549 outfile.write('<%sCompany_Name>%s</%sCompany_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Company_Name).encode(ExternalEncoding), input_name='Company_Name'), namespace_)) 11550 if self.Legal_Copyright is not None: 11551 showIndent(outfile, level) 11552 outfile.write('<%sLegal_Copyright>%s</%sLegal_Copyright>\n' % (namespace_, self.gds_format_string(quote_xml(self.Legal_Copyright).encode(ExternalEncoding), input_name='Legal_Copyright'), namespace_)) 11553 if self.Product_Version_Text is not None: 11554 showIndent(outfile, level) 11555 outfile.write('<%sProduct_Version_Text>%s</%sProduct_Version_Text>\n' % (namespace_, self.gds_format_string(quote_xml(self.Product_Version_Text).encode(ExternalEncoding), input_name='Product_Version_Text'), namespace_)) 11556 if self.File_Description is not None: 11557 showIndent(outfile, level) 11558 outfile.write('<%sFile_Description>%s</%sFile_Description>\n' % (namespace_, self.gds_format_string(quote_xml(self.File_Description).encode(ExternalEncoding), input_name='File_Description'), namespace_)) 11559 if self.File_Version_Text is not None: 11560 showIndent(outfile, level) 11561 outfile.write('<%sFile_Version_Text>%s</%sFile_Version_Text>\n' % (namespace_, self.gds_format_string(quote_xml(self.File_Version_Text).encode(ExternalEncoding), input_name='File_Version_Text'), namespace_)) 11562 if self.Original_File_Name is not None: 11563 showIndent(outfile, level) 11564 outfile.write('<%sOriginal_File_Name>%s</%sOriginal_File_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Original_File_Name).encode(ExternalEncoding), input_name='Original_File_Name'), namespace_))
11565 - def hasContent_(self):
11566 if ( 11567 self.Internal_Name is not None or 11568 self.Product_Name is not None or 11569 self.Company_Name is not None or 11570 self.Legal_Copyright is not None or 11571 self.Product_Version_Text is not None or 11572 self.File_Description is not None or 11573 self.File_Version_Text is not None or 11574 self.Original_File_Name is not None 11575 ): 11576 return True 11577 else: 11578 return False
11579 - def exportLiteral(self, outfile, level, name_='Version_BlockType'):
11580 level += 1 11581 self.exportLiteralAttributes(outfile, level, [], name_) 11582 if self.hasContent_(): 11583 self.exportLiteralChildren(outfile, level, name_)
11584 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
11585 pass
11586 - def exportLiteralChildren(self, outfile, level, name_):
11587 if self.Internal_Name is not None: 11588 showIndent(outfile, level) 11589 outfile.write('Internal_Name=%s,\n' % quote_python(self.Internal_Name).encode(ExternalEncoding)) 11590 if self.Product_Name is not None: 11591 showIndent(outfile, level) 11592 outfile.write('Product_Name=%s,\n' % quote_python(self.Product_Name).encode(ExternalEncoding)) 11593 if self.Company_Name is not None: 11594 showIndent(outfile, level) 11595 outfile.write('Company_Name=%s,\n' % quote_python(self.Company_Name).encode(ExternalEncoding)) 11596 if self.Legal_Copyright is not None: 11597 showIndent(outfile, level) 11598 outfile.write('Legal_Copyright=%s,\n' % quote_python(self.Legal_Copyright).encode(ExternalEncoding)) 11599 if self.Product_Version_Text is not None: 11600 showIndent(outfile, level) 11601 outfile.write('Product_Version_Text=%s,\n' % quote_python(self.Product_Version_Text).encode(ExternalEncoding)) 11602 if self.File_Description is not None: 11603 showIndent(outfile, level) 11604 outfile.write('File_Description=%s,\n' % quote_python(self.File_Description).encode(ExternalEncoding)) 11605 if self.File_Version_Text is not None: 11606 showIndent(outfile, level) 11607 outfile.write('File_Version_Text=%s,\n' % quote_python(self.File_Version_Text).encode(ExternalEncoding)) 11608 if self.Original_File_Name is not None: 11609 showIndent(outfile, level) 11610 outfile.write('Original_File_Name=%s,\n' % quote_python(self.Original_File_Name).encode(ExternalEncoding))
11611 - def build(self, node):
11612 self.buildAttributes(node, node.attrib, []) 11613 for child in node: 11614 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 11615 self.buildChildren(child, node, nodeName_)
11616 - def buildAttributes(self, node, attrs, already_processed):
11617 pass
11618 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11619 if nodeName_ == 'Internal_Name': 11620 Internal_Name_ = child_.text 11621 Internal_Name_ = self.gds_validate_string(Internal_Name_, node, 'Internal_Name') 11622 self.Internal_Name = Internal_Name_ 11623 elif nodeName_ == 'Product_Name': 11624 Product_Name_ = child_.text 11625 Product_Name_ = self.gds_validate_string(Product_Name_, node, 'Product_Name') 11626 self.Product_Name = Product_Name_ 11627 elif nodeName_ == 'Company_Name': 11628 Company_Name_ = child_.text 11629 Company_Name_ = self.gds_validate_string(Company_Name_, node, 'Company_Name') 11630 self.Company_Name = Company_Name_ 11631 elif nodeName_ == 'Legal_Copyright': 11632 Legal_Copyright_ = child_.text 11633 Legal_Copyright_ = self.gds_validate_string(Legal_Copyright_, node, 'Legal_Copyright') 11634 self.Legal_Copyright = Legal_Copyright_ 11635 elif nodeName_ == 'Product_Version_Text': 11636 Product_Version_Text_ = child_.text 11637 Product_Version_Text_ = self.gds_validate_string(Product_Version_Text_, node, 'Product_Version_Text') 11638 self.Product_Version_Text = Product_Version_Text_ 11639 elif nodeName_ == 'File_Description': 11640 File_Description_ = child_.text 11641 File_Description_ = self.gds_validate_string(File_Description_, node, 'File_Description') 11642 self.File_Description = File_Description_ 11643 elif nodeName_ == 'File_Version_Text': 11644 File_Version_Text_ = child_.text 11645 File_Version_Text_ = self.gds_validate_string(File_Version_Text_, node, 'File_Version_Text') 11646 self.File_Version_Text = File_Version_Text_ 11647 elif nodeName_ == 'Original_File_Name': 11648 Original_File_Name_ = child_.text 11649 Original_File_Name_ = self.gds_validate_string(Original_File_Name_, node, 'Original_File_Name') 11650 self.Original_File_Name = Original_File_Name_
11651 # end class Version_BlockType 11652 11653
11654 -class HeadersType(GeneratedsSuper):
11655 subclass = None 11656 superclass = None
11657 - def __init__(self, DOS_Header=None, PE_Header=None, Section_Table=None):
11658 self.DOS_Header = DOS_Header 11659 self.PE_Header = PE_Header 11660 self.Section_Table = Section_Table
11661 - def factory(*args_, **kwargs_):
11662 if HeadersType.subclass: 11663 return HeadersType.subclass(*args_, **kwargs_) 11664 else: 11665 return HeadersType(*args_, **kwargs_)
11666 factory = staticmethod(factory)
11667 - def get_DOS_Header(self): return self.DOS_Header
11668 - def set_DOS_Header(self, DOS_Header): self.DOS_Header = DOS_Header
11669 - def get_PE_Header(self): return self.PE_Header
11670 - def set_PE_Header(self, PE_Header): self.PE_Header = PE_Header
11671 - def get_Section_Table(self): return self.Section_Table
11672 - def set_Section_Table(self, Section_Table): self.Section_Table = Section_Table
11673 - def export(self, outfile, level, namespace_='maec:', name_='HeadersType', namespacedef_=''):
11674 showIndent(outfile, level) 11675 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 11676 already_processed = [] 11677 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HeadersType') 11678 if self.hasContent_(): 11679 outfile.write('>\n') 11680 self.exportChildren(outfile, level + 1, namespace_, name_) 11681 showIndent(outfile, level) 11682 outfile.write('</%s%s>\n' % (namespace_, name_)) 11683 else: 11684 outfile.write('/>\n')
11685 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HeadersType'):
11686 pass
11687 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HeadersType', fromsubclass_=False):
11688 if self.DOS_Header is not None: 11689 self.DOS_Header.export(outfile, level, namespace_, name_='DOS_Header') 11690 if self.PE_Header is not None: 11691 self.PE_Header.export(outfile, level, namespace_, name_='PE_Header') 11692 if self.Section_Table is not None: 11693 self.Section_Table.export(outfile, level, namespace_, name_='Section_Table')
11694 - def hasContent_(self):
11695 if ( 11696 self.DOS_Header is not None or 11697 self.PE_Header is not None or 11698 self.Section_Table is not None 11699 ): 11700 return True 11701 else: 11702 return False
11703 - def exportLiteral(self, outfile, level, name_='HeadersType'):
11704 level += 1 11705 self.exportLiteralAttributes(outfile, level, [], name_) 11706 if self.hasContent_(): 11707 self.exportLiteralChildren(outfile, level, name_)
11708 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
11709 pass
11710 - def exportLiteralChildren(self, outfile, level, name_):
11711 if self.DOS_Header is not None: 11712 showIndent(outfile, level) 11713 outfile.write('DOS_Header=model_.DOS_HeaderType(\n') 11714 self.DOS_Header.exportLiteral(outfile, level, name_='DOS_Header') 11715 showIndent(outfile, level) 11716 outfile.write('),\n') 11717 if self.PE_Header is not None: 11718 showIndent(outfile, level) 11719 outfile.write('PE_Header=model_.PE_HeaderType(\n') 11720 self.PE_Header.exportLiteral(outfile, level, name_='PE_Header') 11721 showIndent(outfile, level) 11722 outfile.write('),\n') 11723 if self.Section_Table is not None: 11724 showIndent(outfile, level) 11725 outfile.write('Section_Table=model_.Section_TableType(\n') 11726 self.Section_Table.exportLiteral(outfile, level, name_='Section_Table') 11727 showIndent(outfile, level) 11728 outfile.write('),\n')
11729 - def build(self, node):
11730 self.buildAttributes(node, node.attrib, []) 11731 for child in node: 11732 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 11733 self.buildChildren(child, node, nodeName_)
11734 - def buildAttributes(self, node, attrs, already_processed):
11735 pass
11736 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11737 if nodeName_ == 'DOS_Header': 11738 obj_ = DOS_HeaderType.factory() 11739 obj_.build(child_) 11740 self.set_DOS_Header(obj_) 11741 elif nodeName_ == 'PE_Header': 11742 obj_ = PE_HeaderType.factory() 11743 obj_.build(child_) 11744 self.set_PE_Header(obj_) 11745 elif nodeName_ == 'Section_Table': 11746 obj_ = Section_TableType.factory() 11747 obj_.build(child_) 11748 self.set_Section_Table(obj_)
11749 # end class HeadersType 11750 11751
11752 -class DOS_HeaderType(GeneratedsSuper):
11753 subclass = None 11754 superclass = None
11755 - def __init__(self, Hashes=None, signature=None, lastsize=None, nblocks=None, nreloc=None, hdrsize=None, minalloc=None, maxalloc=None, checksum=None, relocpos=None, noverlay=None, reserved1=None, oem_id=None, oem_info=None, reserved2=None, e_lfanew=None):
11756 self.Hashes = Hashes 11757 self.signature = signature 11758 self.lastsize = lastsize 11759 self.nblocks = nblocks 11760 self.nreloc = nreloc 11761 self.hdrsize = hdrsize 11762 self.minalloc = minalloc 11763 self.maxalloc = maxalloc 11764 self.checksum = checksum 11765 self.relocpos = relocpos 11766 self.noverlay = noverlay 11767 self.reserved1 = reserved1 11768 self.oem_id = oem_id 11769 self.oem_info = oem_info 11770 self.reserved2 = reserved2 11771 self.e_lfanew = e_lfanew
11772 - def factory(*args_, **kwargs_):
11773 if DOS_HeaderType.subclass: 11774 return DOS_HeaderType.subclass(*args_, **kwargs_) 11775 else: 11776 return DOS_HeaderType(*args_, **kwargs_)
11777 factory = staticmethod(factory)
11778 - def get_Hashes(self): return self.Hashes
11779 - def set_Hashes(self, Hashes): self.Hashes = Hashes
11780 - def get_signature(self): return self.signature
11781 - def set_signature(self, signature): self.signature = signature
11782 - def get_lastsize(self): return self.lastsize
11783 - def set_lastsize(self, lastsize): self.lastsize = lastsize
11784 - def get_nblocks(self): return self.nblocks
11785 - def set_nblocks(self, nblocks): self.nblocks = nblocks
11786 - def get_nreloc(self): return self.nreloc
11787 - def set_nreloc(self, nreloc): self.nreloc = nreloc
11788 - def get_hdrsize(self): return self.hdrsize
11789 - def set_hdrsize(self, hdrsize): self.hdrsize = hdrsize
11790 - def get_minalloc(self): return self.minalloc
11791 - def set_minalloc(self, minalloc): self.minalloc = minalloc
11792 - def get_maxalloc(self): return self.maxalloc
11793 - def set_maxalloc(self, maxalloc): self.maxalloc = maxalloc
11794 - def get_checksum(self): return self.checksum
11795 - def set_checksum(self, checksum): self.checksum = checksum
11796 - def get_relocpos(self): return self.relocpos
11797 - def set_relocpos(self, relocpos): self.relocpos = relocpos
11798 - def get_noverlay(self): return self.noverlay
11799 - def set_noverlay(self, noverlay): self.noverlay = noverlay
11800 - def get_reserved1(self): return self.reserved1
11801 - def set_reserved1(self, reserved1): self.reserved1 = reserved1
11802 - def get_oem_id(self): return self.oem_id
11803 - def set_oem_id(self, oem_id): self.oem_id = oem_id
11804 - def get_oem_info(self): return self.oem_info
11805 - def set_oem_info(self, oem_info): self.oem_info = oem_info
11806 - def get_reserved2(self): return self.reserved2
11807 - def set_reserved2(self, reserved2): self.reserved2 = reserved2
11808 - def get_e_lfanew(self): return self.e_lfanew
11809 - def set_e_lfanew(self, e_lfanew): self.e_lfanew = e_lfanew
11810 - def export(self, outfile, level, namespace_='maec:', name_='DOS_HeaderType', namespacedef_=''):
11811 showIndent(outfile, level) 11812 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 11813 already_processed = [] 11814 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DOS_HeaderType') 11815 if self.hasContent_(): 11816 outfile.write('>\n') 11817 self.exportChildren(outfile, level + 1, namespace_, name_) 11818 showIndent(outfile, level) 11819 outfile.write('</%s%s>\n' % (namespace_, name_)) 11820 else: 11821 outfile.write('/>\n')
11822 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='DOS_HeaderType'):
11823 pass
11824 - def exportChildren(self, outfile, level, namespace_='maec:', name_='DOS_HeaderType', fromsubclass_=False):
11825 if self.Hashes is not None: 11826 self.Hashes.export(outfile, level, namespace_, name_='Hashes') 11827 if self.signature is not None: 11828 self.signature.export(outfile, level, namespace_, name_='signature') 11829 if self.lastsize is not None: 11830 self.lastsize.export(outfile, level, namespace_, name_='lastsize') 11831 if self.nblocks is not None: 11832 self.nblocks.export(outfile, level, namespace_, name_='nblocks') 11833 if self.nreloc is not None: 11834 self.nreloc.export(outfile, level, namespace_, name_='nreloc') 11835 if self.hdrsize is not None: 11836 self.hdrsize.export(outfile, level, namespace_, name_='hdrsize') 11837 if self.minalloc is not None: 11838 self.minalloc.export(outfile, level, namespace_, name_='minalloc') 11839 if self.maxalloc is not None: 11840 self.maxalloc.export(outfile, level, namespace_, name_='maxalloc') 11841 if self.checksum is not None: 11842 self.checksum.export(outfile, level, namespace_, name_='checksum') 11843 if self.relocpos is not None: 11844 self.relocpos.export(outfile, level, namespace_, name_='relocpos') 11845 if self.noverlay is not None: 11846 self.noverlay.export(outfile, level, namespace_, name_='noverlay') 11847 if self.reserved1 is not None: 11848 self.reserved1.export(outfile, level, namespace_, name_='reserved1') 11849 if self.oem_id is not None: 11850 self.oem_id.export(outfile, level, namespace_, name_='oem_id') 11851 if self.oem_info is not None: 11852 self.oem_info.export(outfile, level, namespace_, name_='oem_info') 11853 if self.reserved2 is not None: 11854 self.reserved2.export(outfile, level, namespace_, name_='reserved2') 11855 if self.e_lfanew is not None: 11856 self.e_lfanew.export(outfile, level, namespace_, name_='e_lfanew')
11857 - def hasContent_(self):
11858 if ( 11859 self.Hashes is not None or 11860 self.signature is not None or 11861 self.lastsize is not None or 11862 self.nblocks is not None or 11863 self.nreloc is not None or 11864 self.hdrsize is not None or 11865 self.minalloc is not None or 11866 self.maxalloc is not None or 11867 self.checksum is not None or 11868 self.relocpos is not None or 11869 self.noverlay is not None or 11870 self.reserved1 is not None or 11871 self.oem_id is not None or 11872 self.oem_info is not None or 11873 self.reserved2 is not None or 11874 self.e_lfanew is not None 11875 ): 11876 return True 11877 else: 11878 return False
11879 - def exportLiteral(self, outfile, level, name_='DOS_HeaderType'):
11880 level += 1 11881 self.exportLiteralAttributes(outfile, level, [], name_) 11882 if self.hasContent_(): 11883 self.exportLiteralChildren(outfile, level, name_)
11884 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
11885 pass
11886 - def exportLiteralChildren(self, outfile, level, name_):
11887 if self.Hashes is not None: 11888 showIndent(outfile, level) 11889 outfile.write('Hashes=model_.HashesType1(\n') 11890 self.Hashes.exportLiteral(outfile, level, name_='Hashes') 11891 showIndent(outfile, level) 11892 outfile.write('),\n') 11893 if self.signature is not None: 11894 showIndent(outfile, level) 11895 outfile.write('signature=model_.xs_hexBinary(\n') 11896 self.signature.exportLiteral(outfile, level, name_='signature') 11897 showIndent(outfile, level) 11898 outfile.write('),\n') 11899 if self.lastsize is not None: 11900 showIndent(outfile, level) 11901 outfile.write('lastsize=model_.xs_hexBinary(\n') 11902 self.lastsize.exportLiteral(outfile, level, name_='lastsize') 11903 showIndent(outfile, level) 11904 outfile.write('),\n') 11905 if self.nblocks is not None: 11906 showIndent(outfile, level) 11907 outfile.write('nblocks=model_.xs_hexBinary(\n') 11908 self.nblocks.exportLiteral(outfile, level, name_='nblocks') 11909 showIndent(outfile, level) 11910 outfile.write('),\n') 11911 if self.nreloc is not None: 11912 showIndent(outfile, level) 11913 outfile.write('nreloc=model_.xs_hexBinary(\n') 11914 self.nreloc.exportLiteral(outfile, level, name_='nreloc') 11915 showIndent(outfile, level) 11916 outfile.write('),\n') 11917 if self.hdrsize is not None: 11918 showIndent(outfile, level) 11919 outfile.write('hdrsize=model_.xs_hexBinary(\n') 11920 self.hdrsize.exportLiteral(outfile, level, name_='hdrsize') 11921 showIndent(outfile, level) 11922 outfile.write('),\n') 11923 if self.minalloc is not None: 11924 showIndent(outfile, level) 11925 outfile.write('minalloc=model_.xs_hexBinary(\n') 11926 self.minalloc.exportLiteral(outfile, level, name_='minalloc') 11927 showIndent(outfile, level) 11928 outfile.write('),\n') 11929 if self.maxalloc is not None: 11930 showIndent(outfile, level) 11931 outfile.write('maxalloc=model_.xs_hexBinary(\n') 11932 self.maxalloc.exportLiteral(outfile, level, name_='maxalloc') 11933 showIndent(outfile, level) 11934 outfile.write('),\n') 11935 if self.checksum is not None: 11936 showIndent(outfile, level) 11937 outfile.write('checksum=model_.xs_hexBinary(\n') 11938 self.checksum.exportLiteral(outfile, level, name_='checksum') 11939 showIndent(outfile, level) 11940 outfile.write('),\n') 11941 if self.relocpos is not None: 11942 showIndent(outfile, level) 11943 outfile.write('relocpos=model_.xs_hexBinary(\n') 11944 self.relocpos.exportLiteral(outfile, level, name_='relocpos') 11945 showIndent(outfile, level) 11946 outfile.write('),\n') 11947 if self.noverlay is not None: 11948 showIndent(outfile, level) 11949 outfile.write('noverlay=model_.xs_hexBinary(\n') 11950 self.noverlay.exportLiteral(outfile, level, name_='noverlay') 11951 showIndent(outfile, level) 11952 outfile.write('),\n') 11953 if self.reserved1 is not None: 11954 showIndent(outfile, level) 11955 outfile.write('reserved1=model_.xs_hexBinary(\n') 11956 self.reserved1.exportLiteral(outfile, level, name_='reserved1') 11957 showIndent(outfile, level) 11958 outfile.write('),\n') 11959 if self.oem_id is not None: 11960 showIndent(outfile, level) 11961 outfile.write('oem_id=model_.xs_hexBinary(\n') 11962 self.oem_id.exportLiteral(outfile, level, name_='oem_id') 11963 showIndent(outfile, level) 11964 outfile.write('),\n') 11965 if self.oem_info is not None: 11966 showIndent(outfile, level) 11967 outfile.write('oem_info=model_.xs_hexBinary(\n') 11968 self.oem_info.exportLiteral(outfile, level, name_='oem_info') 11969 showIndent(outfile, level) 11970 outfile.write('),\n') 11971 if self.reserved2 is not None: 11972 showIndent(outfile, level) 11973 outfile.write('reserved2=model_.xs_hexBinary(\n') 11974 self.reserved2.exportLiteral(outfile, level, name_='reserved2') 11975 showIndent(outfile, level) 11976 outfile.write('),\n') 11977 if self.e_lfanew is not None: 11978 showIndent(outfile, level) 11979 outfile.write('e_lfanew=model_.xs_hexBinary(\n') 11980 self.e_lfanew.exportLiteral(outfile, level, name_='e_lfanew') 11981 showIndent(outfile, level) 11982 outfile.write('),\n')
11983 - def build(self, node):
11984 self.buildAttributes(node, node.attrib, []) 11985 for child in node: 11986 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 11987 self.buildChildren(child, node, nodeName_)
11988 - def buildAttributes(self, node, attrs, already_processed):
11989 pass
11990 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11991 if nodeName_ == 'Hashes': 11992 obj_ = HashesType1.factory() 11993 obj_.build(child_) 11994 self.set_Hashes(obj_) 11995 elif nodeName_ == 'signature': 11996 obj_ = xs_hexBinary.factory() 11997 obj_.build(child_) 11998 self.set_signature(obj_) 11999 elif nodeName_ == 'lastsize': 12000 obj_ = xs_hexBinary.factory() 12001 obj_.build(child_) 12002 self.set_lastsize(obj_) 12003 elif nodeName_ == 'nblocks': 12004 obj_ = xs_hexBinary.factory() 12005 obj_.build(child_) 12006 self.set_nblocks(obj_) 12007 elif nodeName_ == 'nreloc': 12008 obj_ = xs_hexBinary.factory() 12009 obj_.build(child_) 12010 self.set_nreloc(obj_) 12011 elif nodeName_ == 'hdrsize': 12012 obj_ = xs_hexBinary.factory() 12013 obj_.build(child_) 12014 self.set_hdrsize(obj_) 12015 elif nodeName_ == 'minalloc': 12016 obj_ = xs_hexBinary.factory() 12017 obj_.build(child_) 12018 self.set_minalloc(obj_) 12019 elif nodeName_ == 'maxalloc': 12020 obj_ = xs_hexBinary.factory() 12021 obj_.build(child_) 12022 self.set_maxalloc(obj_) 12023 elif nodeName_ == 'checksum': 12024 obj_ = xs_hexBinary.factory() 12025 obj_.build(child_) 12026 self.set_checksum(obj_) 12027 elif nodeName_ == 'relocpos': 12028 obj_ = xs_hexBinary.factory() 12029 obj_.build(child_) 12030 self.set_relocpos(obj_) 12031 elif nodeName_ == 'noverlay': 12032 obj_ = xs_hexBinary.factory() 12033 obj_.build(child_) 12034 self.set_noverlay(obj_) 12035 elif nodeName_ == 'reserved1': 12036 obj_ = xs_hexBinary.factory() 12037 obj_.build(child_) 12038 self.set_reserved1(obj_) 12039 elif nodeName_ == 'oem_id': 12040 obj_ = xs_hexBinary.factory() 12041 obj_.build(child_) 12042 self.set_oem_id(obj_) 12043 elif nodeName_ == 'oem_info': 12044 obj_ = xs_hexBinary.factory() 12045 obj_.build(child_) 12046 self.set_oem_info(obj_) 12047 elif nodeName_ == 'reserved2': 12048 obj_ = xs_hexBinary.factory() 12049 obj_.build(child_) 12050 self.set_reserved2(obj_) 12051 elif nodeName_ == 'e_lfanew': 12052 obj_ = xs_hexBinary.factory() 12053 obj_.build(child_) 12054 self.set_e_lfanew(obj_)
12055 # end class DOS_HeaderType 12056 12057
12058 -class HashesType1(GeneratedsSuper):
12059 subclass = None 12060 superclass = None
12061 - def __init__(self, Hash=None):
12062 if Hash is None: 12063 self.Hash = [] 12064 else: 12065 self.Hash = Hash
12066 - def factory(*args_, **kwargs_):
12067 if HashesType1.subclass: 12068 return HashesType1.subclass(*args_, **kwargs_) 12069 else: 12070 return HashesType1(*args_, **kwargs_)
12071 factory = staticmethod(factory)
12072 - def get_Hash(self): return self.Hash
12073 - def set_Hash(self, Hash): self.Hash = Hash
12074 - def add_Hash(self, value): self.Hash.append(value)
12075 - def insert_Hash(self, index, value): self.Hash[index] = value
12076 - def export(self, outfile, level, namespace_='maec:', name_='HashesType1', namespacedef_=''):
12077 showIndent(outfile, level) 12078 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 12079 already_processed = [] 12080 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType1') 12081 if self.hasContent_(): 12082 outfile.write('>\n') 12083 self.exportChildren(outfile, level + 1, namespace_, name_) 12084 showIndent(outfile, level) 12085 outfile.write('</%s%s>\n' % (namespace_, name_)) 12086 else: 12087 outfile.write('/>\n')
12088 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType1'):
12089 pass
12090 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType1', fromsubclass_=False):
12091 for Hash_ in self.Hash: 12092 Hash_.export(outfile, level, namespace_, name_='Hash')
12093 - def hasContent_(self):
12094 if ( 12095 self.Hash 12096 ): 12097 return True 12098 else: 12099 return False
12100 - def exportLiteral(self, outfile, level, name_='HashesType1'):
12101 level += 1 12102 self.exportLiteralAttributes(outfile, level, [], name_) 12103 if self.hasContent_(): 12104 self.exportLiteralChildren(outfile, level, name_)
12105 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
12106 pass
12107 - def exportLiteralChildren(self, outfile, level, name_):
12108 showIndent(outfile, level) 12109 outfile.write('Hash=[\n') 12110 level += 1 12111 for Hash_ in self.Hash: 12112 showIndent(outfile, level) 12113 outfile.write('model_.HashType(\n') 12114 Hash_.exportLiteral(outfile, level, name_='HashType') 12115 showIndent(outfile, level) 12116 outfile.write('),\n') 12117 level -= 1 12118 showIndent(outfile, level) 12119 outfile.write('],\n')
12120 - def build(self, node):
12121 self.buildAttributes(node, node.attrib, []) 12122 for child in node: 12123 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 12124 self.buildChildren(child, node, nodeName_)
12125 - def buildAttributes(self, node, attrs, already_processed):
12126 pass
12127 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
12128 if nodeName_ == 'Hash': 12129 obj_ = HashType.factory() 12130 obj_.build(child_) 12131 self.Hash.append(obj_)
12132 # end class HashesType1 12133 12134
12135 -class PE_HeaderType(GeneratedsSuper):
12136 subclass = None 12137 superclass = None
12138 - def __init__(self, Hashes=None, Entropy=None, Signature=None, File_Header=None, Optional_Header=None):
12139 self.Hashes = Hashes 12140 self.Entropy = Entropy 12141 self.Signature = Signature 12142 self.File_Header = File_Header 12143 self.Optional_Header = Optional_Header
12144 - def factory(*args_, **kwargs_):
12145 if PE_HeaderType.subclass: 12146 return PE_HeaderType.subclass(*args_, **kwargs_) 12147 else: 12148 return PE_HeaderType(*args_, **kwargs_)
12149 factory = staticmethod(factory)
12150 - def get_Hashes(self): return self.Hashes
12151 - def set_Hashes(self, Hashes): self.Hashes = Hashes
12152 - def get_Entropy(self): return self.Entropy
12153 - def set_Entropy(self, Entropy): self.Entropy = Entropy
12154 - def get_Signature(self): return self.Signature
12155 - def set_Signature(self, Signature): self.Signature = Signature
12156 - def get_File_Header(self): return self.File_Header
12157 - def set_File_Header(self, File_Header): self.File_Header = File_Header
12158 - def get_Optional_Header(self): return self.Optional_Header
12159 - def set_Optional_Header(self, Optional_Header): self.Optional_Header = Optional_Header
12160 - def export(self, outfile, level, namespace_='maec:', name_='PE_HeaderType', namespacedef_=''):
12161 showIndent(outfile, level) 12162 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 12163 already_processed = [] 12164 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PE_HeaderType') 12165 if self.hasContent_(): 12166 outfile.write('>\n') 12167 self.exportChildren(outfile, level + 1, namespace_, name_) 12168 showIndent(outfile, level) 12169 outfile.write('</%s%s>\n' % (namespace_, name_)) 12170 else: 12171 outfile.write('/>\n')
12172 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PE_HeaderType'):
12173 pass
12174 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PE_HeaderType', fromsubclass_=False):
12175 if self.Hashes is not None: 12176 self.Hashes.export(outfile, level, namespace_, name_='Hashes') 12177 if self.Entropy is not None: 12178 showIndent(outfile, level) 12179 outfile.write('<%sEntropy>%s</%sEntropy>\n' % (namespace_, self.gds_format_float(self.Entropy, input_name='Entropy'), namespace_)) 12180 if self.Signature is not None: 12181 self.Signature.export(outfile, level, namespace_, name_='Signature') 12182 if self.File_Header is not None: 12183 self.File_Header.export(outfile, level, namespace_, name_='File_Header') 12184 if self.Optional_Header is not None: 12185 self.Optional_Header.export(outfile, level, namespace_, name_='Optional_Header')
12186 - def hasContent_(self):
12187 if ( 12188 self.Hashes is not None or 12189 self.Entropy is not None or 12190 self.Signature is not None or 12191 self.File_Header is not None or 12192 self.Optional_Header is not None 12193 ): 12194 return True 12195 else: 12196 return False
12197 - def exportLiteral(self, outfile, level, name_='PE_HeaderType'):
12198 level += 1 12199 self.exportLiteralAttributes(outfile, level, [], name_) 12200 if self.hasContent_(): 12201 self.exportLiteralChildren(outfile, level, name_)
12202 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
12203 pass
12204 - def exportLiteralChildren(self, outfile, level, name_):
12205 if self.Hashes is not None: 12206 showIndent(outfile, level) 12207 outfile.write('Hashes=model_.HashesType2(\n') 12208 self.Hashes.exportLiteral(outfile, level, name_='Hashes') 12209 showIndent(outfile, level) 12210 outfile.write('),\n') 12211 if self.Entropy is not None: 12212 showIndent(outfile, level) 12213 outfile.write('Entropy=%f,\n' % self.Entropy) 12214 if self.Signature is not None: 12215 showIndent(outfile, level) 12216 outfile.write('Signature=model_.xs_hexBinary(\n') 12217 self.Signature.exportLiteral(outfile, level, name_='Signature') 12218 showIndent(outfile, level) 12219 outfile.write('),\n') 12220 if self.File_Header is not None: 12221 showIndent(outfile, level) 12222 outfile.write('File_Header=model_.File_HeaderType(\n') 12223 self.File_Header.exportLiteral(outfile, level, name_='File_Header') 12224 showIndent(outfile, level) 12225 outfile.write('),\n') 12226 if self.Optional_Header is not None: 12227 showIndent(outfile, level) 12228 outfile.write('Optional_Header=model_.Optional_HeaderType(\n') 12229 self.Optional_Header.exportLiteral(outfile, level, name_='Optional_Header') 12230 showIndent(outfile, level) 12231 outfile.write('),\n')
12232 - def build(self, node):
12233 self.buildAttributes(node, node.attrib, []) 12234 for child in node: 12235 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 12236 self.buildChildren(child, node, nodeName_)
12237 - def buildAttributes(self, node, attrs, already_processed):
12238 pass
12239 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
12240 if nodeName_ == 'Hashes': 12241 obj_ = HashesType2.factory() 12242 obj_.build(child_) 12243 self.set_Hashes(obj_) 12244 elif nodeName_ == 'Entropy': 12245 sval_ = child_.text 12246 try: 12247 fval_ = float(sval_) 12248 except (TypeError, ValueError) as e: 12249 raise_parse_error(child_, 'requires float or double: %s' % e) 12250 fval_ = self.gds_validate_float(fval_, node, 'Entropy') 12251 self.Entropy = fval_ 12252 elif nodeName_ == 'Signature': 12253 obj_ = xs_hexBinary.factory() 12254 obj_.build(child_) 12255 self.set_Signature(obj_) 12256 elif nodeName_ == 'File_Header': 12257 obj_ = File_HeaderType.factory() 12258 obj_.build(child_) 12259 self.set_File_Header(obj_) 12260 elif nodeName_ == 'Optional_Header': 12261 obj_ = Optional_HeaderType.factory() 12262 obj_.build(child_) 12263 self.set_Optional_Header(obj_)
12264 # end class PE_HeaderType 12265 12266
12267 -class HashesType2(GeneratedsSuper):
12268 subclass = None 12269 superclass = None
12270 - def __init__(self, Hash=None):
12271 if Hash is None: 12272 self.Hash = [] 12273 else: 12274 self.Hash = Hash
12275 - def factory(*args_, **kwargs_):
12276 if HashesType2.subclass: 12277 return HashesType2.subclass(*args_, **kwargs_) 12278 else: 12279 return HashesType2(*args_, **kwargs_)
12280 factory = staticmethod(factory)
12281 - def get_Hash(self): return self.Hash
12282 - def set_Hash(self, Hash): self.Hash = Hash
12283 - def add_Hash(self, value): self.Hash.append(value)
12284 - def insert_Hash(self, index, value): self.Hash[index] = value
12285 - def export(self, outfile, level, namespace_='maec:', name_='HashesType2', namespacedef_=''):
12286 showIndent(outfile, level) 12287 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 12288 already_processed = [] 12289 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType2') 12290 if self.hasContent_(): 12291 outfile.write('>\n') 12292 self.exportChildren(outfile, level + 1, namespace_, name_) 12293 showIndent(outfile, level) 12294 outfile.write('</%s%s>\n' % (namespace_, name_)) 12295 else: 12296 outfile.write('/>\n')
12297 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType2'):
12298 pass
12299 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType2', fromsubclass_=False):
12300 for Hash_ in self.Hash: 12301 Hash_.export(outfile, level, namespace_, name_='Hash')
12302 - def hasContent_(self):
12303 if ( 12304 self.Hash 12305 ): 12306 return True 12307 else: 12308 return False
12309 - def exportLiteral(self, outfile, level, name_='HashesType2'):
12310 level += 1 12311 self.exportLiteralAttributes(outfile, level, [], name_) 12312 if self.hasContent_(): 12313 self.exportLiteralChildren(outfile, level, name_)
12314 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
12315 pass
12316 - def exportLiteralChildren(self, outfile, level, name_):
12317 showIndent(outfile, level) 12318 outfile.write('Hash=[\n') 12319 level += 1 12320 for Hash_ in self.Hash: 12321 showIndent(outfile, level) 12322 outfile.write('model_.HashType(\n') 12323 Hash_.exportLiteral(outfile, level, name_='HashType') 12324 showIndent(outfile, level) 12325 outfile.write('),\n') 12326 level -= 1 12327 showIndent(outfile, level) 12328 outfile.write('],\n')
12329 - def build(self, node):
12330 self.buildAttributes(node, node.attrib, []) 12331 for child in node: 12332 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 12333 self.buildChildren(child, node, nodeName_)
12334 - def buildAttributes(self, node, attrs, already_processed):
12335 pass
12336 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
12337 if nodeName_ == 'Hash': 12338 obj_ = HashType.factory() 12339 obj_.build(child_) 12340 self.Hash.append(obj_)
12341 # end class HashesType2 12342 12343
12344 -class File_HeaderType(GeneratedsSuper):
12345 subclass = None 12346 superclass = None
12347 - def __init__(self, Hashes=None, Machine=None, Number_Of_Sections=None, Time_Date_Stamp=None, Pointer_To_Symbol_Table=None, Number_Of_Symbols=None, Size_Of_Optional_Header=None, Characteristics=None):
12348 self.Hashes = Hashes 12349 self.Machine = Machine 12350 self.Number_Of_Sections = Number_Of_Sections 12351 self.Time_Date_Stamp = Time_Date_Stamp 12352 self.Pointer_To_Symbol_Table = Pointer_To_Symbol_Table 12353 self.Number_Of_Symbols = Number_Of_Symbols 12354 self.Size_Of_Optional_Header = Size_Of_Optional_Header 12355 self.Characteristics = Characteristics
12356 - def factory(*args_, **kwargs_):
12357 if File_HeaderType.subclass: 12358 return File_HeaderType.subclass(*args_, **kwargs_) 12359 else: 12360 return File_HeaderType(*args_, **kwargs_)
12361 factory = staticmethod(factory)
12362 - def get_Hashes(self): return self.Hashes
12363 - def set_Hashes(self, Hashes): self.Hashes = Hashes
12364 - def get_Machine(self): return self.Machine
12365 - def set_Machine(self, Machine): self.Machine = Machine
12366 - def get_Number_Of_Sections(self): return self.Number_Of_Sections
12367 - def set_Number_Of_Sections(self, Number_Of_Sections): self.Number_Of_Sections = Number_Of_Sections
12368 - def get_Time_Date_Stamp(self): return self.Time_Date_Stamp
12369 - def set_Time_Date_Stamp(self, Time_Date_Stamp): self.Time_Date_Stamp = Time_Date_Stamp
12370 - def get_Pointer_To_Symbol_Table(self): return self.Pointer_To_Symbol_Table
12371 - def set_Pointer_To_Symbol_Table(self, Pointer_To_Symbol_Table): self.Pointer_To_Symbol_Table = Pointer_To_Symbol_Table
12372 - def get_Number_Of_Symbols(self): return self.Number_Of_Symbols
12373 - def set_Number_Of_Symbols(self, Number_Of_Symbols): self.Number_Of_Symbols = Number_Of_Symbols
12374 - def get_Size_Of_Optional_Header(self): return self.Size_Of_Optional_Header
12375 - def set_Size_Of_Optional_Header(self, Size_Of_Optional_Header): self.Size_Of_Optional_Header = Size_Of_Optional_Header
12376 - def get_Characteristics(self): return self.Characteristics
12377 - def set_Characteristics(self, Characteristics): self.Characteristics = Characteristics
12378 - def export(self, outfile, level, namespace_='maec:', name_='File_HeaderType', namespacedef_=''):
12379 showIndent(outfile, level) 12380 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 12381 already_processed = [] 12382 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_HeaderType') 12383 if self.hasContent_(): 12384 outfile.write('>\n') 12385 self.exportChildren(outfile, level + 1, namespace_, name_) 12386 showIndent(outfile, level) 12387 outfile.write('</%s%s>\n' % (namespace_, name_)) 12388 else: 12389 outfile.write('/>\n')
12390 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_HeaderType'):
12391 pass
12392 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_HeaderType', fromsubclass_=False):
12393 if self.Hashes is not None: 12394 self.Hashes.export(outfile, level, namespace_, name_='Hashes') 12395 if self.Machine is not None: 12396 self.Machine.export(outfile, level, namespace_, name_='Machine') 12397 if self.Number_Of_Sections is not None: 12398 showIndent(outfile, level) 12399 outfile.write('<%sNumber_Of_Sections>%s</%sNumber_Of_Sections>\n' % (namespace_, self.gds_format_integer(self.Number_Of_Sections, input_name='Number_Of_Sections'), namespace_)) 12400 if self.Time_Date_Stamp is not None: 12401 self.Time_Date_Stamp.export(outfile, level, namespace_, name_='Time_Date_Stamp') 12402 if self.Pointer_To_Symbol_Table is not None: 12403 self.Pointer_To_Symbol_Table.export(outfile, level, namespace_, name_='Pointer_To_Symbol_Table') 12404 if self.Number_Of_Symbols is not None: 12405 showIndent(outfile, level) 12406 outfile.write('<%sNumber_Of_Symbols>%s</%sNumber_Of_Symbols>\n' % (namespace_, self.gds_format_integer(self.Number_Of_Symbols, input_name='Number_Of_Symbols'), namespace_)) 12407 if self.Size_Of_Optional_Header is not None: 12408 self.Size_Of_Optional_Header.export(outfile, level, namespace_, name_='Size_Of_Optional_Header') 12409 if self.Characteristics is not None: 12410 self.Characteristics.export(outfile, level, namespace_, name_='Characteristics')
12411 - def hasContent_(self):
12412 if ( 12413 self.Hashes is not None or 12414 self.Machine is not None or 12415 self.Number_Of_Sections is not None or 12416 self.Time_Date_Stamp is not None or 12417 self.Pointer_To_Symbol_Table is not None or 12418 self.Number_Of_Symbols is not None or 12419 self.Size_Of_Optional_Header is not None or 12420 self.Characteristics is not None 12421 ): 12422 return True 12423 else: 12424 return False
12425 - def exportLiteral(self, outfile, level, name_='File_HeaderType'):
12426 level += 1 12427 self.exportLiteralAttributes(outfile, level, [], name_) 12428 if self.hasContent_(): 12429 self.exportLiteralChildren(outfile, level, name_)
12430 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
12431 pass
12432 - def exportLiteralChildren(self, outfile, level, name_):
12433 if self.Hashes is not None: 12434 showIndent(outfile, level) 12435 outfile.write('Hashes=model_.HashesType3(\n') 12436 self.Hashes.exportLiteral(outfile, level, name_='Hashes') 12437 showIndent(outfile, level) 12438 outfile.write('),\n') 12439 if self.Machine is not None: 12440 showIndent(outfile, level) 12441 outfile.write('Machine=model_.xs_hexBinary(\n') 12442 self.Machine.exportLiteral(outfile, level, name_='Machine') 12443 showIndent(outfile, level) 12444 outfile.write('),\n') 12445 if self.Number_Of_Sections is not None: 12446 showIndent(outfile, level) 12447 outfile.write('Number_Of_Sections=%d,\n' % self.Number_Of_Sections) 12448 if self.Time_Date_Stamp is not None: 12449 showIndent(outfile, level) 12450 outfile.write('Time_Date_Stamp=model_.xs_hexBinary(\n') 12451 self.Time_Date_Stamp.exportLiteral(outfile, level, name_='Time_Date_Stamp') 12452 showIndent(outfile, level) 12453 outfile.write('),\n') 12454 if self.Pointer_To_Symbol_Table is not None: 12455 showIndent(outfile, level) 12456 outfile.write('Pointer_To_Symbol_Table=model_.xs_hexBinary(\n') 12457 self.Pointer_To_Symbol_Table.exportLiteral(outfile, level, name_='Pointer_To_Symbol_Table') 12458 showIndent(outfile, level) 12459 outfile.write('),\n') 12460 if self.Number_Of_Symbols is not None: 12461 showIndent(outfile, level) 12462 outfile.write('Number_Of_Symbols=%d,\n' % self.Number_Of_Symbols) 12463 if self.Size_Of_Optional_Header is not None: 12464 showIndent(outfile, level) 12465 outfile.write('Size_Of_Optional_Header=model_.xs_hexBinary(\n') 12466 self.Size_Of_Optional_Header.exportLiteral(outfile, level, name_='Size_Of_Optional_Header') 12467 showIndent(outfile, level) 12468 outfile.write('),\n') 12469 if self.Characteristics is not None: 12470 showIndent(outfile, level) 12471 outfile.write('Characteristics=model_.xs_hexBinary(\n') 12472 self.Characteristics.exportLiteral(outfile, level, name_='Characteristics') 12473 showIndent(outfile, level) 12474 outfile.write('),\n')
12475 - def build(self, node):
12476 self.buildAttributes(node, node.attrib, []) 12477 for child in node: 12478 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 12479 self.buildChildren(child, node, nodeName_)
12480 - def buildAttributes(self, node, attrs, already_processed):
12481 pass
12482 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
12483 if nodeName_ == 'Hashes': 12484 obj_ = HashesType3.factory() 12485 obj_.build(child_) 12486 self.set_Hashes(obj_) 12487 elif nodeName_ == 'Machine': 12488 obj_ = xs_hexBinary.factory() 12489 obj_.build(child_) 12490 self.set_Machine(obj_) 12491 elif nodeName_ == 'Number_Of_Sections': 12492 sval_ = child_.text 12493 try: 12494 ival_ = int(sval_) 12495 except (TypeError, ValueError), exp: 12496 raise_parse_error(child_, 'requires integer: %s' % exp) 12497 ival_ = self.gds_validate_integer(ival_, node, 'Number_Of_Sections') 12498 self.Number_Of_Sections = ival_ 12499 elif nodeName_ == 'Time_Date_Stamp': 12500 obj_ = xs_hexBinary.factory() 12501 obj_.build(child_) 12502 self.set_Time_Date_Stamp(obj_) 12503 elif nodeName_ == 'Pointer_To_Symbol_Table': 12504 obj_ = xs_hexBinary.factory() 12505 obj_.build(child_) 12506 self.set_Pointer_To_Symbol_Table(obj_) 12507 elif nodeName_ == 'Number_Of_Symbols': 12508 sval_ = child_.text 12509 try: 12510 ival_ = int(sval_) 12511 except (TypeError, ValueError) as e: 12512 raise_parse_error(child_, 'requires integer: %s' % e) 12513 ival_ = self.gds_validate_integer(ival_, node, 'Number_Of_Symbols') 12514 self.Number_Of_Symbols = ival_ 12515 elif nodeName_ == 'Size_Of_Optional_Header': 12516 obj_ = xs_hexBinary.factory() 12517 obj_.build(child_) 12518 self.set_Size_Of_Optional_Header(obj_) 12519 elif nodeName_ == 'Characteristics': 12520 obj_ = xs_hexBinary.factory() 12521 obj_.build(child_) 12522 self.set_Characteristics(obj_)
12523 # end class File_HeaderType 12524 12525
12526 -class HashesType3(GeneratedsSuper):
12527 subclass = None 12528 superclass = None
12529 - def __init__(self, Hash=None):
12530 if Hash is None: 12531 self.Hash = [] 12532 else: 12533 self.Hash = Hash
12534 - def factory(*args_, **kwargs_):
12535 if HashesType3.subclass: 12536 return HashesType3.subclass(*args_, **kwargs_) 12537 else: 12538 return HashesType3(*args_, **kwargs_)
12539 factory = staticmethod(factory)
12540 - def get_Hash(self): return self.Hash
12541 - def set_Hash(self, Hash): self.Hash = Hash
12542 - def add_Hash(self, value): self.Hash.append(value)
12543 - def insert_Hash(self, index, value): self.Hash[index] = value
12544 - def export(self, outfile, level, namespace_='maec:', name_='HashesType3', namespacedef_=''):
12545 showIndent(outfile, level) 12546 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 12547 already_processed = [] 12548 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType3') 12549 if self.hasContent_(): 12550 outfile.write('>\n') 12551 self.exportChildren(outfile, level + 1, namespace_, name_) 12552 showIndent(outfile, level) 12553 outfile.write('</%s%s>\n' % (namespace_, name_)) 12554 else: 12555 outfile.write('/>\n')
12556 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType3'):
12557 pass
12558 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType3', fromsubclass_=False):
12559 for Hash_ in self.Hash: 12560 Hash_.export(outfile, level, namespace_, name_='Hash')
12561 - def hasContent_(self):
12562 if ( 12563 self.Hash 12564 ): 12565 return True 12566 else: 12567 return False
12568 - def exportLiteral(self, outfile, level, name_='HashesType3'):
12569 level += 1 12570 self.exportLiteralAttributes(outfile, level, [], name_) 12571 if self.hasContent_(): 12572 self.exportLiteralChildren(outfile, level, name_)
12573 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
12574 pass
12575 - def exportLiteralChildren(self, outfile, level, name_):
12576 showIndent(outfile, level) 12577 outfile.write('Hash=[\n') 12578 level += 1 12579 for Hash_ in self.Hash: 12580 showIndent(outfile, level) 12581 outfile.write('model_.HashType(\n') 12582 Hash_.exportLiteral(outfile, level, name_='HashType') 12583 showIndent(outfile, level) 12584 outfile.write('),\n') 12585 level -= 1 12586 showIndent(outfile, level) 12587 outfile.write('],\n')
12588 - def build(self, node):
12589 self.buildAttributes(node, node.attrib, []) 12590 for child in node: 12591 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 12592 self.buildChildren(child, node, nodeName_)
12593 - def buildAttributes(self, node, attrs, already_processed):
12594 pass
12595 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
12596 if nodeName_ == 'Hash': 12597 obj_ = HashType.factory() 12598 obj_.build(child_) 12599 self.Hash.append(obj_)
12600 # end class HashesType3 12601 12602
12603 -class Optional_HeaderType(GeneratedsSuper):
12604 subclass = None 12605 superclass = None
12606 - def __init__(self, Hashes=None, Major_Linker_Version=None, Minor_Linker_Version=None, Size_Of_Code=None, Size_Of_Initialized_Data=None, Size_Of_Uninitialized_Data=None, Address_Of_Entry_Point=None, Base_Of_Code=None, Base_Of_Data=None, Image_Base=None, Section_Alignment=None, File_Alignment=None, Major_OS_Version=None, Minor_OS_Version=None, Major_Image_Version=None, Minor_Image_Version=None, Major_Subsystem_Version=None, Minor_Subsystem_Version=None, Reserved=None, Size_Of_Image=None, Size_Of_Headers=None, Checksum=None, Subsystem=None, DLL_Characteristics=None, Size_Of_Stack_Reserve=None, Size_Of_Stack_Commit=None, Size_Of_Heap_Reserve=None, Size_Of_Heap_Commit=None, Loader_Flags=None, Number_Of_Rva_And_Sizes=None, Data_Directory=None):
12607 self.Hashes = Hashes 12608 self.Major_Linker_Version = Major_Linker_Version 12609 self.Minor_Linker_Version = Minor_Linker_Version 12610 self.Size_Of_Code = Size_Of_Code 12611 self.Size_Of_Initialized_Data = Size_Of_Initialized_Data 12612 self.Size_Of_Uninitialized_Data = Size_Of_Uninitialized_Data 12613 self.Address_Of_Entry_Point = Address_Of_Entry_Point 12614 self.Base_Of_Code = Base_Of_Code 12615 self.Base_Of_Data = Base_Of_Data 12616 self.Image_Base = Image_Base 12617 self.Section_Alignment = Section_Alignment 12618 self.File_Alignment = File_Alignment 12619 self.Major_OS_Version = Major_OS_Version 12620 self.Minor_OS_Version = Minor_OS_Version 12621 self.Major_Image_Version = Major_Image_Version 12622 self.Minor_Image_Version = Minor_Image_Version 12623 self.Major_Subsystem_Version = Major_Subsystem_Version 12624 self.Minor_Subsystem_Version = Minor_Subsystem_Version 12625 self.Reserved = Reserved 12626 self.Size_Of_Image = Size_Of_Image 12627 self.Size_Of_Headers = Size_Of_Headers 12628 self.Checksum = Checksum 12629 self.Subsystem = Subsystem 12630 self.DLL_Characteristics = DLL_Characteristics 12631 self.Size_Of_Stack_Reserve = Size_Of_Stack_Reserve 12632 self.Size_Of_Stack_Commit = Size_Of_Stack_Commit 12633 self.Size_Of_Heap_Reserve = Size_Of_Heap_Reserve 12634 self.Size_Of_Heap_Commit = Size_Of_Heap_Commit 12635 self.Loader_Flags = Loader_Flags 12636 self.Number_Of_Rva_And_Sizes = Number_Of_Rva_And_Sizes 12637 self.Data_Directory = Data_Directory
12638 - def factory(*args_, **kwargs_):
12639 if Optional_HeaderType.subclass: 12640 return Optional_HeaderType.subclass(*args_, **kwargs_) 12641 else: 12642 return Optional_HeaderType(*args_, **kwargs_)
12643 factory = staticmethod(factory)
12644 - def get_Hashes(self): return self.Hashes
12645 - def set_Hashes(self, Hashes): self.Hashes = Hashes
12646 - def get_Major_Linker_Version(self): return self.Major_Linker_Version
12647 - def set_Major_Linker_Version(self, Major_Linker_Version): self.Major_Linker_Version = Major_Linker_Version
12648 - def get_Minor_Linker_Version(self): return self.Minor_Linker_Version
12649 - def set_Minor_Linker_Version(self, Minor_Linker_Version): self.Minor_Linker_Version = Minor_Linker_Version
12650 - def get_Size_Of_Code(self): return self.Size_Of_Code
12651 - def set_Size_Of_Code(self, Size_Of_Code): self.Size_Of_Code = Size_Of_Code
12652 - def get_Size_Of_Initialized_Data(self): return self.Size_Of_Initialized_Data
12653 - def set_Size_Of_Initialized_Data(self, Size_Of_Initialized_Data): self.Size_Of_Initialized_Data = Size_Of_Initialized_Data
12654 - def get_Size_Of_Uninitialized_Data(self): return self.Size_Of_Uninitialized_Data
12655 - def set_Size_Of_Uninitialized_Data(self, Size_Of_Uninitialized_Data): self.Size_Of_Uninitialized_Data = Size_Of_Uninitialized_Data
12656 - def get_Address_Of_Entry_Point(self): return self.Address_Of_Entry_Point
12657 - def set_Address_Of_Entry_Point(self, Address_Of_Entry_Point): self.Address_Of_Entry_Point = Address_Of_Entry_Point
12658 - def get_Base_Of_Code(self): return self.Base_Of_Code
12659 - def set_Base_Of_Code(self, Base_Of_Code): self.Base_Of_Code = Base_Of_Code
12660 - def get_Base_Of_Data(self): return self.Base_Of_Data
12661 - def set_Base_Of_Data(self, Base_Of_Data): self.Base_Of_Data = Base_Of_Data
12662 - def get_Image_Base(self): return self.Image_Base
12663 - def set_Image_Base(self, Image_Base): self.Image_Base = Image_Base
12664 - def get_Section_Alignment(self): return self.Section_Alignment
12665 - def set_Section_Alignment(self, Section_Alignment): self.Section_Alignment = Section_Alignment
12666 - def get_File_Alignment(self): return self.File_Alignment
12667 - def set_File_Alignment(self, File_Alignment): self.File_Alignment = File_Alignment
12668 - def get_Major_OS_Version(self): return self.Major_OS_Version
12669 - def set_Major_OS_Version(self, Major_OS_Version): self.Major_OS_Version = Major_OS_Version
12670 - def get_Minor_OS_Version(self): return self.Minor_OS_Version
12671 - def set_Minor_OS_Version(self, Minor_OS_Version): self.Minor_OS_Version = Minor_OS_Version
12672 - def get_Major_Image_Version(self): return self.Major_Image_Version
12673 - def set_Major_Image_Version(self, Major_Image_Version): self.Major_Image_Version = Major_Image_Version
12674 - def get_Minor_Image_Version(self): return self.Minor_Image_Version
12675 - def set_Minor_Image_Version(self, Minor_Image_Version): self.Minor_Image_Version = Minor_Image_Version
12676 - def get_Major_Subsystem_Version(self): return self.Major_Subsystem_Version
12677 - def set_Major_Subsystem_Version(self, Major_Subsystem_Version): self.Major_Subsystem_Version = Major_Subsystem_Version
12678 - def get_Minor_Subsystem_Version(self): return self.Minor_Subsystem_Version
12679 - def set_Minor_Subsystem_Version(self, Minor_Subsystem_Version): self.Minor_Subsystem_Version = Minor_Subsystem_Version
12680 - def get_Reserved(self): return self.Reserved
12681 - def set_Reserved(self, Reserved): self.Reserved = Reserved
12682 - def get_Size_Of_Image(self): return self.Size_Of_Image
12683 - def set_Size_Of_Image(self, Size_Of_Image): self.Size_Of_Image = Size_Of_Image
12684 - def get_Size_Of_Headers(self): return self.Size_Of_Headers
12685 - def set_Size_Of_Headers(self, Size_Of_Headers): self.Size_Of_Headers = Size_Of_Headers
12686 - def get_Checksum(self): return self.Checksum
12687 - def set_Checksum(self, Checksum): self.Checksum = Checksum
12688 - def get_Subsystem(self): return self.Subsystem
12689 - def set_Subsystem(self, Subsystem): self.Subsystem = Subsystem
12690 - def get_DLL_Characteristics(self): return self.DLL_Characteristics
12691 - def set_DLL_Characteristics(self, DLL_Characteristics): self.DLL_Characteristics = DLL_Characteristics
12692 - def get_Size_Of_Stack_Reserve(self): return self.Size_Of_Stack_Reserve
12693 - def set_Size_Of_Stack_Reserve(self, Size_Of_Stack_Reserve): self.Size_Of_Stack_Reserve = Size_Of_Stack_Reserve
12694 - def get_Size_Of_Stack_Commit(self): return self.Size_Of_Stack_Commit
12695 - def set_Size_Of_Stack_Commit(self, Size_Of_Stack_Commit): self.Size_Of_Stack_Commit = Size_Of_Stack_Commit
12696 - def get_Size_Of_Heap_Reserve(self): return self.Size_Of_Heap_Reserve
12697 - def set_Size_Of_Heap_Reserve(self, Size_Of_Heap_Reserve): self.Size_Of_Heap_Reserve = Size_Of_Heap_Reserve
12698 - def get_Size_Of_Heap_Commit(self): return self.Size_Of_Heap_Commit
12699 - def set_Size_Of_Heap_Commit(self, Size_Of_Heap_Commit): self.Size_Of_Heap_Commit = Size_Of_Heap_Commit
12700 - def get_Loader_Flags(self): return self.Loader_Flags
12701 - def set_Loader_Flags(self, Loader_Flags): self.Loader_Flags = Loader_Flags
12702 - def get_Number_Of_Rva_And_Sizes(self): return self.Number_Of_Rva_And_Sizes
12703 - def set_Number_Of_Rva_And_Sizes(self, Number_Of_Rva_And_Sizes): self.Number_Of_Rva_And_Sizes = Number_Of_Rva_And_Sizes
12704 - def get_Data_Directory(self): return self.Data_Directory
12705 - def set_Data_Directory(self, Data_Directory): self.Data_Directory = Data_Directory
12706 - def export(self, outfile, level, namespace_='maec:', name_='Optional_HeaderType', namespacedef_=''):
12707 showIndent(outfile, level) 12708 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 12709 already_processed = [] 12710 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Optional_HeaderType') 12711 if self.hasContent_(): 12712 outfile.write('>\n') 12713 self.exportChildren(outfile, level + 1, namespace_, name_) 12714 showIndent(outfile, level) 12715 outfile.write('</%s%s>\n' % (namespace_, name_)) 12716 else: 12717 outfile.write('/>\n')
12718 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Optional_HeaderType'):
12719 pass
12720 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Optional_HeaderType', fromsubclass_=False):
12721 if self.Hashes is not None: 12722 self.Hashes.export(outfile, level, namespace_, name_='Hashes') 12723 if self.Major_Linker_Version is not None: 12724 self.Major_Linker_Version.export(outfile, level, namespace_, name_='Major_Linker_Version') 12725 if self.Minor_Linker_Version is not None: 12726 self.Minor_Linker_Version.export(outfile, level, namespace_, name_='Minor_Linker_Version') 12727 if self.Size_Of_Code is not None: 12728 self.Size_Of_Code.export(outfile, level, namespace_, name_='Size_Of_Code') 12729 if self.Size_Of_Initialized_Data is not None: 12730 self.Size_Of_Initialized_Data.export(outfile, level, namespace_, name_='Size_Of_Initialized_Data') 12731 if self.Size_Of_Uninitialized_Data is not None: 12732 self.Size_Of_Uninitialized_Data.export(outfile, level, namespace_, name_='Size_Of_Uninitialized_Data') 12733 if self.Address_Of_Entry_Point is not None: 12734 self.Address_Of_Entry_Point.export(outfile, level, namespace_, name_='Address_Of_Entry_Point') 12735 if self.Base_Of_Code is not None: 12736 self.Base_Of_Code.export(outfile, level, namespace_, name_='Base_Of_Code') 12737 if self.Base_Of_Data is not None: 12738 self.Base_Of_Data.export(outfile, level, namespace_, name_='Base_Of_Data') 12739 if self.Image_Base is not None: 12740 self.Image_Base.export(outfile, level, namespace_, name_='Image_Base') 12741 if self.Section_Alignment is not None: 12742 self.Section_Alignment.export(outfile, level, namespace_, name_='Section_Alignment') 12743 if self.File_Alignment is not None: 12744 self.File_Alignment.export(outfile, level, namespace_, name_='File_Alignment') 12745 if self.Major_OS_Version is not None: 12746 self.Major_OS_Version.export(outfile, level, namespace_, name_='Major_OS_Version') 12747 if self.Minor_OS_Version is not None: 12748 self.Minor_OS_Version.export(outfile, level, namespace_, name_='Minor_OS_Version') 12749 if self.Major_Image_Version is not None: 12750 self.Major_Image_Version.export(outfile, level, namespace_, name_='Major_Image_Version') 12751 if self.Minor_Image_Version is not None: 12752 self.Minor_Image_Version.export(outfile, level, namespace_, name_='Minor_Image_Version') 12753 if self.Major_Subsystem_Version is not None: 12754 self.Major_Subsystem_Version.export(outfile, level, namespace_, name_='Major_Subsystem_Version') 12755 if self.Minor_Subsystem_Version is not None: 12756 self.Minor_Subsystem_Version.export(outfile, level, namespace_, name_='Minor_Subsystem_Version') 12757 if self.Reserved is not None: 12758 self.Reserved.export(outfile, level, namespace_, name_='Reserved') 12759 if self.Size_Of_Image is not None: 12760 self.Size_Of_Image.export(outfile, level, namespace_, name_='Size_Of_Image') 12761 if self.Size_Of_Headers is not None: 12762 self.Size_Of_Headers.export(outfile, level, namespace_, name_='Size_Of_Headers') 12763 if self.Checksum is not None: 12764 self.Checksum.export(outfile, level, namespace_, name_='Checksum') 12765 if self.Subsystem is not None: 12766 self.Subsystem.export(outfile, level, namespace_, name_='Subsystem') 12767 if self.DLL_Characteristics is not None: 12768 self.DLL_Characteristics.export(outfile, level, namespace_, name_='DLL_Characteristics') 12769 if self.Size_Of_Stack_Reserve is not None: 12770 self.Size_Of_Stack_Reserve.export(outfile, level, namespace_, name_='Size_Of_Stack_Reserve') 12771 if self.Size_Of_Stack_Commit is not None: 12772 self.Size_Of_Stack_Commit.export(outfile, level, namespace_, name_='Size_Of_Stack_Commit') 12773 if self.Size_Of_Heap_Reserve is not None: 12774 self.Size_Of_Heap_Reserve.export(outfile, level, namespace_, name_='Size_Of_Heap_Reserve') 12775 if self.Size_Of_Heap_Commit is not None: 12776 self.Size_Of_Heap_Commit.export(outfile, level, namespace_, name_='Size_Of_Heap_Commit') 12777 if self.Loader_Flags is not None: 12778 self.Loader_Flags.export(outfile, level, namespace_, name_='Loader_Flags') 12779 if self.Number_Of_Rva_And_Sizes is not None: 12780 self.Number_Of_Rva_And_Sizes.export(outfile, level, namespace_, name_='Number_Of_Rva_And_Sizes') 12781 if self.Data_Directory is not None: 12782 self.Data_Directory.export(outfile, level, namespace_, name_='Data_Directory')
12783 - def hasContent_(self):
12784 if ( 12785 self.Hashes is not None or 12786 self.Major_Linker_Version is not None or 12787 self.Minor_Linker_Version is not None or 12788 self.Size_Of_Code is not None or 12789 self.Size_Of_Initialized_Data is not None or 12790 self.Size_Of_Uninitialized_Data is not None or 12791 self.Address_Of_Entry_Point is not None or 12792 self.Base_Of_Code is not None or 12793 self.Base_Of_Data is not None or 12794 self.Image_Base is not None or 12795 self.Section_Alignment is not None or 12796 self.File_Alignment is not None or 12797 self.Major_OS_Version is not None or 12798 self.Minor_OS_Version is not None or 12799 self.Major_Image_Version is not None or 12800 self.Minor_Image_Version is not None or 12801 self.Major_Subsystem_Version is not None or 12802 self.Minor_Subsystem_Version is not None or 12803 self.Reserved is not None or 12804 self.Size_Of_Image is not None or 12805 self.Size_Of_Headers is not None or 12806 self.Checksum is not None or 12807 self.Subsystem is not None or 12808 self.DLL_Characteristics is not None or 12809 self.Size_Of_Stack_Reserve is not None or 12810 self.Size_Of_Stack_Commit is not None or 12811 self.Size_Of_Heap_Reserve is not None or 12812 self.Size_Of_Heap_Commit is not None or 12813 self.Loader_Flags is not None or 12814 self.Number_Of_Rva_And_Sizes is not None or 12815 self.Data_Directory is not None 12816 ): 12817 return True 12818 else: 12819 return False
12820 - def exportLiteral(self, outfile, level, name_='Optional_HeaderType'):
12821 level += 1 12822 self.exportLiteralAttributes(outfile, level, [], name_) 12823 if self.hasContent_(): 12824 self.exportLiteralChildren(outfile, level, name_)
12825 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
12826 pass
12827 - def exportLiteralChildren(self, outfile, level, name_):
12828 if self.Hashes is not None: 12829 showIndent(outfile, level) 12830 outfile.write('Hashes=model_.HashesType4(\n') 12831 self.Hashes.exportLiteral(outfile, level, name_='Hashes') 12832 showIndent(outfile, level) 12833 outfile.write('),\n') 12834 if self.Major_Linker_Version is not None: 12835 showIndent(outfile, level) 12836 outfile.write('Major_Linker_Version=model_.xs_hexBinary(\n') 12837 self.Major_Linker_Version.exportLiteral(outfile, level, name_='Major_Linker_Version') 12838 showIndent(outfile, level) 12839 outfile.write('),\n') 12840 if self.Minor_Linker_Version is not None: 12841 showIndent(outfile, level) 12842 outfile.write('Minor_Linker_Version=model_.xs_hexBinary(\n') 12843 self.Minor_Linker_Version.exportLiteral(outfile, level, name_='Minor_Linker_Version') 12844 showIndent(outfile, level) 12845 outfile.write('),\n') 12846 if self.Size_Of_Code is not None: 12847 showIndent(outfile, level) 12848 outfile.write('Size_Of_Code=model_.xs_hexBinary(\n') 12849 self.Size_Of_Code.exportLiteral(outfile, level, name_='Size_Of_Code') 12850 showIndent(outfile, level) 12851 outfile.write('),\n') 12852 if self.Size_Of_Initialized_Data is not None: 12853 showIndent(outfile, level) 12854 outfile.write('Size_Of_Initialized_Data=model_.xs_hexBinary(\n') 12855 self.Size_Of_Initialized_Data.exportLiteral(outfile, level, name_='Size_Of_Initialized_Data') 12856 showIndent(outfile, level) 12857 outfile.write('),\n') 12858 if self.Size_Of_Uninitialized_Data is not None: 12859 showIndent(outfile, level) 12860 outfile.write('Size_Of_Uninitialized_Data=model_.xs_hexBinary(\n') 12861 self.Size_Of_Uninitialized_Data.exportLiteral(outfile, level, name_='Size_Of_Uninitialized_Data') 12862 showIndent(outfile, level) 12863 outfile.write('),\n') 12864 if self.Address_Of_Entry_Point is not None: 12865 showIndent(outfile, level) 12866 outfile.write('Address_Of_Entry_Point=model_.xs_hexBinary(\n') 12867 self.Address_Of_Entry_Point.exportLiteral(outfile, level, name_='Address_Of_Entry_Point') 12868 showIndent(outfile, level) 12869 outfile.write('),\n') 12870 if self.Base_Of_Code is not None: 12871 showIndent(outfile, level) 12872 outfile.write('Base_Of_Code=model_.xs_hexBinary(\n') 12873 self.Base_Of_Code.exportLiteral(outfile, level, name_='Base_Of_Code') 12874 showIndent(outfile, level) 12875 outfile.write('),\n') 12876 if self.Base_Of_Data is not None: 12877 showIndent(outfile, level) 12878 outfile.write('Base_Of_Data=model_.xs_hexBinary(\n') 12879 self.Base_Of_Data.exportLiteral(outfile, level, name_='Base_Of_Data') 12880 showIndent(outfile, level) 12881 outfile.write('),\n') 12882 if self.Image_Base is not None: 12883 showIndent(outfile, level) 12884 outfile.write('Image_Base=model_.xs_hexBinary(\n') 12885 self.Image_Base.exportLiteral(outfile, level, name_='Image_Base') 12886 showIndent(outfile, level) 12887 outfile.write('),\n') 12888 if self.Section_Alignment is not None: 12889 showIndent(outfile, level) 12890 outfile.write('Section_Alignment=model_.xs_hexBinary(\n') 12891 self.Section_Alignment.exportLiteral(outfile, level, name_='Section_Alignment') 12892 showIndent(outfile, level) 12893 outfile.write('),\n') 12894 if self.File_Alignment is not None: 12895 showIndent(outfile, level) 12896 outfile.write('File_Alignment=model_.xs_hexBinary(\n') 12897 self.File_Alignment.exportLiteral(outfile, level, name_='File_Alignment') 12898 showIndent(outfile, level) 12899 outfile.write('),\n') 12900 if self.Major_OS_Version is not None: 12901 showIndent(outfile, level) 12902 outfile.write('Major_OS_Version=model_.xs_hexBinary(\n') 12903 self.Major_OS_Version.exportLiteral(outfile, level, name_='Major_OS_Version') 12904 showIndent(outfile, level) 12905 outfile.write('),\n') 12906 if self.Minor_OS_Version is not None: 12907 showIndent(outfile, level) 12908 outfile.write('Minor_OS_Version=model_.xs_hexBinary(\n') 12909 self.Minor_OS_Version.exportLiteral(outfile, level, name_='Minor_OS_Version') 12910 showIndent(outfile, level) 12911 outfile.write('),\n') 12912 if self.Major_Image_Version is not None: 12913 showIndent(outfile, level) 12914 outfile.write('Major_Image_Version=model_.xs_hexBinary(\n') 12915 self.Major_Image_Version.exportLiteral(outfile, level, name_='Major_Image_Version') 12916 showIndent(outfile, level) 12917 outfile.write('),\n') 12918 if self.Minor_Image_Version is not None: 12919 showIndent(outfile, level) 12920 outfile.write('Minor_Image_Version=model_.xs_hexBinary(\n') 12921 self.Minor_Image_Version.exportLiteral(outfile, level, name_='Minor_Image_Version') 12922 showIndent(outfile, level) 12923 outfile.write('),\n') 12924 if self.Major_Subsystem_Version is not None: 12925 showIndent(outfile, level) 12926 outfile.write('Major_Subsystem_Version=model_.xs_hexBinary(\n') 12927 self.Major_Subsystem_Version.exportLiteral(outfile, level, name_='Major_Subsystem_Version') 12928 showIndent(outfile, level) 12929 outfile.write('),\n') 12930 if self.Minor_Subsystem_Version is not None: 12931 showIndent(outfile, level) 12932 outfile.write('Minor_Subsystem_Version=model_.xs_hexBinary(\n') 12933 self.Minor_Subsystem_Version.exportLiteral(outfile, level, name_='Minor_Subsystem_Version') 12934 showIndent(outfile, level) 12935 outfile.write('),\n') 12936 if self.Reserved is not None: 12937 showIndent(outfile, level) 12938 outfile.write('Reserved=model_.xs_hexBinary(\n') 12939 self.Reserved.exportLiteral(outfile, level, name_='Reserved') 12940 showIndent(outfile, level) 12941 outfile.write('),\n') 12942 if self.Size_Of_Image is not None: 12943 showIndent(outfile, level) 12944 outfile.write('Size_Of_Image=model_.xs_hexBinary(\n') 12945 self.Size_Of_Image.exportLiteral(outfile, level, name_='Size_Of_Image') 12946 showIndent(outfile, level) 12947 outfile.write('),\n') 12948 if self.Size_Of_Headers is not None: 12949 showIndent(outfile, level) 12950 outfile.write('Size_Of_Headers=model_.xs_hexBinary(\n') 12951 self.Size_Of_Headers.exportLiteral(outfile, level, name_='Size_Of_Headers') 12952 showIndent(outfile, level) 12953 outfile.write('),\n') 12954 if self.Checksum is not None: 12955 showIndent(outfile, level) 12956 outfile.write('Checksum=model_.xs_hexBinary(\n') 12957 self.Checksum.exportLiteral(outfile, level, name_='Checksum') 12958 showIndent(outfile, level) 12959 outfile.write('),\n') 12960 if self.Subsystem is not None: 12961 showIndent(outfile, level) 12962 outfile.write('Subsystem=model_.xs_hexBinary(\n') 12963 self.Subsystem.exportLiteral(outfile, level, name_='Subsystem') 12964 showIndent(outfile, level) 12965 outfile.write('),\n') 12966 if self.DLL_Characteristics is not None: 12967 showIndent(outfile, level) 12968 outfile.write('DLL_Characteristics=model_.xs_hexBinary(\n') 12969 self.DLL_Characteristics.exportLiteral(outfile, level, name_='DLL_Characteristics') 12970 showIndent(outfile, level) 12971 outfile.write('),\n') 12972 if self.Size_Of_Stack_Reserve is not None: 12973 showIndent(outfile, level) 12974 outfile.write('Size_Of_Stack_Reserve=model_.xs_hexBinary(\n') 12975 self.Size_Of_Stack_Reserve.exportLiteral(outfile, level, name_='Size_Of_Stack_Reserve') 12976 showIndent(outfile, level) 12977 outfile.write('),\n') 12978 if self.Size_Of_Stack_Commit is not None: 12979 showIndent(outfile, level) 12980 outfile.write('Size_Of_Stack_Commit=model_.xs_hexBinary(\n') 12981 self.Size_Of_Stack_Commit.exportLiteral(outfile, level, name_='Size_Of_Stack_Commit') 12982 showIndent(outfile, level) 12983 outfile.write('),\n') 12984 if self.Size_Of_Heap_Reserve is not None: 12985 showIndent(outfile, level) 12986 outfile.write('Size_Of_Heap_Reserve=model_.xs_hexBinary(\n') 12987 self.Size_Of_Heap_Reserve.exportLiteral(outfile, level, name_='Size_Of_Heap_Reserve') 12988 showIndent(outfile, level) 12989 outfile.write('),\n') 12990 if self.Size_Of_Heap_Commit is not None: 12991 showIndent(outfile, level) 12992 outfile.write('Size_Of_Heap_Commit=model_.xs_hexBinary(\n') 12993 self.Size_Of_Heap_Commit.exportLiteral(outfile, level, name_='Size_Of_Heap_Commit') 12994 showIndent(outfile, level) 12995 outfile.write('),\n') 12996 if self.Loader_Flags is not None: 12997 showIndent(outfile, level) 12998 outfile.write('Loader_Flags=model_.xs_hexBinary(\n') 12999 self.Loader_Flags.exportLiteral(outfile, level, name_='Loader_Flags') 13000 showIndent(outfile, level) 13001 outfile.write('),\n') 13002 if self.Number_Of_Rva_And_Sizes is not None: 13003 showIndent(outfile, level) 13004 outfile.write('Number_Of_Rva_And_Sizes=model_.xs_hexBinary(\n') 13005 self.Number_Of_Rva_And_Sizes.exportLiteral(outfile, level, name_='Number_Of_Rva_And_Sizes') 13006 showIndent(outfile, level) 13007 outfile.write('),\n') 13008 if self.Data_Directory is not None: 13009 showIndent(outfile, level) 13010 outfile.write('Data_Directory=model_.Data_DirectoryType(\n') 13011 self.Data_Directory.exportLiteral(outfile, level, name_='Data_Directory') 13012 showIndent(outfile, level) 13013 outfile.write('),\n')
13014 - def build(self, node):
13015 self.buildAttributes(node, node.attrib, []) 13016 for child in node: 13017 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13018 self.buildChildren(child, node, nodeName_)
13019 - def buildAttributes(self, node, attrs, already_processed):
13020 pass
13021 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13022 if nodeName_ == 'Hashes': 13023 obj_ = HashesType4.factory() 13024 obj_.build(child_) 13025 self.set_Hashes(obj_) 13026 elif nodeName_ == 'Major_Linker_Version': 13027 obj_ = xs_hexBinary.factory() 13028 obj_.build(child_) 13029 self.set_Major_Linker_Version(obj_) 13030 elif nodeName_ == 'Minor_Linker_Version': 13031 obj_ = xs_hexBinary.factory() 13032 obj_.build(child_) 13033 self.set_Minor_Linker_Version(obj_) 13034 elif nodeName_ == 'Size_Of_Code': 13035 obj_ = xs_hexBinary.factory() 13036 obj_.build(child_) 13037 self.set_Size_Of_Code(obj_) 13038 elif nodeName_ == 'Size_Of_Initialized_Data': 13039 obj_ = xs_hexBinary.factory() 13040 obj_.build(child_) 13041 self.set_Size_Of_Initialized_Data(obj_) 13042 elif nodeName_ == 'Size_Of_Uninitialized_Data': 13043 obj_ = xs_hexBinary.factory() 13044 obj_.build(child_) 13045 self.set_Size_Of_Uninitialized_Data(obj_) 13046 elif nodeName_ == 'Address_Of_Entry_Point': 13047 obj_ = xs_hexBinary.factory() 13048 obj_.build(child_) 13049 self.set_Address_Of_Entry_Point(obj_) 13050 elif nodeName_ == 'Base_Of_Code': 13051 obj_ = xs_hexBinary.factory() 13052 obj_.build(child_) 13053 self.set_Base_Of_Code(obj_) 13054 elif nodeName_ == 'Base_Of_Data': 13055 obj_ = xs_hexBinary.factory() 13056 obj_.build(child_) 13057 self.set_Base_Of_Data(obj_) 13058 elif nodeName_ == 'Image_Base': 13059 obj_ = xs_hexBinary.factory() 13060 obj_.build(child_) 13061 self.set_Image_Base(obj_) 13062 elif nodeName_ == 'Section_Alignment': 13063 obj_ = xs_hexBinary.factory() 13064 obj_.build(child_) 13065 self.set_Section_Alignment(obj_) 13066 elif nodeName_ == 'File_Alignment': 13067 obj_ = xs_hexBinary.factory() 13068 obj_.build(child_) 13069 self.set_File_Alignment(obj_) 13070 elif nodeName_ == 'Major_OS_Version': 13071 obj_ = xs_hexBinary.factory() 13072 obj_.build(child_) 13073 self.set_Major_OS_Version(obj_) 13074 elif nodeName_ == 'Minor_OS_Version': 13075 obj_ = xs_hexBinary.factory() 13076 obj_.build(child_) 13077 self.set_Minor_OS_Version(obj_) 13078 elif nodeName_ == 'Major_Image_Version': 13079 obj_ = xs_hexBinary.factory() 13080 obj_.build(child_) 13081 self.set_Major_Image_Version(obj_) 13082 elif nodeName_ == 'Minor_Image_Version': 13083 obj_ = xs_hexBinary.factory() 13084 obj_.build(child_) 13085 self.set_Minor_Image_Version(obj_) 13086 elif nodeName_ == 'Major_Subsystem_Version': 13087 obj_ = xs_hexBinary.factory() 13088 obj_.build(child_) 13089 self.set_Major_Subsystem_Version(obj_) 13090 elif nodeName_ == 'Minor_Subsystem_Version': 13091 obj_ = xs_hexBinary.factory() 13092 obj_.build(child_) 13093 self.set_Minor_Subsystem_Version(obj_) 13094 elif nodeName_ == 'Reserved': 13095 obj_ = xs_hexBinary.factory() 13096 obj_.build(child_) 13097 self.set_Reserved(obj_) 13098 elif nodeName_ == 'Size_Of_Image': 13099 obj_ = xs_hexBinary.factory() 13100 obj_.build(child_) 13101 self.set_Size_Of_Image(obj_) 13102 elif nodeName_ == 'Size_Of_Headers': 13103 obj_ = xs_hexBinary.factory() 13104 obj_.build(child_) 13105 self.set_Size_Of_Headers(obj_) 13106 elif nodeName_ == 'Checksum': 13107 obj_ = xs_hexBinary.factory() 13108 obj_.build(child_) 13109 self.set_Checksum(obj_) 13110 elif nodeName_ == 'Subsystem': 13111 obj_ = xs_hexBinary.factory() 13112 obj_.build(child_) 13113 self.set_Subsystem(obj_) 13114 elif nodeName_ == 'DLL_Characteristics': 13115 obj_ = xs_hexBinary.factory() 13116 obj_.build(child_) 13117 self.set_DLL_Characteristics(obj_) 13118 elif nodeName_ == 'Size_Of_Stack_Reserve': 13119 obj_ = xs_hexBinary.factory() 13120 obj_.build(child_) 13121 self.set_Size_Of_Stack_Reserve(obj_) 13122 elif nodeName_ == 'Size_Of_Stack_Commit': 13123 obj_ = xs_hexBinary.factory() 13124 obj_.build(child_) 13125 self.set_Size_Of_Stack_Commit(obj_) 13126 elif nodeName_ == 'Size_Of_Heap_Reserve': 13127 obj_ = xs_hexBinary.factory() 13128 obj_.build(child_) 13129 self.set_Size_Of_Heap_Reserve(obj_) 13130 elif nodeName_ == 'Size_Of_Heap_Commit': 13131 obj_ = xs_hexBinary.factory() 13132 obj_.build(child_) 13133 self.set_Size_Of_Heap_Commit(obj_) 13134 elif nodeName_ == 'Loader_Flags': 13135 obj_ = xs_hexBinary.factory() 13136 obj_.build(child_) 13137 self.set_Loader_Flags(obj_) 13138 elif nodeName_ == 'Number_Of_Rva_And_Sizes': 13139 obj_ = xs_hexBinary.factory() 13140 obj_.build(child_) 13141 self.set_Number_Of_Rva_And_Sizes(obj_) 13142 elif nodeName_ == 'Data_Directory': 13143 obj_ = Data_DirectoryType.factory() 13144 obj_.build(child_) 13145 self.set_Data_Directory(obj_)
13146 # end class Optional_HeaderType 13147 13148
13149 -class HashesType4(GeneratedsSuper):
13150 subclass = None 13151 superclass = None
13152 - def __init__(self, Hash=None):
13153 if Hash is None: 13154 self.Hash = [] 13155 else: 13156 self.Hash = Hash
13157 - def factory(*args_, **kwargs_):
13158 if HashesType4.subclass: 13159 return HashesType4.subclass(*args_, **kwargs_) 13160 else: 13161 return HashesType4(*args_, **kwargs_)
13162 factory = staticmethod(factory)
13163 - def get_Hash(self): return self.Hash
13164 - def set_Hash(self, Hash): self.Hash = Hash
13165 - def add_Hash(self, value): self.Hash.append(value)
13166 - def insert_Hash(self, index, value): self.Hash[index] = value
13167 - def export(self, outfile, level, namespace_='maec:', name_='HashesType4', namespacedef_=''):
13168 showIndent(outfile, level) 13169 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 13170 already_processed = [] 13171 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType4') 13172 if self.hasContent_(): 13173 outfile.write('>\n') 13174 self.exportChildren(outfile, level + 1, namespace_, name_) 13175 showIndent(outfile, level) 13176 outfile.write('</%s%s>\n' % (namespace_, name_)) 13177 else: 13178 outfile.write('/>\n')
13179 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType4'):
13180 pass
13181 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType4', fromsubclass_=False):
13182 for Hash_ in self.Hash: 13183 Hash_.export(outfile, level, namespace_, name_='Hash')
13184 - def hasContent_(self):
13185 if ( 13186 self.Hash 13187 ): 13188 return True 13189 else: 13190 return False
13191 - def exportLiteral(self, outfile, level, name_='HashesType4'):
13192 level += 1 13193 self.exportLiteralAttributes(outfile, level, [], name_) 13194 if self.hasContent_(): 13195 self.exportLiteralChildren(outfile, level, name_)
13196 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
13197 pass
13198 - def exportLiteralChildren(self, outfile, level, name_):
13199 showIndent(outfile, level) 13200 outfile.write('Hash=[\n') 13201 level += 1 13202 for Hash_ in self.Hash: 13203 showIndent(outfile, level) 13204 outfile.write('model_.HashType(\n') 13205 Hash_.exportLiteral(outfile, level, name_='HashType') 13206 showIndent(outfile, level) 13207 outfile.write('),\n') 13208 level -= 1 13209 showIndent(outfile, level) 13210 outfile.write('],\n')
13211 - def build(self, node):
13212 self.buildAttributes(node, node.attrib, []) 13213 for child in node: 13214 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13215 self.buildChildren(child, node, nodeName_)
13216 - def buildAttributes(self, node, attrs, already_processed):
13217 pass
13218 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13219 if nodeName_ == 'Hash': 13220 obj_ = HashType.factory() 13221 obj_.build(child_) 13222 self.Hash.append(obj_)
13223 # end class HashesType4 13224 13225
13226 -class Data_DirectoryType(GeneratedsSuper):
13227 subclass = None 13228 superclass = None
13229 - def __init__(self, Export_Symbols=None, Import_Symbols=None, Resources=None, Exception=None, Security=None, Base_Relocation=None, Debug=None, Architecture=None, Copyright_String=None, Unknown=None, Thread_Local_Storage=None, Load_Configuration=None, Bound_Import=None, Import_Address_Table=None, Delay_Import=None, COM_Descriptor=None):
13230 self.Export_Symbols = Export_Symbols 13231 self.Import_Symbols = Import_Symbols 13232 self.Resources = Resources 13233 self.Exception = Exception 13234 self.Security = Security 13235 self.Base_Relocation = Base_Relocation 13236 self.Debug = Debug 13237 self.Architecture = Architecture 13238 self.Copyright_String = Copyright_String 13239 self.Unknown = Unknown 13240 self.Thread_Local_Storage = Thread_Local_Storage 13241 self.Load_Configuration = Load_Configuration 13242 self.Bound_Import = Bound_Import 13243 self.Import_Address_Table = Import_Address_Table 13244 self.Delay_Import = Delay_Import 13245 self.COM_Descriptor = COM_Descriptor
13246 - def factory(*args_, **kwargs_):
13247 if Data_DirectoryType.subclass: 13248 return Data_DirectoryType.subclass(*args_, **kwargs_) 13249 else: 13250 return Data_DirectoryType(*args_, **kwargs_)
13251 factory = staticmethod(factory)
13252 - def get_Export_Symbols(self): return self.Export_Symbols
13253 - def set_Export_Symbols(self, Export_Symbols): self.Export_Symbols = Export_Symbols
13254 - def get_Import_Symbols(self): return self.Import_Symbols
13255 - def set_Import_Symbols(self, Import_Symbols): self.Import_Symbols = Import_Symbols
13256 - def get_Resources(self): return self.Resources
13257 - def set_Resources(self, Resources): self.Resources = Resources
13258 - def get_Exception(self): return self.Exception
13259 - def set_Exception(self, Exception): self.Exception = Exception
13260 - def get_Security(self): return self.Security
13261 - def set_Security(self, Security): self.Security = Security
13262 - def get_Base_Relocation(self): return self.Base_Relocation
13263 - def set_Base_Relocation(self, Base_Relocation): self.Base_Relocation = Base_Relocation
13264 - def get_Debug(self): return self.Debug
13265 - def set_Debug(self, Debug): self.Debug = Debug
13266 - def get_Architecture(self): return self.Architecture
13267 - def set_Architecture(self, Architecture): self.Architecture = Architecture
13270 - def get_Unknown(self): return self.Unknown
13271 - def set_Unknown(self, Unknown): self.Unknown = Unknown
13272 - def get_Thread_Local_Storage(self): return self.Thread_Local_Storage
13273 - def set_Thread_Local_Storage(self, Thread_Local_Storage): self.Thread_Local_Storage = Thread_Local_Storage
13274 - def get_Load_Configuration(self): return self.Load_Configuration
13275 - def set_Load_Configuration(self, Load_Configuration): self.Load_Configuration = Load_Configuration
13276 - def get_Bound_Import(self): return self.Bound_Import
13277 - def set_Bound_Import(self, Bound_Import): self.Bound_Import = Bound_Import
13278 - def get_Import_Address_Table(self): return self.Import_Address_Table
13279 - def set_Import_Address_Table(self, Import_Address_Table): self.Import_Address_Table = Import_Address_Table
13280 - def get_Delay_Import(self): return self.Delay_Import
13281 - def set_Delay_Import(self, Delay_Import): self.Delay_Import = Delay_Import
13282 - def get_COM_Descriptor(self): return self.COM_Descriptor
13283 - def set_COM_Descriptor(self, COM_Descriptor): self.COM_Descriptor = COM_Descriptor
13284 - def export(self, outfile, level, namespace_='maec:', name_='Data_DirectoryType', namespacedef_=''):
13285 showIndent(outfile, level) 13286 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 13287 already_processed = [] 13288 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Data_DirectoryType') 13289 if self.hasContent_(): 13290 outfile.write('>\n') 13291 self.exportChildren(outfile, level + 1, namespace_, name_) 13292 showIndent(outfile, level) 13293 outfile.write('</%s%s>\n' % (namespace_, name_)) 13294 else: 13295 outfile.write('/>\n')
13296 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Data_DirectoryType'):
13297 pass
13298 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Data_DirectoryType', fromsubclass_=False):
13299 if self.Export_Symbols is not None: 13300 self.Export_Symbols.export(outfile, level, namespace_, name_='Export_Symbols') 13301 if self.Import_Symbols is not None: 13302 self.Import_Symbols.export(outfile, level, namespace_, name_='Import_Symbols') 13303 if self.Resources is not None: 13304 self.Resources.export(outfile, level, namespace_, name_='Resources') 13305 if self.Exception is not None: 13306 self.Exception.export(outfile, level, namespace_, name_='Exception') 13307 if self.Security is not None: 13308 self.Security.export(outfile, level, namespace_, name_='Security') 13309 if self.Base_Relocation is not None: 13310 self.Base_Relocation.export(outfile, level, namespace_, name_='Base_Relocation') 13311 if self.Debug is not None: 13312 self.Debug.export(outfile, level, namespace_, name_='Debug') 13313 if self.Architecture is not None: 13314 self.Architecture.export(outfile, level, namespace_, name_='Architecture') 13315 if self.Copyright_String is not None: 13316 self.Copyright_String.export(outfile, level, namespace_, name_='Copyright_String') 13317 if self.Unknown is not None: 13318 self.Unknown.export(outfile, level, namespace_, name_='Unknown') 13319 if self.Thread_Local_Storage is not None: 13320 self.Thread_Local_Storage.export(outfile, level, namespace_, name_='Thread_Local_Storage') 13321 if self.Load_Configuration is not None: 13322 self.Load_Configuration.export(outfile, level, namespace_, name_='Load_Configuration') 13323 if self.Bound_Import is not None: 13324 self.Bound_Import.export(outfile, level, namespace_, name_='Bound_Import') 13325 if self.Import_Address_Table is not None: 13326 self.Import_Address_Table.export(outfile, level, namespace_, name_='Import_Address_Table') 13327 if self.Delay_Import is not None: 13328 self.Delay_Import.export(outfile, level, namespace_, name_='Delay_Import') 13329 if self.COM_Descriptor is not None: 13330 self.COM_Descriptor.export(outfile, level, namespace_, name_='COM_Descriptor')
13331 - def hasContent_(self):
13332 if ( 13333 self.Export_Symbols is not None or 13334 self.Import_Symbols is not None or 13335 self.Resources is not None or 13336 self.Exception is not None or 13337 self.Security is not None or 13338 self.Base_Relocation is not None or 13339 self.Debug is not None or 13340 self.Architecture is not None or 13341 self.Copyright_String is not None or 13342 self.Unknown is not None or 13343 self.Thread_Local_Storage is not None or 13344 self.Load_Configuration is not None or 13345 self.Bound_Import is not None or 13346 self.Import_Address_Table is not None or 13347 self.Delay_Import is not None or 13348 self.COM_Descriptor is not None 13349 ): 13350 return True 13351 else: 13352 return False
13353 - def exportLiteral(self, outfile, level, name_='Data_DirectoryType'):
13354 level += 1 13355 self.exportLiteralAttributes(outfile, level, [], name_) 13356 if self.hasContent_(): 13357 self.exportLiteralChildren(outfile, level, name_)
13358 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
13359 pass
13360 - def exportLiteralChildren(self, outfile, level, name_):
13361 if self.Export_Symbols is not None: 13362 showIndent(outfile, level) 13363 outfile.write('Export_Symbols=model_.PEDataDirectoryStruct(\n') 13364 self.Export_Symbols.exportLiteral(outfile, level, name_='Export_Symbols') 13365 showIndent(outfile, level) 13366 outfile.write('),\n') 13367 if self.Import_Symbols is not None: 13368 showIndent(outfile, level) 13369 outfile.write('Import_Symbols=model_.PEDataDirectoryStruct(\n') 13370 self.Import_Symbols.exportLiteral(outfile, level, name_='Import_Symbols') 13371 showIndent(outfile, level) 13372 outfile.write('),\n') 13373 if self.Resources is not None: 13374 showIndent(outfile, level) 13375 outfile.write('Resources=model_.PEDataDirectoryStruct(\n') 13376 self.Resources.exportLiteral(outfile, level, name_='Resources') 13377 showIndent(outfile, level) 13378 outfile.write('),\n') 13379 if self.Exception is not None: 13380 showIndent(outfile, level) 13381 outfile.write('Exception=model_.PEDataDirectoryStruct(\n') 13382 self.Exception.exportLiteral(outfile, level, name_='Exception') 13383 showIndent(outfile, level) 13384 outfile.write('),\n') 13385 if self.Security is not None: 13386 showIndent(outfile, level) 13387 outfile.write('Security=model_.PEDataDirectoryStruct(\n') 13388 self.Security.exportLiteral(outfile, level, name_='Security') 13389 showIndent(outfile, level) 13390 outfile.write('),\n') 13391 if self.Base_Relocation is not None: 13392 showIndent(outfile, level) 13393 outfile.write('Base_Relocation=model_.PEDataDirectoryStruct(\n') 13394 self.Base_Relocation.exportLiteral(outfile, level, name_='Base_Relocation') 13395 showIndent(outfile, level) 13396 outfile.write('),\n') 13397 if self.Debug is not None: 13398 showIndent(outfile, level) 13399 outfile.write('Debug=model_.PEDataDirectoryStruct(\n') 13400 self.Debug.exportLiteral(outfile, level, name_='Debug') 13401 showIndent(outfile, level) 13402 outfile.write('),\n') 13403 if self.Architecture is not None: 13404 showIndent(outfile, level) 13405 outfile.write('Architecture=model_.PEDataDirectoryStruct(\n') 13406 self.Architecture.exportLiteral(outfile, level, name_='Architecture') 13407 showIndent(outfile, level) 13408 outfile.write('),\n') 13409 if self.Copyright_String is not None: 13410 showIndent(outfile, level) 13411 outfile.write('Copyright_String=model_.PEDataDirectoryStruct(\n') 13412 self.Copyright_String.exportLiteral(outfile, level, name_='Copyright_String') 13413 showIndent(outfile, level) 13414 outfile.write('),\n') 13415 if self.Unknown is not None: 13416 showIndent(outfile, level) 13417 outfile.write('Unknown=model_.PEDataDirectoryStruct(\n') 13418 self.Unknown.exportLiteral(outfile, level, name_='Unknown') 13419 showIndent(outfile, level) 13420 outfile.write('),\n') 13421 if self.Thread_Local_Storage is not None: 13422 showIndent(outfile, level) 13423 outfile.write('Thread_Local_Storage=model_.PEDataDirectoryStruct(\n') 13424 self.Thread_Local_Storage.exportLiteral(outfile, level, name_='Thread_Local_Storage') 13425 showIndent(outfile, level) 13426 outfile.write('),\n') 13427 if self.Load_Configuration is not None: 13428 showIndent(outfile, level) 13429 outfile.write('Load_Configuration=model_.PEDataDirectoryStruct(\n') 13430 self.Load_Configuration.exportLiteral(outfile, level, name_='Load_Configuration') 13431 showIndent(outfile, level) 13432 outfile.write('),\n') 13433 if self.Bound_Import is not None: 13434 showIndent(outfile, level) 13435 outfile.write('Bound_Import=model_.PEDataDirectoryStruct(\n') 13436 self.Bound_Import.exportLiteral(outfile, level, name_='Bound_Import') 13437 showIndent(outfile, level) 13438 outfile.write('),\n') 13439 if self.Import_Address_Table is not None: 13440 showIndent(outfile, level) 13441 outfile.write('Import_Address_Table=model_.PEDataDirectoryStruct(\n') 13442 self.Import_Address_Table.exportLiteral(outfile, level, name_='Import_Address_Table') 13443 showIndent(outfile, level) 13444 outfile.write('),\n') 13445 if self.Delay_Import is not None: 13446 showIndent(outfile, level) 13447 outfile.write('Delay_Import=model_.PEDataDirectoryStruct(\n') 13448 self.Delay_Import.exportLiteral(outfile, level, name_='Delay_Import') 13449 showIndent(outfile, level) 13450 outfile.write('),\n') 13451 if self.COM_Descriptor is not None: 13452 showIndent(outfile, level) 13453 outfile.write('COM_Descriptor=model_.PEDataDirectoryStruct(\n') 13454 self.COM_Descriptor.exportLiteral(outfile, level, name_='COM_Descriptor') 13455 showIndent(outfile, level) 13456 outfile.write('),\n')
13457 - def build(self, node):
13458 self.buildAttributes(node, node.attrib, []) 13459 for child in node: 13460 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13461 self.buildChildren(child, node, nodeName_)
13462 - def buildAttributes(self, node, attrs, already_processed):
13463 pass
13464 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13465 if nodeName_ == 'Export_Symbols': 13466 obj_ = PEDataDirectoryStruct.factory() 13467 obj_.build(child_) 13468 self.set_Export_Symbols(obj_) 13469 elif nodeName_ == 'Import_Symbols': 13470 obj_ = PEDataDirectoryStruct.factory() 13471 obj_.build(child_) 13472 self.set_Import_Symbols(obj_) 13473 elif nodeName_ == 'Resources': 13474 obj_ = PEDataDirectoryStruct.factory() 13475 obj_.build(child_) 13476 self.set_Resources(obj_) 13477 elif nodeName_ == 'Exception': 13478 obj_ = PEDataDirectoryStruct.factory() 13479 obj_.build(child_) 13480 self.set_Exception(obj_) 13481 elif nodeName_ == 'Security': 13482 obj_ = PEDataDirectoryStruct.factory() 13483 obj_.build(child_) 13484 self.set_Security(obj_) 13485 elif nodeName_ == 'Base_Relocation': 13486 obj_ = PEDataDirectoryStruct.factory() 13487 obj_.build(child_) 13488 self.set_Base_Relocation(obj_) 13489 elif nodeName_ == 'Debug': 13490 obj_ = PEDataDirectoryStruct.factory() 13491 obj_.build(child_) 13492 self.set_Debug(obj_) 13493 elif nodeName_ == 'Architecture': 13494 obj_ = PEDataDirectoryStruct.factory() 13495 obj_.build(child_) 13496 self.set_Architecture(obj_) 13497 elif nodeName_ == 'Copyright_String': 13498 obj_ = PEDataDirectoryStruct.factory() 13499 obj_.build(child_) 13500 self.set_Copyright_String(obj_) 13501 elif nodeName_ == 'Unknown': 13502 obj_ = PEDataDirectoryStruct.factory() 13503 obj_.build(child_) 13504 self.set_Unknown(obj_) 13505 elif nodeName_ == 'Thread_Local_Storage': 13506 obj_ = PEDataDirectoryStruct.factory() 13507 obj_.build(child_) 13508 self.set_Thread_Local_Storage(obj_) 13509 elif nodeName_ == 'Load_Configuration': 13510 obj_ = PEDataDirectoryStruct.factory() 13511 obj_.build(child_) 13512 self.set_Load_Configuration(obj_) 13513 elif nodeName_ == 'Bound_Import': 13514 obj_ = PEDataDirectoryStruct.factory() 13515 obj_.build(child_) 13516 self.set_Bound_Import(obj_) 13517 elif nodeName_ == 'Import_Address_Table': 13518 obj_ = PEDataDirectoryStruct.factory() 13519 obj_.build(child_) 13520 self.set_Import_Address_Table(obj_) 13521 elif nodeName_ == 'Delay_Import': 13522 obj_ = PEDataDirectoryStruct.factory() 13523 obj_.build(child_) 13524 self.set_Delay_Import(obj_) 13525 elif nodeName_ == 'COM_Descriptor': 13526 obj_ = PEDataDirectoryStruct.factory() 13527 obj_.build(child_) 13528 self.set_COM_Descriptor(obj_)
13529 # end class Data_DirectoryType 13530 13531
13532 -class Section_TableType(GeneratedsSuper):
13533 subclass = None 13534 superclass = None
13535 - def __init__(self, Section_Header=None):
13536 if Section_Header is None: 13537 self.Section_Header = [] 13538 else: 13539 self.Section_Header = Section_Header
13540 - def factory(*args_, **kwargs_):
13541 if Section_TableType.subclass: 13542 return Section_TableType.subclass(*args_, **kwargs_) 13543 else: 13544 return Section_TableType(*args_, **kwargs_)
13545 factory = staticmethod(factory)
13546 - def get_Section_Header(self): return self.Section_Header
13547 - def set_Section_Header(self, Section_Header): self.Section_Header = Section_Header
13548 - def add_Section_Header(self, value): self.Section_Header.append(value)
13549 - def insert_Section_Header(self, index, value): self.Section_Header[index] = value
13550 - def export(self, outfile, level, namespace_='maec:', name_='Section_TableType', namespacedef_=''):
13551 showIndent(outfile, level) 13552 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 13553 already_processed = [] 13554 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Section_TableType') 13555 if self.hasContent_(): 13556 outfile.write('>\n') 13557 self.exportChildren(outfile, level + 1, namespace_, name_) 13558 showIndent(outfile, level) 13559 outfile.write('</%s%s>\n' % (namespace_, name_)) 13560 else: 13561 outfile.write('/>\n')
13562 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Section_TableType'):
13563 pass
13564 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Section_TableType', fromsubclass_=False):
13565 for Section_Header_ in self.Section_Header: 13566 Section_Header_.export(outfile, level, namespace_, name_='Section_Header')
13567 - def hasContent_(self):
13568 if ( 13569 self.Section_Header 13570 ): 13571 return True 13572 else: 13573 return False
13574 - def exportLiteral(self, outfile, level, name_='Section_TableType'):
13575 level += 1 13576 self.exportLiteralAttributes(outfile, level, [], name_) 13577 if self.hasContent_(): 13578 self.exportLiteralChildren(outfile, level, name_)
13579 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
13580 pass
13581 - def exportLiteralChildren(self, outfile, level, name_):
13582 showIndent(outfile, level) 13583 outfile.write('Section_Header=[\n') 13584 level += 1 13585 for Section_Header_ in self.Section_Header: 13586 showIndent(outfile, level) 13587 outfile.write('model_.PESectionHeaderStruct(\n') 13588 Section_Header_.exportLiteral(outfile, level, name_='PESectionHeaderStruct') 13589 showIndent(outfile, level) 13590 outfile.write('),\n') 13591 level -= 1 13592 showIndent(outfile, level) 13593 outfile.write('],\n')
13594 - def build(self, node):
13595 self.buildAttributes(node, node.attrib, []) 13596 for child in node: 13597 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13598 self.buildChildren(child, node, nodeName_)
13599 - def buildAttributes(self, node, attrs, already_processed):
13600 pass
13601 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13602 if nodeName_ == 'Section_Header': 13603 obj_ = PESectionHeaderStruct.factory() 13604 obj_.build(child_) 13605 self.Section_Header.append(obj_)
13606 # end class Section_TableType 13607 13608
13609 -class StringsType(GeneratedsSuper):
13610 subclass = None 13611 superclass = None
13612 - def __init__(self, String=None):
13613 if String is None: 13614 self.String = [] 13615 else: 13616 self.String = String
13617 - def factory(*args_, **kwargs_):
13618 if StringsType.subclass: 13619 return StringsType.subclass(*args_, **kwargs_) 13620 else: 13621 return StringsType(*args_, **kwargs_)
13622 factory = staticmethod(factory)
13623 - def get_String(self): return self.String
13624 - def set_String(self, String): self.String = String
13625 - def add_String(self, value): self.String.append(value)
13626 - def insert_String(self, index, value): self.String[index] = value
13627 - def export(self, outfile, level, namespace_='maec:', name_='StringsType', namespacedef_=''):
13628 showIndent(outfile, level) 13629 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 13630 already_processed = [] 13631 self.exportAttributes(outfile, level, already_processed, namespace_, name_='StringsType') 13632 if self.hasContent_(): 13633 outfile.write('>\n') 13634 self.exportChildren(outfile, level + 1, namespace_, name_) 13635 showIndent(outfile, level) 13636 outfile.write('</%s%s>\n' % (namespace_, name_)) 13637 else: 13638 outfile.write('/>\n')
13639 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='StringsType'):
13640 pass
13641 - def exportChildren(self, outfile, level, namespace_='maec:', name_='StringsType', fromsubclass_=False):
13642 for String_ in self.String: 13643 String_.export(outfile, level, namespace_, name_='String')
13644 - def hasContent_(self):
13645 if ( 13646 self.String 13647 ): 13648 return True 13649 else: 13650 return False
13651 - def exportLiteral(self, outfile, level, name_='StringsType'):
13652 level += 1 13653 self.exportLiteralAttributes(outfile, level, [], name_) 13654 if self.hasContent_(): 13655 self.exportLiteralChildren(outfile, level, name_)
13656 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
13657 pass
13658 - def exportLiteralChildren(self, outfile, level, name_):
13659 showIndent(outfile, level) 13660 outfile.write('String=[\n') 13661 level += 1 13662 for String_ in self.String: 13663 showIndent(outfile, level) 13664 outfile.write('model_.PEStringType(\n') 13665 String_.exportLiteral(outfile, level, name_='PEStringType') 13666 showIndent(outfile, level) 13667 outfile.write('),\n') 13668 level -= 1 13669 showIndent(outfile, level) 13670 outfile.write('],\n')
13671 - def build(self, node):
13672 self.buildAttributes(node, node.attrib, []) 13673 for child in node: 13674 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13675 self.buildChildren(child, node, nodeName_)
13676 - def buildAttributes(self, node, attrs, already_processed):
13677 pass
13678 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13679 if nodeName_ == 'String': 13680 obj_ = PEStringType.factory() 13681 obj_.build(child_) 13682 self.String.append(obj_)
13683 # end class StringsType 13684 13685
13686 -class ImportsType(GeneratedsSuper):
13687 subclass = None 13688 superclass = None
13689 - def __init__(self, Import=None):
13690 if Import is None: 13691 self.Import = [] 13692 else: 13693 self.Import = Import
13694 - def factory(*args_, **kwargs_):
13695 if ImportsType.subclass: 13696 return ImportsType.subclass(*args_, **kwargs_) 13697 else: 13698 return ImportsType(*args_, **kwargs_)
13699 factory = staticmethod(factory)
13700 - def get_Import(self): return self.Import
13701 - def set_Import(self, Import): self.Import = Import
13702 - def add_Import(self, value): self.Import.append(value)
13703 - def insert_Import(self, index, value): self.Import[index] = value
13704 - def export(self, outfile, level, namespace_='maec:', name_='ImportsType', namespacedef_=''):
13705 showIndent(outfile, level) 13706 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 13707 already_processed = [] 13708 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImportsType') 13709 if self.hasContent_(): 13710 outfile.write('>\n') 13711 self.exportChildren(outfile, level + 1, namespace_, name_) 13712 showIndent(outfile, level) 13713 outfile.write('</%s%s>\n' % (namespace_, name_)) 13714 else: 13715 outfile.write('/>\n')
13716 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImportsType'):
13717 pass
13718 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImportsType', fromsubclass_=False):
13719 for Import_ in self.Import: 13720 Import_.export(outfile, level, namespace_, name_='Import')
13721 - def hasContent_(self):
13722 if ( 13723 self.Import 13724 ): 13725 return True 13726 else: 13727 return False
13728 - def exportLiteral(self, outfile, level, name_='ImportsType'):
13729 level += 1 13730 self.exportLiteralAttributes(outfile, level, [], name_) 13731 if self.hasContent_(): 13732 self.exportLiteralChildren(outfile, level, name_)
13733 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
13734 pass
13735 - def exportLiteralChildren(self, outfile, level, name_):
13736 showIndent(outfile, level) 13737 outfile.write('Import=[\n') 13738 level += 1 13739 for Import_ in self.Import: 13740 showIndent(outfile, level) 13741 outfile.write('model_.PEImportType(\n') 13742 Import_.exportLiteral(outfile, level, name_='PEImportType') 13743 showIndent(outfile, level) 13744 outfile.write('),\n') 13745 level -= 1 13746 showIndent(outfile, level) 13747 outfile.write('],\n')
13748 - def build(self, node):
13749 self.buildAttributes(node, node.attrib, []) 13750 for child in node: 13751 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13752 self.buildChildren(child, node, nodeName_)
13753 - def buildAttributes(self, node, attrs, already_processed):
13754 pass
13755 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13756 if nodeName_ == 'Import': 13757 obj_ = PEImportType.factory() 13758 obj_.build(child_) 13759 self.Import.append(obj_)
13760 # end class ImportsType 13761 13762
13763 -class ExportsType(GeneratedsSuper):
13764 subclass = None 13765 superclass = None
13766 - def __init__(self, Export=None):
13767 if Export is None: 13768 self.Export = [] 13769 else: 13770 self.Export = Export
13771 - def factory(*args_, **kwargs_):
13772 if ExportsType.subclass: 13773 return ExportsType.subclass(*args_, **kwargs_) 13774 else: 13775 return ExportsType(*args_, **kwargs_)
13776 factory = staticmethod(factory)
13777 - def get_Export(self): return self.Export
13778 - def set_Export(self, Export): self.Export = Export
13779 - def add_Export(self, value): self.Export.append(value)
13780 - def insert_Export(self, index, value): self.Export[index] = value
13781 - def export(self, outfile, level, namespace_='maec:', name_='ExportsType', namespacedef_=''):
13782 showIndent(outfile, level) 13783 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 13784 already_processed = [] 13785 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExportsType') 13786 if self.hasContent_(): 13787 outfile.write('>\n') 13788 self.exportChildren(outfile, level + 1, namespace_, name_) 13789 showIndent(outfile, level) 13790 outfile.write('</%s%s>\n' % (namespace_, name_)) 13791 else: 13792 outfile.write('/>\n')
13793 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ExportsType'):
13794 pass
13795 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ExportsType', fromsubclass_=False):
13796 for Export_ in self.Export: 13797 Export_.export(outfile, level, namespace_, name_='Export')
13798 - def hasContent_(self):
13799 if ( 13800 self.Export 13801 ): 13802 return True 13803 else: 13804 return False
13805 - def exportLiteral(self, outfile, level, name_='ExportsType'):
13806 level += 1 13807 self.exportLiteralAttributes(outfile, level, [], name_) 13808 if self.hasContent_(): 13809 self.exportLiteralChildren(outfile, level, name_)
13810 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
13811 pass
13812 - def exportLiteralChildren(self, outfile, level, name_):
13813 showIndent(outfile, level) 13814 outfile.write('Export=[\n') 13815 level += 1 13816 for Export_ in self.Export: 13817 showIndent(outfile, level) 13818 outfile.write('model_.PEExportType(\n') 13819 Export_.exportLiteral(outfile, level, name_='PEExportType') 13820 showIndent(outfile, level) 13821 outfile.write('),\n') 13822 level -= 1 13823 showIndent(outfile, level) 13824 outfile.write('],\n')
13825 - def build(self, node):
13826 self.buildAttributes(node, node.attrib, []) 13827 for child in node: 13828 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13829 self.buildChildren(child, node, nodeName_)
13830 - def buildAttributes(self, node, attrs, already_processed):
13831 pass
13832 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13833 if nodeName_ == 'Export': 13834 obj_ = PEExportType.factory() 13835 obj_.build(child_) 13836 self.Export.append(obj_)
13837 # end class ExportsType 13838 13839
13840 -class ResourcesType(GeneratedsSuper):
13841 subclass = None 13842 superclass = None
13843 - def __init__(self, Resource=None):
13844 if Resource is None: 13845 self.Resource = [] 13846 else: 13847 self.Resource = Resource
13848 - def factory(*args_, **kwargs_):
13849 if ResourcesType.subclass: 13850 return ResourcesType.subclass(*args_, **kwargs_) 13851 else: 13852 return ResourcesType(*args_, **kwargs_)
13853 factory = staticmethod(factory)
13854 - def get_Resource(self): return self.Resource
13855 - def set_Resource(self, Resource): self.Resource = Resource
13856 - def add_Resource(self, value): self.Resource.append(value)
13857 - def insert_Resource(self, index, value): self.Resource[index] = value
13858 - def export(self, outfile, level, namespace_='maec:', name_='ResourcesType', namespacedef_=''):
13859 showIndent(outfile, level) 13860 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 13861 already_processed = [] 13862 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ResourcesType') 13863 if self.hasContent_(): 13864 outfile.write('>\n') 13865 self.exportChildren(outfile, level + 1, namespace_, name_) 13866 showIndent(outfile, level) 13867 outfile.write('</%s%s>\n' % (namespace_, name_)) 13868 else: 13869 outfile.write('/>\n')
13870 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ResourcesType'):
13871 pass
13872 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ResourcesType', fromsubclass_=False):
13873 for Resource_ in self.Resource: 13874 Resource_.export(outfile, level, namespace_, name_='Resource')
13875 - def hasContent_(self):
13876 if ( 13877 self.Resource 13878 ): 13879 return True 13880 else: 13881 return False
13882 - def exportLiteral(self, outfile, level, name_='ResourcesType'):
13883 level += 1 13884 self.exportLiteralAttributes(outfile, level, [], name_) 13885 if self.hasContent_(): 13886 self.exportLiteralChildren(outfile, level, name_)
13887 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
13888 pass
13889 - def exportLiteralChildren(self, outfile, level, name_):
13890 showIndent(outfile, level) 13891 outfile.write('Resource=[\n') 13892 level += 1 13893 for Resource_ in self.Resource: 13894 showIndent(outfile, level) 13895 outfile.write('model_.PEResourceType(\n') 13896 Resource_.exportLiteral(outfile, level, name_='PEResourceType') 13897 showIndent(outfile, level) 13898 outfile.write('),\n') 13899 level -= 1 13900 showIndent(outfile, level) 13901 outfile.write('],\n')
13902 - def build(self, node):
13903 self.buildAttributes(node, node.attrib, []) 13904 for child in node: 13905 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13906 self.buildChildren(child, node, nodeName_)
13907 - def buildAttributes(self, node, attrs, already_processed):
13908 pass
13909 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13910 if nodeName_ == 'Resource': 13911 obj_ = PEResourceType.factory() 13912 obj_.build(child_) 13913 self.Resource.append(obj_)
13914 # end class ResourcesType 13915 13916
13917 -class SectionsType(GeneratedsSuper):
13918 subclass = None 13919 superclass = None
13920 - def __init__(self, Section=None):
13921 if Section is None: 13922 self.Section = [] 13923 else: 13924 self.Section = Section
13925 - def factory(*args_, **kwargs_):
13926 if SectionsType.subclass: 13927 return SectionsType.subclass(*args_, **kwargs_) 13928 else: 13929 return SectionsType(*args_, **kwargs_)
13930 factory = staticmethod(factory)
13931 - def get_Section(self): return self.Section
13932 - def set_Section(self, Section): self.Section = Section
13933 - def add_Section(self, value): self.Section.append(value)
13934 - def insert_Section(self, index, value): self.Section[index] = value
13935 - def export(self, outfile, level, namespace_='maec:', name_='SectionsType', namespacedef_=''):
13936 showIndent(outfile, level) 13937 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 13938 already_processed = [] 13939 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SectionsType') 13940 if self.hasContent_(): 13941 outfile.write('>\n') 13942 self.exportChildren(outfile, level + 1, namespace_, name_) 13943 showIndent(outfile, level) 13944 outfile.write('</%s%s>\n' % (namespace_, name_)) 13945 else: 13946 outfile.write('/>\n')
13947 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='SectionsType'):
13948 pass
13949 - def exportChildren(self, outfile, level, namespace_='maec:', name_='SectionsType', fromsubclass_=False):
13950 for Section_ in self.Section: 13951 Section_.export(outfile, level, namespace_, name_='Section')
13952 - def hasContent_(self):
13953 if ( 13954 self.Section 13955 ): 13956 return True 13957 else: 13958 return False
13959 - def exportLiteral(self, outfile, level, name_='SectionsType'):
13960 level += 1 13961 self.exportLiteralAttributes(outfile, level, [], name_) 13962 if self.hasContent_(): 13963 self.exportLiteralChildren(outfile, level, name_)
13964 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
13965 pass
13966 - def exportLiteralChildren(self, outfile, level, name_):
13967 showIndent(outfile, level) 13968 outfile.write('Section=[\n') 13969 level += 1 13970 for Section_ in self.Section: 13971 showIndent(outfile, level) 13972 outfile.write('model_.PESectionType(\n') 13973 Section_.exportLiteral(outfile, level, name_='PESectionType') 13974 showIndent(outfile, level) 13975 outfile.write('),\n') 13976 level -= 1 13977 showIndent(outfile, level) 13978 outfile.write('],\n')
13979 - def build(self, node):
13980 self.buildAttributes(node, node.attrib, []) 13981 for child in node: 13982 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 13983 self.buildChildren(child, node, nodeName_)
13984 - def buildAttributes(self, node, attrs, already_processed):
13985 pass
13986 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13987 if nodeName_ == 'Section': 13988 obj_ = PESectionType.factory() 13989 obj_.build(child_) 13990 self.Section.append(obj_)
13991 # end class SectionsType 13992 13993
13994 -class Digital_CertificatesType(GeneratedsSuper):
13995 subclass = None 13996 superclass = None
13997 - def __init__(self, Certificate=None):
13998 if Certificate is None: 13999 self.Certificate = [] 14000 else: 14001 self.Certificate = Certificate
14002 - def factory(*args_, **kwargs_):
14003 if Digital_CertificatesType.subclass: 14004 return Digital_CertificatesType.subclass(*args_, **kwargs_) 14005 else: 14006 return Digital_CertificatesType(*args_, **kwargs_)
14007 factory = staticmethod(factory)
14008 - def get_Certificate(self): return self.Certificate
14009 - def set_Certificate(self, Certificate): self.Certificate = Certificate
14010 - def add_Certificate(self, value): self.Certificate.append(value)
14011 - def insert_Certificate(self, index, value): self.Certificate[index] = value
14012 - def export(self, outfile, level, namespace_='maec:', name_='Digital_CertificatesType', namespacedef_=''):
14013 showIndent(outfile, level) 14014 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14015 already_processed = [] 14016 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Digital_CertificatesType') 14017 if self.hasContent_(): 14018 outfile.write('>\n') 14019 self.exportChildren(outfile, level + 1, namespace_, name_) 14020 showIndent(outfile, level) 14021 outfile.write('</%s%s>\n' % (namespace_, name_)) 14022 else: 14023 outfile.write('/>\n')
14024 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Digital_CertificatesType'):
14025 pass
14026 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Digital_CertificatesType', fromsubclass_=False):
14027 for Certificate_ in self.Certificate: 14028 Certificate_.export(outfile, level, namespace_, name_='Certificate')
14029 - def hasContent_(self):
14030 if ( 14031 self.Certificate 14032 ): 14033 return True 14034 else: 14035 return False
14036 - def exportLiteral(self, outfile, level, name_='Digital_CertificatesType'):
14037 level += 1 14038 self.exportLiteralAttributes(outfile, level, [], name_) 14039 if self.hasContent_(): 14040 self.exportLiteralChildren(outfile, level, name_)
14041 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14042 pass
14043 - def exportLiteralChildren(self, outfile, level, name_):
14044 showIndent(outfile, level) 14045 outfile.write('Certificate=[\n') 14046 level += 1 14047 for Certificate_ in self.Certificate: 14048 showIndent(outfile, level) 14049 outfile.write('model_.CertificateType(\n') 14050 Certificate_.exportLiteral(outfile, level, name_='CertificateType') 14051 showIndent(outfile, level) 14052 outfile.write('),\n') 14053 level -= 1 14054 showIndent(outfile, level) 14055 outfile.write('],\n')
14056 - def build(self, node):
14057 self.buildAttributes(node, node.attrib, []) 14058 for child in node: 14059 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14060 self.buildChildren(child, node, nodeName_)
14061 - def buildAttributes(self, node, attrs, already_processed):
14062 pass
14063 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14064 if nodeName_ == 'Certificate': 14065 obj_ = CertificateType.factory() 14066 obj_.build(child_) 14067 self.Certificate.append(obj_)
14068 # end class Digital_CertificatesType 14069 14070
14071 -class CertificateType(GeneratedsSuper):
14072 """This boolean attribute represents whether the digital certificate is 14073 valid or not.""" 14074 subclass = None 14075 superclass = None
14076 - def __init__(self, validity=None, Issuer=None):
14077 self.validity = _cast(bool, validity) 14078 self.Issuer = Issuer
14079 - def factory(*args_, **kwargs_):
14080 if CertificateType.subclass: 14081 return CertificateType.subclass(*args_, **kwargs_) 14082 else: 14083 return CertificateType(*args_, **kwargs_)
14084 factory = staticmethod(factory)
14085 - def get_Issuer(self): return self.Issuer
14086 - def set_Issuer(self, Issuer): self.Issuer = Issuer
14087 - def get_validity(self): return self.validity
14088 - def set_validity(self, validity): self.validity = validity
14089 - def export(self, outfile, level, namespace_='maec:', name_='CertificateType', namespacedef_=''):
14090 showIndent(outfile, level) 14091 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14092 already_processed = [] 14093 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CertificateType') 14094 if self.hasContent_(): 14095 outfile.write('>\n') 14096 self.exportChildren(outfile, level + 1, namespace_, name_) 14097 showIndent(outfile, level) 14098 outfile.write('</%s%s>\n' % (namespace_, name_)) 14099 else: 14100 outfile.write('/>\n')
14101 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='CertificateType'):
14102 if self.validity is not None and 'validity' not in already_processed: 14103 already_processed.append('validity') 14104 outfile.write(' validity="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.validity)), input_name='validity'))
14105 - def exportChildren(self, outfile, level, namespace_='maec:', name_='CertificateType', fromsubclass_=False):
14106 if self.Issuer is not None: 14107 showIndent(outfile, level) 14108 outfile.write('<%sIssuer>%s</%sIssuer>\n' % (namespace_, self.gds_format_string(quote_xml(self.Issuer).encode(ExternalEncoding), input_name='Issuer'), namespace_))
14109 - def hasContent_(self):
14110 if ( 14111 self.Issuer is not None 14112 ): 14113 return True 14114 else: 14115 return False
14116 - def exportLiteral(self, outfile, level, name_='CertificateType'):
14117 level += 1 14118 self.exportLiteralAttributes(outfile, level, [], name_) 14119 if self.hasContent_(): 14120 self.exportLiteralChildren(outfile, level, name_)
14121 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14122 if self.validity is not None and 'validity' not in already_processed: 14123 already_processed.append('validity') 14124 showIndent(outfile, level) 14125 outfile.write('validity = %s,\n' % (self.validity,))
14126 - def exportLiteralChildren(self, outfile, level, name_):
14127 if self.Issuer is not None: 14128 showIndent(outfile, level) 14129 outfile.write('Issuer=%s,\n' % quote_python(self.Issuer).encode(ExternalEncoding))
14130 - def build(self, node):
14131 self.buildAttributes(node, node.attrib, []) 14132 for child in node: 14133 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14134 self.buildChildren(child, node, nodeName_)
14135 - def buildAttributes(self, node, attrs, already_processed):
14136 value = find_attr_value_('validity', node) 14137 if value is not None and 'validity' not in already_processed: 14138 already_processed.append('validity') 14139 if value in ('true', '1'): 14140 self.validity = True 14141 elif value in ('false', '0'): 14142 self.validity = False 14143 else: 14144 raise_parse_error(node, 'Bad boolean attribute')
14145 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14146 if nodeName_ == 'Issuer': 14147 Issuer_ = child_.text 14148 Issuer_ = self.gds_validate_string(Issuer_, node, 'Issuer') 14149 self.Issuer = Issuer_
14150 # end class CertificateType 14151 14152
14153 -class GUI_Object_AttributesType(GeneratedsSuper):
14154 subclass = None 14155 superclass = None
14156 - def __init__(self, Width=None, Height=None, Window_Display_Name=None, Parent_Window=None, Owner_Window=None, Box_Text=None, Box_Caption=None):
14157 self.Width = Width 14158 self.Height = Height 14159 self.Window_Display_Name = Window_Display_Name 14160 self.Parent_Window = Parent_Window 14161 self.Owner_Window = Owner_Window 14162 self.Box_Text = Box_Text 14163 self.Box_Caption = Box_Caption
14164 - def factory(*args_, **kwargs_):
14165 if GUI_Object_AttributesType.subclass: 14166 return GUI_Object_AttributesType.subclass(*args_, **kwargs_) 14167 else: 14168 return GUI_Object_AttributesType(*args_, **kwargs_)
14169 factory = staticmethod(factory)
14170 - def get_Width(self): return self.Width
14171 - def set_Width(self, Width): self.Width = Width
14172 - def get_Height(self): return self.Height
14173 - def set_Height(self, Height): self.Height = Height
14174 - def get_Window_Display_Name(self): return self.Window_Display_Name
14175 - def set_Window_Display_Name(self, Window_Display_Name): self.Window_Display_Name = Window_Display_Name
14176 - def get_Parent_Window(self): return self.Parent_Window
14177 - def set_Parent_Window(self, Parent_Window): self.Parent_Window = Parent_Window
14178 - def get_Owner_Window(self): return self.Owner_Window
14179 - def set_Owner_Window(self, Owner_Window): self.Owner_Window = Owner_Window
14180 - def get_Box_Text(self): return self.Box_Text
14181 - def set_Box_Text(self, Box_Text): self.Box_Text = Box_Text
14182 - def get_Box_Caption(self): return self.Box_Caption
14183 - def set_Box_Caption(self, Box_Caption): self.Box_Caption = Box_Caption
14184 - def export(self, outfile, level, namespace_='maec:', name_='GUI_Object_AttributesType', namespacedef_=''):
14185 showIndent(outfile, level) 14186 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14187 already_processed = [] 14188 self.exportAttributes(outfile, level, already_processed, namespace_, name_='GUI_Object_AttributesType') 14189 if self.hasContent_(): 14190 outfile.write('>\n') 14191 self.exportChildren(outfile, level + 1, namespace_, name_) 14192 showIndent(outfile, level) 14193 outfile.write('</%s%s>\n' % (namespace_, name_)) 14194 else: 14195 outfile.write('/>\n')
14196 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='GUI_Object_AttributesType'):
14197 pass
14198 - def exportChildren(self, outfile, level, namespace_='maec:', name_='GUI_Object_AttributesType', fromsubclass_=False):
14199 if self.Width is not None: 14200 showIndent(outfile, level) 14201 outfile.write('<%sWidth>%s</%sWidth>\n' % (namespace_, self.gds_format_integer(self.Width, input_name='Width'), namespace_)) 14202 if self.Height is not None: 14203 showIndent(outfile, level) 14204 outfile.write('<%sHeight>%s</%sHeight>\n' % (namespace_, self.gds_format_integer(self.Height, input_name='Height'), namespace_)) 14205 if self.Window_Display_Name is not None: 14206 showIndent(outfile, level) 14207 outfile.write('<%sWindow_Display_Name>%s</%sWindow_Display_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Window_Display_Name).encode(ExternalEncoding), input_name='Window_Display_Name'), namespace_)) 14208 if self.Parent_Window is not None: 14209 showIndent(outfile, level) 14210 outfile.write('<%sParent_Window>%s</%sParent_Window>\n' % (namespace_, self.gds_format_string(quote_xml(self.Parent_Window).encode(ExternalEncoding), input_name='Parent_Window'), namespace_)) 14211 if self.Owner_Window is not None: 14212 showIndent(outfile, level) 14213 outfile.write('<%sOwner_Window>%s</%sOwner_Window>\n' % (namespace_, self.gds_format_string(quote_xml(self.Owner_Window).encode(ExternalEncoding), input_name='Owner_Window'), namespace_)) 14214 if self.Box_Text is not None: 14215 showIndent(outfile, level) 14216 outfile.write('<%sBox_Text>%s</%sBox_Text>\n' % (namespace_, self.gds_format_string(quote_xml(self.Box_Text).encode(ExternalEncoding), input_name='Box_Text'), namespace_)) 14217 if self.Box_Caption is not None: 14218 showIndent(outfile, level) 14219 outfile.write('<%sBox_Caption>%s</%sBox_Caption>\n' % (namespace_, self.gds_format_string(quote_xml(self.Box_Caption).encode(ExternalEncoding), input_name='Box_Caption'), namespace_))
14220 - def hasContent_(self):
14221 if ( 14222 self.Width is not None or 14223 self.Height is not None or 14224 self.Window_Display_Name is not None or 14225 self.Parent_Window is not None or 14226 self.Owner_Window is not None or 14227 self.Box_Text is not None or 14228 self.Box_Caption is not None 14229 ): 14230 return True 14231 else: 14232 return False
14233 - def exportLiteral(self, outfile, level, name_='GUI_Object_AttributesType'):
14234 level += 1 14235 self.exportLiteralAttributes(outfile, level, [], name_) 14236 if self.hasContent_(): 14237 self.exportLiteralChildren(outfile, level, name_)
14238 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14239 pass
14240 - def exportLiteralChildren(self, outfile, level, name_):
14241 if self.Width is not None: 14242 showIndent(outfile, level) 14243 outfile.write('Width=%d,\n' % self.Width) 14244 if self.Height is not None: 14245 showIndent(outfile, level) 14246 outfile.write('Height=%d,\n' % self.Height) 14247 if self.Window_Display_Name is not None: 14248 showIndent(outfile, level) 14249 outfile.write('Window_Display_Name=%s,\n' % quote_python(self.Window_Display_Name).encode(ExternalEncoding)) 14250 if self.Parent_Window is not None: 14251 showIndent(outfile, level) 14252 outfile.write('Parent_Window=%s,\n' % quote_python(self.Parent_Window).encode(ExternalEncoding)) 14253 if self.Owner_Window is not None: 14254 showIndent(outfile, level) 14255 outfile.write('Owner_Window=%s,\n' % quote_python(self.Owner_Window).encode(ExternalEncoding)) 14256 if self.Box_Text is not None: 14257 showIndent(outfile, level) 14258 outfile.write('Box_Text=%s,\n' % quote_python(self.Box_Text).encode(ExternalEncoding)) 14259 if self.Box_Caption is not None: 14260 showIndent(outfile, level) 14261 outfile.write('Box_Caption=%s,\n' % quote_python(self.Box_Caption).encode(ExternalEncoding))
14262 - def build(self, node):
14263 self.buildAttributes(node, node.attrib, []) 14264 for child in node: 14265 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14266 self.buildChildren(child, node, nodeName_)
14267 - def buildAttributes(self, node, attrs, already_processed):
14268 pass
14269 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14270 if nodeName_ == 'Width': 14271 sval_ = child_.text 14272 try: 14273 ival_ = int(sval_) 14274 except (TypeError, ValueError) as e: 14275 raise_parse_error(child_, 'requires integer: %s' % e) 14276 ival_ = self.gds_validate_integer(ival_, node, 'Width') 14277 self.Width = ival_ 14278 elif nodeName_ == 'Height': 14279 sval_ = child_.text 14280 try: 14281 ival_ = int(sval_) 14282 except (TypeError, ValueError) as e: 14283 raise_parse_error(child_, 'requires integer: %s' % e) 14284 ival_ = self.gds_validate_integer(ival_, node, 'Height') 14285 self.Height = ival_ 14286 elif nodeName_ == 'Window_Display_Name': 14287 Window_Display_Name_ = child_.text 14288 Window_Display_Name_ = self.gds_validate_string(Window_Display_Name_, node, 'Window_Display_Name') 14289 self.Window_Display_Name = Window_Display_Name_ 14290 elif nodeName_ == 'Parent_Window': 14291 Parent_Window_ = child_.text 14292 Parent_Window_ = self.gds_validate_string(Parent_Window_, node, 'Parent_Window') 14293 self.Parent_Window = Parent_Window_ 14294 elif nodeName_ == 'Owner_Window': 14295 Owner_Window_ = child_.text 14296 Owner_Window_ = self.gds_validate_string(Owner_Window_, node, 'Owner_Window') 14297 self.Owner_Window = Owner_Window_ 14298 elif nodeName_ == 'Box_Text': 14299 Box_Text_ = child_.text 14300 Box_Text_ = self.gds_validate_string(Box_Text_, node, 'Box_Text') 14301 self.Box_Text = Box_Text_ 14302 elif nodeName_ == 'Box_Caption': 14303 Box_Caption_ = child_.text 14304 Box_Caption_ = self.gds_validate_string(Box_Caption_, node, 'Box_Caption') 14305 self.Box_Caption = Box_Caption_
14306 # end class GUI_Object_AttributesType 14307 14308
14309 -class IPC_Object_AttributesType(GeneratedsSuper):
14310 subclass = None 14311 superclass = None
14312 - def __init__(self, Security_Attributes=None, Event_Type=None, Thread_ID=None, Start_Address=None):
14313 self.Security_Attributes = Security_Attributes 14314 self.Event_Type = Event_Type 14315 self.Thread_ID = Thread_ID 14316 self.Start_Address = Start_Address
14317 - def factory(*args_, **kwargs_):
14318 if IPC_Object_AttributesType.subclass: 14319 return IPC_Object_AttributesType.subclass(*args_, **kwargs_) 14320 else: 14321 return IPC_Object_AttributesType(*args_, **kwargs_)
14322 factory = staticmethod(factory)
14323 - def get_Security_Attributes(self): return self.Security_Attributes
14324 - def set_Security_Attributes(self, Security_Attributes): self.Security_Attributes = Security_Attributes
14325 - def get_Event_Type(self): return self.Event_Type
14326 - def set_Event_Type(self, Event_Type): self.Event_Type = Event_Type
14327 - def get_Thread_ID(self): return self.Thread_ID
14328 - def set_Thread_ID(self, Thread_ID): self.Thread_ID = Thread_ID
14329 - def get_Start_Address(self): return self.Start_Address
14330 - def set_Start_Address(self, Start_Address): self.Start_Address = Start_Address
14331 - def export(self, outfile, level, namespace_='maec:', name_='IPC_Object_AttributesType', namespacedef_=''):
14332 showIndent(outfile, level) 14333 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14334 already_processed = [] 14335 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IPC_Object_AttributesType') 14336 if self.hasContent_(): 14337 outfile.write('>\n') 14338 self.exportChildren(outfile, level + 1, namespace_, name_) 14339 showIndent(outfile, level) 14340 outfile.write('</%s%s>\n' % (namespace_, name_)) 14341 else: 14342 outfile.write('/>\n')
14343 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='IPC_Object_AttributesType'):
14344 pass
14345 - def exportChildren(self, outfile, level, namespace_='maec:', name_='IPC_Object_AttributesType', fromsubclass_=False):
14346 if self.Security_Attributes is not None: 14347 showIndent(outfile, level) 14348 outfile.write('<%sSecurity_Attributes>%s</%sSecurity_Attributes>\n' % (namespace_, self.gds_format_string(quote_xml(self.Security_Attributes).encode(ExternalEncoding), input_name='Security_Attributes'), namespace_)) 14349 if self.Event_Type is not None: 14350 showIndent(outfile, level) 14351 outfile.write('<%sEvent_Type>%s</%sEvent_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Event_Type).encode(ExternalEncoding), input_name='Event_Type'), namespace_)) 14352 if self.Thread_ID is not None: 14353 showIndent(outfile, level) 14354 outfile.write('<%sThread_ID>%s</%sThread_ID>\n' % (namespace_, self.gds_format_integer(self.Thread_ID, input_name='Thread_ID'), namespace_)) 14355 if self.Start_Address is not None: 14356 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
14357 - def hasContent_(self):
14358 if ( 14359 self.Security_Attributes is not None or 14360 self.Event_Type is not None or 14361 self.Thread_ID is not None or 14362 self.Start_Address is not None 14363 ): 14364 return True 14365 else: 14366 return False
14367 - def exportLiteral(self, outfile, level, name_='IPC_Object_AttributesType'):
14368 level += 1 14369 self.exportLiteralAttributes(outfile, level, [], name_) 14370 if self.hasContent_(): 14371 self.exportLiteralChildren(outfile, level, name_)
14372 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14373 pass
14374 - def exportLiteralChildren(self, outfile, level, name_):
14375 if self.Security_Attributes is not None: 14376 showIndent(outfile, level) 14377 outfile.write('Security_Attributes=%s,\n' % quote_python(self.Security_Attributes).encode(ExternalEncoding)) 14378 if self.Event_Type is not None: 14379 showIndent(outfile, level) 14380 outfile.write('Event_Type=%s,\n' % quote_python(self.Event_Type).encode(ExternalEncoding)) 14381 if self.Thread_ID is not None: 14382 showIndent(outfile, level) 14383 outfile.write('Thread_ID=%d,\n' % self.Thread_ID) 14384 if self.Start_Address is not None: 14385 showIndent(outfile, level) 14386 outfile.write('Start_Address=model_.xs_hexBinary(\n') 14387 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address') 14388 showIndent(outfile, level) 14389 outfile.write('),\n')
14390 - def build(self, node):
14391 self.buildAttributes(node, node.attrib, []) 14392 for child in node: 14393 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14394 self.buildChildren(child, node, nodeName_)
14395 - def buildAttributes(self, node, attrs, already_processed):
14396 pass
14397 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14398 if nodeName_ == 'Security_Attributes': 14399 Security_Attributes_ = child_.text 14400 Security_Attributes_ = self.gds_validate_string(Security_Attributes_, node, 'Security_Attributes') 14401 self.Security_Attributes = Security_Attributes_ 14402 elif nodeName_ == 'Event_Type': 14403 Event_Type_ = child_.text 14404 Event_Type_ = self.gds_validate_string(Event_Type_, node, 'Event_Type') 14405 self.Event_Type = Event_Type_ 14406 elif nodeName_ == 'Thread_ID': 14407 sval_ = child_.text 14408 try: 14409 ival_ = int(sval_) 14410 except (TypeError, ValueError) as e: 14411 raise_parse_error(child_, 'requires integer: %s' % e) 14412 ival_ = self.gds_validate_integer(ival_, node, 'Thread_ID') 14413 self.Thread_ID = ival_ 14414 elif nodeName_ == 'Start_Address': 14415 obj_ = xs_hexBinary.factory() 14416 obj_.build(child_) 14417 self.set_Start_Address(obj_)
14418 # end class IPC_Object_AttributesType 14419 14420
14421 -class Event_Type(GeneratedsSuper):
14422 """The Event_Type field contains the event type of an IPC event object. 14423 Possible values: Manual_Reset, Auto_Reset.""" 14424 subclass = None 14425 superclass = None
14426 - def __init__(self):
14427 pass
14428 - def factory(*args_, **kwargs_):
14429 if Event_Type.subclass: 14430 return Event_Type.subclass(*args_, **kwargs_) 14431 else: 14432 return Event_Type(*args_, **kwargs_)
14433 factory = staticmethod(factory)
14434 - def export(self, outfile, level, namespace_='maec:', name_='Event_Type', namespacedef_=''):
14435 showIndent(outfile, level) 14436 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14437 already_processed = [] 14438 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Event_Type') 14439 if self.hasContent_(): 14440 outfile.write('>\n') 14441 self.exportChildren(outfile, level + 1, namespace_, name_) 14442 outfile.write('</%s%s>\n' % (namespace_, name_)) 14443 else: 14444 outfile.write('/>\n')
14445 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Event_Type'):
14446 pass
14447 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Event_Type', fromsubclass_=False):
14448 pass
14449 - def hasContent_(self):
14450 if ( 14451 14452 ): 14453 return True 14454 else: 14455 return False
14456 - def exportLiteral(self, outfile, level, name_='Event_Type'):
14457 level += 1 14458 self.exportLiteralAttributes(outfile, level, [], name_) 14459 if self.hasContent_(): 14460 self.exportLiteralChildren(outfile, level, name_)
14461 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14462 pass
14463 - def exportLiteralChildren(self, outfile, level, name_):
14464 pass
14465 - def build(self, node):
14466 self.buildAttributes(node, node.attrib, []) 14467 for child in node: 14468 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14469 self.buildChildren(child, node, nodeName_)
14470 - def buildAttributes(self, node, attrs, already_processed):
14471 pass
14472 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14473 pass
14474 # end class Event_Type 14475 14476
14477 -class Internet_Object_AttributesType(GeneratedsSuper):
14478 subclass = None 14479 superclass = None
14480 - def __init__(self, URI=None, AS_Number=None):
14481 self.URI = URI 14482 self.AS_Number = AS_Number
14483 - def factory(*args_, **kwargs_):
14484 if Internet_Object_AttributesType.subclass: 14485 return Internet_Object_AttributesType.subclass(*args_, **kwargs_) 14486 else: 14487 return Internet_Object_AttributesType(*args_, **kwargs_)
14488 factory = staticmethod(factory)
14489 - def get_URI(self): return self.URI
14490 - def set_URI(self, URI): self.URI = URI
14491 - def get_AS_Number(self): return self.AS_Number
14492 - def set_AS_Number(self, AS_Number): self.AS_Number = AS_Number
14493 - def export(self, outfile, level, namespace_='maec:', name_='Internet_Object_AttributesType', namespacedef_=''):
14494 showIndent(outfile, level) 14495 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14496 already_processed = [] 14497 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Internet_Object_AttributesType') 14498 if self.hasContent_(): 14499 outfile.write('>\n') 14500 self.exportChildren(outfile, level + 1, namespace_, name_) 14501 showIndent(outfile, level) 14502 outfile.write('</%s%s>\n' % (namespace_, name_)) 14503 else: 14504 outfile.write('/>\n')
14505 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Internet_Object_AttributesType'):
14506 pass
14507 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Internet_Object_AttributesType', fromsubclass_=False):
14508 if self.URI is not None: 14509 self.URI.export(outfile, level, namespace_, name_='URI') 14510 if self.AS_Number is not None: 14511 showIndent(outfile, level) 14512 outfile.write('<%sAS_Number>%s</%sAS_Number>\n' % (namespace_, self.gds_format_integer(self.AS_Number, input_name='AS_Number'), namespace_))
14513 - def hasContent_(self):
14514 if ( 14515 self.URI is not None or 14516 self.AS_Number is not None 14517 ): 14518 return True 14519 else: 14520 return False
14521 - def exportLiteral(self, outfile, level, name_='Internet_Object_AttributesType'):
14522 level += 1 14523 self.exportLiteralAttributes(outfile, level, [], name_) 14524 if self.hasContent_(): 14525 self.exportLiteralChildren(outfile, level, name_)
14526 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14527 pass
14528 - def exportLiteralChildren(self, outfile, level, name_):
14529 if self.URI is not None: 14530 showIndent(outfile, level) 14531 outfile.write('URI=model_.uriObject(\n') 14532 self.URI.exportLiteral(outfile, level, name_='URI') 14533 showIndent(outfile, level) 14534 outfile.write('),\n') 14535 if self.AS_Number is not None: 14536 showIndent(outfile, level) 14537 outfile.write('AS_Number=%d,\n' % self.AS_Number)
14538 - def build(self, node):
14539 self.buildAttributes(node, node.attrib, []) 14540 for child in node: 14541 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14542 self.buildChildren(child, node, nodeName_)
14543 - def buildAttributes(self, node, attrs, already_processed):
14544 pass
14545 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14546 if nodeName_ == 'URI': 14547 obj_ = uriObject.factory() 14548 obj_.build(child_) 14549 self.set_URI(obj_) 14550 elif nodeName_ == 'AS_Number': 14551 sval_ = child_.text 14552 try: 14553 ival_ = int(sval_) 14554 except (TypeError, ValueError) as e: 14555 raise_parse_error(child_, 'requires integer: %s' % e) 14556 ival_ = self.gds_validate_integer(ival_, node, 'AS_Number') 14557 self.AS_Number = ival_
14558 # end class Internet_Object_AttributesType 14559 14560
14561 -class Module_Object_AttributesType(GeneratedsSuper):
14562 subclass = None 14563 superclass = None
14564 - def __init__(self, Library_Type=None, Library_File_Name=None, Version=None):
14565 self.Library_Type = Library_Type 14566 self.Library_File_Name = Library_File_Name 14567 self.Version = Version
14568 - def factory(*args_, **kwargs_):
14569 if Module_Object_AttributesType.subclass: 14570 return Module_Object_AttributesType.subclass(*args_, **kwargs_) 14571 else: 14572 return Module_Object_AttributesType(*args_, **kwargs_)
14573 factory = staticmethod(factory)
14574 - def get_Library_Type(self): return self.Library_Type
14575 - def set_Library_Type(self, Library_Type): self.Library_Type = Library_Type
14576 - def get_Library_File_Name(self): return self.Library_File_Name
14577 - def set_Library_File_Name(self, Library_File_Name): self.Library_File_Name = Library_File_Name
14578 - def get_Version(self): return self.Version
14579 - def set_Version(self, Version): self.Version = Version
14580 - def export(self, outfile, level, namespace_='maec:', name_='Module_Object_AttributesType', namespacedef_=''):
14581 showIndent(outfile, level) 14582 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14583 already_processed = [] 14584 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Module_Object_AttributesType') 14585 if self.hasContent_(): 14586 outfile.write('>\n') 14587 self.exportChildren(outfile, level + 1, namespace_, name_) 14588 showIndent(outfile, level) 14589 outfile.write('</%s%s>\n' % (namespace_, name_)) 14590 else: 14591 outfile.write('/>\n')
14592 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Module_Object_AttributesType'):
14593 pass
14594 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Module_Object_AttributesType', fromsubclass_=False):
14595 if self.Library_Type is not None: 14596 showIndent(outfile, level) 14597 outfile.write('<%sLibrary_Type>%s</%sLibrary_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Library_Type).encode(ExternalEncoding), input_name='Library_Type'), namespace_)) 14598 if self.Library_File_Name is not None: 14599 showIndent(outfile, level) 14600 outfile.write('<%sLibrary_File_Name>%s</%sLibrary_File_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Library_File_Name).encode(ExternalEncoding), input_name='Library_File_Name'), namespace_)) 14601 if self.Version is not None: 14602 showIndent(outfile, level) 14603 outfile.write('<%sVersion>%s</%sVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.Version).encode(ExternalEncoding), input_name='Version'), namespace_))
14604 - def hasContent_(self):
14605 if ( 14606 self.Library_Type is not None or 14607 self.Library_File_Name is not None or 14608 self.Version is not None 14609 ): 14610 return True 14611 else: 14612 return False
14613 - def exportLiteral(self, outfile, level, name_='Module_Object_AttributesType'):
14614 level += 1 14615 self.exportLiteralAttributes(outfile, level, [], name_) 14616 if self.hasContent_(): 14617 self.exportLiteralChildren(outfile, level, name_)
14618 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14619 pass
14620 - def exportLiteralChildren(self, outfile, level, name_):
14621 if self.Library_Type is not None: 14622 showIndent(outfile, level) 14623 outfile.write('Library_Type=%s,\n' % quote_python(self.Library_Type).encode(ExternalEncoding)) 14624 if self.Library_File_Name is not None: 14625 showIndent(outfile, level) 14626 outfile.write('Library_File_Name=%s,\n' % quote_python(self.Library_File_Name).encode(ExternalEncoding)) 14627 if self.Version is not None: 14628 showIndent(outfile, level) 14629 outfile.write('Version=%s,\n' % quote_python(self.Version).encode(ExternalEncoding))
14630 - def build(self, node):
14631 self.buildAttributes(node, node.attrib, []) 14632 for child in node: 14633 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14634 self.buildChildren(child, node, nodeName_)
14635 - def buildAttributes(self, node, attrs, already_processed):
14636 pass
14637 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14638 if nodeName_ == 'Library_Type': 14639 Library_Type_ = child_.text 14640 Library_Type_ = self.gds_validate_string(Library_Type_, node, 'Library_Type') 14641 self.Library_Type = Library_Type_ 14642 elif nodeName_ == 'Library_File_Name': 14643 Library_File_Name_ = child_.text 14644 Library_File_Name_ = self.gds_validate_string(Library_File_Name_, node, 'Library_File_Name') 14645 self.Library_File_Name = Library_File_Name_ 14646 elif nodeName_ == 'Version': 14647 Version_ = child_.text 14648 Version_ = self.gds_validate_string(Version_, node, 'Version') 14649 self.Version = Version_
14650 # end class Module_Object_AttributesType 14651 14652
14653 -class Library_Type(GeneratedsSuper):
14654 """The Library_Type field contains the type of library object that is 14655 being characterized. Possible values: Static, Dynamic, Shared, 14656 Remote, Other.""" 14657 subclass = None 14658 superclass = None
14659 - def __init__(self):
14660 pass
14661 - def factory(*args_, **kwargs_):
14662 if Library_Type.subclass: 14663 return Library_Type.subclass(*args_, **kwargs_) 14664 else: 14665 return Library_Type(*args_, **kwargs_)
14666 factory = staticmethod(factory)
14667 - def export(self, outfile, level, namespace_='maec:', name_='Library_Type', namespacedef_=''):
14668 showIndent(outfile, level) 14669 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14670 already_processed = [] 14671 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Library_Type') 14672 if self.hasContent_(): 14673 outfile.write('>\n') 14674 self.exportChildren(outfile, level + 1, namespace_, name_) 14675 outfile.write('</%s%s>\n' % (namespace_, name_)) 14676 else: 14677 outfile.write('/>\n')
14678 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Library_Type'):
14679 pass
14680 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Library_Type', fromsubclass_=False):
14681 pass
14682 - def hasContent_(self):
14683 if ( 14684 14685 ): 14686 return True 14687 else: 14688 return False
14689 - def exportLiteral(self, outfile, level, name_='Library_Type'):
14690 level += 1 14691 self.exportLiteralAttributes(outfile, level, [], name_) 14692 if self.hasContent_(): 14693 self.exportLiteralChildren(outfile, level, name_)
14694 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14695 pass
14696 - def exportLiteralChildren(self, outfile, level, name_):
14697 pass
14698 - def build(self, node):
14699 self.buildAttributes(node, node.attrib, []) 14700 for child in node: 14701 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14702 self.buildChildren(child, node, nodeName_)
14703 - def buildAttributes(self, node, attrs, already_processed):
14704 pass
14705 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14706 pass
14707 # end class Library_Type 14708 14709
14710 -class Registry_Object_AttributesType(GeneratedsSuper):
14711 subclass = None 14712 superclass = None
14713 - def __init__(self, Hive=None, Key=None, Value=None):
14714 self.Hive = Hive 14715 self.Key = Key 14716 self.Value = Value
14717 - def factory(*args_, **kwargs_):
14718 if Registry_Object_AttributesType.subclass: 14719 return Registry_Object_AttributesType.subclass(*args_, **kwargs_) 14720 else: 14721 return Registry_Object_AttributesType(*args_, **kwargs_)
14722 factory = staticmethod(factory)
14723 - def get_Hive(self): return self.Hive
14724 - def set_Hive(self, Hive): self.Hive = Hive
14725 - def get_Key(self): return self.Key
14726 - def set_Key(self, Key): self.Key = Key
14727 - def get_Value(self): return self.Value
14728 - def set_Value(self, Value): self.Value = Value
14729 - def export(self, outfile, level, namespace_='maec:', name_='Registry_Object_AttributesType', namespacedef_=''):
14730 showIndent(outfile, level) 14731 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14732 already_processed = [] 14733 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Registry_Object_AttributesType') 14734 if self.hasContent_(): 14735 outfile.write('>\n') 14736 self.exportChildren(outfile, level + 1, namespace_, name_) 14737 showIndent(outfile, level) 14738 outfile.write('</%s%s>\n' % (namespace_, name_)) 14739 else: 14740 outfile.write('/>\n')
14741 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Registry_Object_AttributesType'):
14742 pass
14743 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Registry_Object_AttributesType', fromsubclass_=False):
14744 if self.Hive is not None: 14745 showIndent(outfile, level) 14746 outfile.write('<%sHive>%s</%sHive>\n' % (namespace_, self.gds_format_string(quote_xml(self.Hive).encode(ExternalEncoding), input_name='Hive'), namespace_)) 14747 if self.Key is not None: 14748 showIndent(outfile, level) 14749 outfile.write('<%sKey>%s</%sKey>\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) 14750 if self.Value is not None: 14751 self.Value.export(outfile, level, namespace_, name_='Value')
14752 - def hasContent_(self):
14753 if ( 14754 self.Hive is not None or 14755 self.Key is not None or 14756 self.Value is not None 14757 ): 14758 return True 14759 else: 14760 return False
14761 - def exportLiteral(self, outfile, level, name_='Registry_Object_AttributesType'):
14762 level += 1 14763 self.exportLiteralAttributes(outfile, level, [], name_) 14764 if self.hasContent_(): 14765 self.exportLiteralChildren(outfile, level, name_)
14766 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14767 pass
14768 - def exportLiteralChildren(self, outfile, level, name_):
14769 if self.Hive is not None: 14770 showIndent(outfile, level) 14771 outfile.write('Hive=%s,\n' % quote_python(self.Hive).encode(ExternalEncoding)) 14772 if self.Key is not None: 14773 showIndent(outfile, level) 14774 outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) 14775 if self.Value is not None: 14776 showIndent(outfile, level) 14777 outfile.write('Value=model_.ValueType(\n') 14778 self.Value.exportLiteral(outfile, level, name_='Value') 14779 showIndent(outfile, level) 14780 outfile.write('),\n')
14781 - def build(self, node):
14782 self.buildAttributes(node, node.attrib, []) 14783 for child in node: 14784 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14785 self.buildChildren(child, node, nodeName_)
14786 - def buildAttributes(self, node, attrs, already_processed):
14787 pass
14788 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14789 if nodeName_ == 'Hive': 14790 Hive_ = child_.text 14791 Hive_ = self.gds_validate_string(Hive_, node, 'Hive') 14792 self.Hive = Hive_ 14793 elif nodeName_ == 'Key': 14794 Key_ = child_.text 14795 Key_ = self.gds_validate_string(Key_, node, 'Key') 14796 self.Key = Key_ 14797 elif nodeName_ == 'Value': 14798 obj_ = ValueType.factory() 14799 obj_.build(child_) 14800 self.set_Value(obj_)
14801 # end class Registry_Object_AttributesType 14802 14803
14804 -class ValueType(GeneratedsSuper):
14805 """This field refers to the data type of the registry value being 14806 characterized in this element. Possible values: REG_NONE, 14807 REG_SZ, REG_EXPAND, REG_BINARY, REG_DWORD, 14808 REG_DWORD_LITTLE_ENDIAN, REG_DWORD_BIG_ENDIAN, REG_LINK, 14809 REG_MULTI_SZ, REG_RESOURCE_LIST, REG_FULL_RESOURCE_DESCRIPTOR, 14810 REG_RESOURCE_REQUIREMENTS_LIST, REG_QWORD, 14811 REG_QWORD_LITTLE_ENDIAN.""" 14812 subclass = None 14813 superclass = None
14814 - def __init__(self, type_=None, Value_Name=None, Value_Data=None):
14815 self.type_ = _cast(None, type_) 14816 self.Value_Name = Value_Name 14817 self.Value_Data = Value_Data
14818 - def factory(*args_, **kwargs_):
14819 if ValueType.subclass: 14820 return ValueType.subclass(*args_, **kwargs_) 14821 else: 14822 return ValueType(*args_, **kwargs_)
14823 factory = staticmethod(factory)
14824 - def get_Value_Name(self): return self.Value_Name
14825 - def set_Value_Name(self, Value_Name): self.Value_Name = Value_Name
14826 - def get_Value_Data(self): return self.Value_Data
14827 - def set_Value_Data(self, Value_Data): self.Value_Data = Value_Data
14828 - def get_type(self): return self.type_
14829 - def set_type(self, type_): self.type_ = type_
14830 - def export(self, outfile, level, namespace_='maec:', name_='ValueType', namespacedef_=''):
14831 showIndent(outfile, level) 14832 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14833 already_processed = [] 14834 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ValueType') 14835 if self.hasContent_(): 14836 outfile.write('>\n') 14837 self.exportChildren(outfile, level + 1, namespace_, name_) 14838 showIndent(outfile, level) 14839 outfile.write('</%s%s>\n' % (namespace_, name_)) 14840 else: 14841 outfile.write('/>\n')
14842 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ValueType'):
14843 if self.type_ is not None and 'type_' not in already_processed: 14844 already_processed.append('type_') 14845 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
14846 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ValueType', fromsubclass_=False):
14847 if self.Value_Name is not None: 14848 showIndent(outfile, level) 14849 outfile.write('<%sValue_Name>%s</%sValue_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Value_Name).encode(ExternalEncoding), input_name='Value_Name'), namespace_)) 14850 if self.Value_Data is not None: 14851 showIndent(outfile, level) 14852 outfile.write('<%sValue_Data>%s</%sValue_Data>\n' % (namespace_, self.gds_format_string(quote_xml(self.Value_Data).encode(ExternalEncoding), input_name='Value_Data'), namespace_))
14853 - def hasContent_(self):
14854 if ( 14855 self.Value_Name is not None or 14856 self.Value_Data is not None 14857 ): 14858 return True 14859 else: 14860 return False
14861 - def exportLiteral(self, outfile, level, name_='ValueType'):
14862 level += 1 14863 self.exportLiteralAttributes(outfile, level, [], name_) 14864 if self.hasContent_(): 14865 self.exportLiteralChildren(outfile, level, name_)
14866 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
14867 if self.type_ is not None and 'type_' not in already_processed: 14868 already_processed.append('type_') 14869 showIndent(outfile, level) 14870 outfile.write('type_ = "%s",\n' % (self.type_,))
14871 - def exportLiteralChildren(self, outfile, level, name_):
14872 if self.Value_Name is not None: 14873 showIndent(outfile, level) 14874 outfile.write('Value_Name=%s,\n' % quote_python(self.Value_Name).encode(ExternalEncoding)) 14875 if self.Value_Data is not None: 14876 showIndent(outfile, level) 14877 outfile.write('Value_Data=%s,\n' % quote_python(self.Value_Data).encode(ExternalEncoding))
14878 - def build(self, node):
14879 self.buildAttributes(node, node.attrib, []) 14880 for child in node: 14881 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 14882 self.buildChildren(child, node, nodeName_)
14883 - def buildAttributes(self, node, attrs, already_processed):
14884 value = find_attr_value_('type', node) 14885 if value is not None and 'type' not in already_processed: 14886 already_processed.append('type') 14887 self.type_ = value
14888 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14889 if nodeName_ == 'Value_Name': 14890 Value_Name_ = child_.text 14891 Value_Name_ = self.gds_validate_string(Value_Name_, node, 'Value_Name') 14892 self.Value_Name = Value_Name_ 14893 elif nodeName_ == 'Value_Data': 14894 Value_Data_ = child_.text 14895 Value_Data_ = self.gds_validate_string(Value_Data_, node, 'Value_Data') 14896 self.Value_Data = Value_Data_
14897 # end class ValueType 14898 14899
14900 -class Process_Object_AttributesType(GeneratedsSuper):
14901 subclass = None 14902 superclass = None
14903 - def __init__(self, Image_Name=None, Start_Username=None, Current_Directory=None, Command_Line=None, Security_Attributes=None, Process_ID=None, Start_Address=None, Parent_Process=None, Start_DateTime=None, Child_Processes=None, Handles=None):
14904 self.Image_Name = Image_Name 14905 self.Start_Username = Start_Username 14906 self.Current_Directory = Current_Directory 14907 self.Command_Line = Command_Line 14908 self.Security_Attributes = Security_Attributes 14909 self.Process_ID = Process_ID 14910 self.Start_Address = Start_Address 14911 self.Parent_Process = Parent_Process 14912 self.Start_DateTime = Start_DateTime 14913 self.Child_Processes = Child_Processes 14914 self.Handles = Handles
14915 - def factory(*args_, **kwargs_):
14916 if Process_Object_AttributesType.subclass: 14917 return Process_Object_AttributesType.subclass(*args_, **kwargs_) 14918 else: 14919 return Process_Object_AttributesType(*args_, **kwargs_)
14920 factory = staticmethod(factory)
14921 - def get_Image_Name(self): return self.Image_Name
14922 - def set_Image_Name(self, Image_Name): self.Image_Name = Image_Name
14923 - def get_Start_Username(self): return self.Start_Username
14924 - def set_Start_Username(self, Start_Username): self.Start_Username = Start_Username
14925 - def get_Current_Directory(self): return self.Current_Directory
14926 - def set_Current_Directory(self, Current_Directory): self.Current_Directory = Current_Directory
14927 - def get_Command_Line(self): return self.Command_Line
14928 - def set_Command_Line(self, Command_Line): self.Command_Line = Command_Line
14929 - def get_Security_Attributes(self): return self.Security_Attributes
14930 - def set_Security_Attributes(self, Security_Attributes): self.Security_Attributes = Security_Attributes
14931 - def get_Process_ID(self): return self.Process_ID
14932 - def set_Process_ID(self, Process_ID): self.Process_ID = Process_ID
14933 - def get_Start_Address(self): return self.Start_Address
14934 - def set_Start_Address(self, Start_Address): self.Start_Address = Start_Address
14935 - def get_Parent_Process(self): return self.Parent_Process
14936 - def set_Parent_Process(self, Parent_Process): self.Parent_Process = Parent_Process
14937 - def get_Start_DateTime(self): return self.Start_DateTime
14938 - def set_Start_DateTime(self, Start_DateTime): self.Start_DateTime = Start_DateTime
14939 - def get_Child_Processes(self): return self.Child_Processes
14940 - def set_Child_Processes(self, Child_Processes): self.Child_Processes = Child_Processes
14941 - def get_Handles(self): return self.Handles
14942 - def set_Handles(self, Handles): self.Handles = Handles
14943 - def export(self, outfile, level, namespace_='maec:', name_='Process_Object_AttributesType', namespacedef_=''):
14944 showIndent(outfile, level) 14945 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 14946 already_processed = [] 14947 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Process_Object_AttributesType') 14948 if self.hasContent_(): 14949 outfile.write('>\n') 14950 self.exportChildren(outfile, level + 1, namespace_, name_) 14951 showIndent(outfile, level) 14952 outfile.write('</%s%s>\n' % (namespace_, name_)) 14953 else: 14954 outfile.write('/>\n')
14955 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Process_Object_AttributesType'):
14956 pass
14957 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Process_Object_AttributesType', fromsubclass_=False):
14958 if self.Image_Name is not None: 14959 showIndent(outfile, level) 14960 outfile.write('<%sImage_Name>%s</%sImage_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Name).encode(ExternalEncoding), input_name='Image_Name'), namespace_)) 14961 if self.Start_Username is not None: 14962 showIndent(outfile, level) 14963 outfile.write('<%sStart_Username>%s</%sStart_Username>\n' % (namespace_, self.gds_format_string(quote_xml(self.Start_Username).encode(ExternalEncoding), input_name='Start_Username'), namespace_)) 14964 if self.Current_Directory is not None: 14965 showIndent(outfile, level) 14966 outfile.write('<%sCurrent_Directory>%s</%sCurrent_Directory>\n' % (namespace_, self.gds_format_string(quote_xml(self.Current_Directory).encode(ExternalEncoding), input_name='Current_Directory'), namespace_)) 14967 if self.Command_Line is not None: 14968 showIndent(outfile, level) 14969 outfile.write('<%sCommand_Line>%s</%sCommand_Line>\n' % (namespace_, self.gds_format_string(quote_xml(self.Command_Line).encode(ExternalEncoding), input_name='Command_Line'), namespace_)) 14970 if self.Security_Attributes is not None: 14971 showIndent(outfile, level) 14972 outfile.write('<%sSecurity_Attributes>%s</%sSecurity_Attributes>\n' % (namespace_, self.gds_format_string(quote_xml(self.Security_Attributes).encode(ExternalEncoding), input_name='Security_Attributes'), namespace_)) 14973 if self.Process_ID is not None: 14974 showIndent(outfile, level) 14975 outfile.write('<%sProcess_ID>%s</%sProcess_ID>\n' % (namespace_, self.gds_format_string(quote_xml(self.Process_ID).encode(ExternalEncoding), input_name='Process_ID'), namespace_)) 14976 if self.Start_Address is not None: 14977 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address') 14978 if self.Parent_Process is not None: 14979 self.Parent_Process.export(outfile, level, namespace_, name_='Parent_Process') 14980 if self.Start_DateTime is not None: 14981 showIndent(outfile, level) 14982 outfile.write('<%sStart_DateTime>%s</%sStart_DateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.Start_DateTime).encode(ExternalEncoding), input_name='Start_DateTime'), namespace_)) 14983 if self.Child_Processes is not None: 14984 self.Child_Processes.export(outfile, level, namespace_, name_='Child_Processes') 14985 if self.Handles is not None: 14986 self.Handles.export(outfile, level, namespace_, name_='Handles')
14987 - def hasContent_(self):
14988 if ( 14989 self.Image_Name is not None or 14990 self.Start_Username is not None or 14991 self.Current_Directory is not None or 14992 self.Command_Line is not None or 14993 self.Security_Attributes is not None or 14994 self.Process_ID is not None or 14995 self.Start_Address is not None or 14996 self.Parent_Process is not None or 14997 self.Start_DateTime is not None or 14998 self.Child_Processes is not None or 14999 self.Handles is not None 15000 ): 15001 return True 15002 else: 15003 return False
15004 - def exportLiteral(self, outfile, level, name_='Process_Object_AttributesType'):
15005 level += 1 15006 self.exportLiteralAttributes(outfile, level, [], name_) 15007 if self.hasContent_(): 15008 self.exportLiteralChildren(outfile, level, name_)
15009 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15010 pass
15011 - def exportLiteralChildren(self, outfile, level, name_):
15012 if self.Image_Name is not None: 15013 showIndent(outfile, level) 15014 outfile.write('Image_Name=%s,\n' % quote_python(self.Image_Name).encode(ExternalEncoding)) 15015 if self.Start_Username is not None: 15016 showIndent(outfile, level) 15017 outfile.write('Start_Username=%s,\n' % quote_python(self.Start_Username).encode(ExternalEncoding)) 15018 if self.Current_Directory is not None: 15019 showIndent(outfile, level) 15020 outfile.write('Current_Directory=%s,\n' % quote_python(self.Current_Directory).encode(ExternalEncoding)) 15021 if self.Command_Line is not None: 15022 showIndent(outfile, level) 15023 outfile.write('Command_Line=%s,\n' % quote_python(self.Command_Line).encode(ExternalEncoding)) 15024 if self.Security_Attributes is not None: 15025 showIndent(outfile, level) 15026 outfile.write('Security_Attributes=%s,\n' % quote_python(self.Security_Attributes).encode(ExternalEncoding)) 15027 if self.Process_ID is not None: 15028 showIndent(outfile, level) 15029 outfile.write('Process_ID=%s,\n' % quote_python(self.Process_ID).encode(ExternalEncoding)) 15030 if self.Start_Address is not None: 15031 showIndent(outfile, level) 15032 outfile.write('Start_Address=model_.xs_hexBinary(\n') 15033 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address') 15034 showIndent(outfile, level) 15035 outfile.write('),\n') 15036 if self.Parent_Process is not None: 15037 showIndent(outfile, level) 15038 outfile.write('Parent_Process=model_.ObjectReferenceType(\n') 15039 self.Parent_Process.exportLiteral(outfile, level, name_='Parent_Process') 15040 showIndent(outfile, level) 15041 outfile.write('),\n') 15042 if self.Start_DateTime is not None: 15043 showIndent(outfile, level) 15044 outfile.write('Start_DateTime=%s,\n' % quote_python(self.Start_DateTime).encode(ExternalEncoding)) 15045 if self.Child_Processes is not None: 15046 showIndent(outfile, level) 15047 outfile.write('Child_Processes=model_.Child_ProcessesType(\n') 15048 self.Child_Processes.exportLiteral(outfile, level, name_='Child_Processes') 15049 showIndent(outfile, level) 15050 outfile.write('),\n') 15051 if self.Handles is not None: 15052 showIndent(outfile, level) 15053 outfile.write('Handles=model_.HandlesType(\n') 15054 self.Handles.exportLiteral(outfile, level, name_='Handles') 15055 showIndent(outfile, level) 15056 outfile.write('),\n')
15057 - def build(self, node):
15058 self.buildAttributes(node, node.attrib, []) 15059 for child in node: 15060 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15061 self.buildChildren(child, node, nodeName_)
15062 - def buildAttributes(self, node, attrs, already_processed):
15063 pass
15064 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15065 if nodeName_ == 'Image_Name': 15066 Image_Name_ = child_.text 15067 Image_Name_ = self.gds_validate_string(Image_Name_, node, 'Image_Name') 15068 self.Image_Name = Image_Name_ 15069 elif nodeName_ == 'Start_Username': 15070 Start_Username_ = child_.text 15071 Start_Username_ = self.gds_validate_string(Start_Username_, node, 'Start_Username') 15072 self.Start_Username = Start_Username_ 15073 elif nodeName_ == 'Current_Directory': 15074 Current_Directory_ = child_.text 15075 Current_Directory_ = self.gds_validate_string(Current_Directory_, node, 'Current_Directory') 15076 self.Current_Directory = Current_Directory_ 15077 elif nodeName_ == 'Command_Line': 15078 Command_Line_ = child_.text 15079 Command_Line_ = self.gds_validate_string(Command_Line_, node, 'Command_Line') 15080 self.Command_Line = Command_Line_ 15081 elif nodeName_ == 'Security_Attributes': 15082 Security_Attributes_ = child_.text 15083 Security_Attributes_ = self.gds_validate_string(Security_Attributes_, node, 'Security_Attributes') 15084 self.Security_Attributes = Security_Attributes_ 15085 elif nodeName_ == 'Process_ID': 15086 Process_ID_ = child_.text 15087 Process_ID_ = self.gds_validate_string(Process_ID_, node, 'Process_ID') 15088 self.Process_ID = Process_ID_ 15089 elif nodeName_ == 'Start_Address': 15090 obj_ = xs_hexBinary.factory() 15091 obj_.build(child_) 15092 self.set_Start_Address(obj_) 15093 elif nodeName_ == 'Parent_Process': 15094 obj_ = ObjectReferenceType.factory() 15095 obj_.build(child_) 15096 self.set_Parent_Process(obj_) 15097 elif nodeName_ == 'Start_DateTime': 15098 Start_DateTime_ = child_.text 15099 Start_DateTime_ = self.gds_validate_string(Start_DateTime_, node, 'Start_DateTime') 15100 self.Start_DateTime = Start_DateTime_ 15101 elif nodeName_ == 'Child_Processes': 15102 obj_ = Child_ProcessesType.factory() 15103 obj_.build(child_) 15104 self.set_Child_Processes(obj_) 15105 elif nodeName_ == 'Handles': 15106 obj_ = HandlesType.factory() 15107 obj_.build(child_) 15108 self.set_Handles(obj_)
15109 # end class Process_Object_AttributesType 15110 15111
15112 -class Child_ProcessesType(GeneratedsSuper):
15113 subclass = None 15114 superclass = None
15115 - def __init__(self, Child_Process=None):
15116 if Child_Process is None: 15117 self.Child_Process = [] 15118 else: 15119 self.Child_Process = Child_Process
15120 - def factory(*args_, **kwargs_):
15121 if Child_ProcessesType.subclass: 15122 return Child_ProcessesType.subclass(*args_, **kwargs_) 15123 else: 15124 return Child_ProcessesType(*args_, **kwargs_)
15125 factory = staticmethod(factory)
15126 - def get_Child_Process(self): return self.Child_Process
15127 - def set_Child_Process(self, Child_Process): self.Child_Process = Child_Process
15128 - def add_Child_Process(self, value): self.Child_Process.append(value)
15129 - def insert_Child_Process(self, index, value): self.Child_Process[index] = value
15130 - def export(self, outfile, level, namespace_='maec:', name_='Child_ProcessesType', namespacedef_=''):
15131 showIndent(outfile, level) 15132 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15133 already_processed = [] 15134 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Child_ProcessesType') 15135 if self.hasContent_(): 15136 outfile.write('>\n') 15137 self.exportChildren(outfile, level + 1, namespace_, name_) 15138 showIndent(outfile, level) 15139 outfile.write('</%s%s>\n' % (namespace_, name_)) 15140 else: 15141 outfile.write('/>\n')
15142 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Child_ProcessesType'):
15143 pass
15144 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Child_ProcessesType', fromsubclass_=False):
15145 for Child_Process_ in self.Child_Process: 15146 Child_Process_.export(outfile, level, namespace_, name_='Child_Process')
15147 - def hasContent_(self):
15148 if ( 15149 self.Child_Process 15150 ): 15151 return True 15152 else: 15153 return False
15154 - def exportLiteral(self, outfile, level, name_='Child_ProcessesType'):
15155 level += 1 15156 self.exportLiteralAttributes(outfile, level, [], name_) 15157 if self.hasContent_(): 15158 self.exportLiteralChildren(outfile, level, name_)
15159 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15160 pass
15161 - def exportLiteralChildren(self, outfile, level, name_):
15162 showIndent(outfile, level) 15163 outfile.write('Child_Process=[\n') 15164 level += 1 15165 for Child_Process_ in self.Child_Process: 15166 showIndent(outfile, level) 15167 outfile.write('model_.ObjectReferenceType(\n') 15168 Child_Process_.exportLiteral(outfile, level, name_='ObjectReferenceType') 15169 showIndent(outfile, level) 15170 outfile.write('),\n') 15171 level -= 1 15172 showIndent(outfile, level) 15173 outfile.write('],\n')
15174 - def build(self, node):
15175 self.buildAttributes(node, node.attrib, []) 15176 for child in node: 15177 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15178 self.buildChildren(child, node, nodeName_)
15179 - def buildAttributes(self, node, attrs, already_processed):
15180 pass
15181 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15182 if nodeName_ == 'Child_Process': 15183 obj_ = ObjectReferenceType.factory() 15184 obj_.build(child_) 15185 self.Child_Process.append(obj_)
15186 # end class Child_ProcessesType 15187 15188
15189 -class HandlesType(GeneratedsSuper):
15190 subclass = None 15191 superclass = None
15192 - def __init__(self, Handle=None):
15193 if Handle is None: 15194 self.Handle = [] 15195 else: 15196 self.Handle = Handle
15197 - def factory(*args_, **kwargs_):
15198 if HandlesType.subclass: 15199 return HandlesType.subclass(*args_, **kwargs_) 15200 else: 15201 return HandlesType(*args_, **kwargs_)
15202 factory = staticmethod(factory)
15203 - def get_Handle(self): return self.Handle
15204 - def set_Handle(self, Handle): self.Handle = Handle
15205 - def add_Handle(self, value): self.Handle.append(value)
15206 - def insert_Handle(self, index, value): self.Handle[index] = value
15207 - def export(self, outfile, level, namespace_='maec:', name_='HandlesType', namespacedef_=''):
15208 showIndent(outfile, level) 15209 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15210 already_processed = [] 15211 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HandlesType') 15212 if self.hasContent_(): 15213 outfile.write('>\n') 15214 self.exportChildren(outfile, level + 1, namespace_, name_) 15215 showIndent(outfile, level) 15216 outfile.write('</%s%s>\n' % (namespace_, name_)) 15217 else: 15218 outfile.write('/>\n')
15219 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HandlesType'):
15220 pass
15221 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HandlesType', fromsubclass_=False):
15222 for Handle_ in self.Handle: 15223 Handle_.export(outfile, level, namespace_, name_='Handle')
15224 - def hasContent_(self):
15225 if ( 15226 self.Handle 15227 ): 15228 return True 15229 else: 15230 return False
15231 - def exportLiteral(self, outfile, level, name_='HandlesType'):
15232 level += 1 15233 self.exportLiteralAttributes(outfile, level, [], name_) 15234 if self.hasContent_(): 15235 self.exportLiteralChildren(outfile, level, name_)
15236 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15237 pass
15238 - def exportLiteralChildren(self, outfile, level, name_):
15239 showIndent(outfile, level) 15240 outfile.write('Handle=[\n') 15241 level += 1 15242 for Handle_ in self.Handle: 15243 showIndent(outfile, level) 15244 outfile.write('model_.HandleType(\n') 15245 Handle_.exportLiteral(outfile, level, name_='HandleType') 15246 showIndent(outfile, level) 15247 outfile.write('),\n') 15248 level -= 1 15249 showIndent(outfile, level) 15250 outfile.write('],\n')
15251 - def build(self, node):
15252 self.buildAttributes(node, node.attrib, []) 15253 for child in node: 15254 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15255 self.buildChildren(child, node, nodeName_)
15256 - def buildAttributes(self, node, attrs, already_processed):
15257 pass
15258 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15259 if nodeName_ == 'Handle': 15260 obj_ = HandleType.factory() 15261 obj_.build(child_) 15262 self.Handle.append(obj_)
15263 # end class HandlesType 15264 15265
15266 -class HandleType(GeneratedsSuper):
15267 subclass = None 15268 superclass = None
15269 - def __init__(self, Name=None):
15270 self.Name = Name
15271 - def factory(*args_, **kwargs_):
15272 if HandleType.subclass: 15273 return HandleType.subclass(*args_, **kwargs_) 15274 else: 15275 return HandleType(*args_, **kwargs_)
15276 factory = staticmethod(factory)
15277 - def get_Name(self): return self.Name
15278 - def set_Name(self, Name): self.Name = Name
15279 - def export(self, outfile, level, namespace_='maec:', name_='HandleType', namespacedef_=''):
15280 showIndent(outfile, level) 15281 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15282 already_processed = [] 15283 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HandleType') 15284 if self.hasContent_(): 15285 outfile.write('>\n') 15286 self.exportChildren(outfile, level + 1, namespace_, name_) 15287 showIndent(outfile, level) 15288 outfile.write('</%s%s>\n' % (namespace_, name_)) 15289 else: 15290 outfile.write('/>\n')
15291 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HandleType'):
15292 pass
15293 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HandleType', fromsubclass_=False):
15294 if self.Name is not None: 15295 showIndent(outfile, level) 15296 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_integer(self.Name, input_name='Name'), namespace_))
15297 - def hasContent_(self):
15298 if ( 15299 self.Name is not None 15300 ): 15301 return True 15302 else: 15303 return False
15304 - def exportLiteral(self, outfile, level, name_='HandleType'):
15305 level += 1 15306 self.exportLiteralAttributes(outfile, level, [], name_) 15307 if self.hasContent_(): 15308 self.exportLiteralChildren(outfile, level, name_)
15309 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15310 pass
15311 - def exportLiteralChildren(self, outfile, level, name_):
15312 if self.Name is not None: 15313 showIndent(outfile, level) 15314 outfile.write('Name=%d,\n' % self.Name)
15315 - def build(self, node):
15316 self.buildAttributes(node, node.attrib, []) 15317 for child in node: 15318 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15319 self.buildChildren(child, node, nodeName_)
15320 - def buildAttributes(self, node, attrs, already_processed):
15321 pass
15322 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15323 if nodeName_ == 'Name': 15324 sval_ = child_.text 15325 try: 15326 ival_ = int(sval_) 15327 except (TypeError, ValueError) as e: 15328 raise_parse_error(child_, 'requires integer: %s' % e) 15329 ival_ = self.gds_validate_integer(ival_, node, 'Name') 15330 self.Name = ival_
15331 # end class HandleType 15332 15333
15334 -class Memory_Object_AttributesType(GeneratedsSuper):
15335 subclass = None 15336 superclass = None
15337 - def __init__(self, Memory_Block_ID=None, Start_Address=None):
15338 self.Memory_Block_ID = Memory_Block_ID 15339 self.Start_Address = Start_Address
15340 - def factory(*args_, **kwargs_):
15341 if Memory_Object_AttributesType.subclass: 15342 return Memory_Object_AttributesType.subclass(*args_, **kwargs_) 15343 else: 15344 return Memory_Object_AttributesType(*args_, **kwargs_)
15345 factory = staticmethod(factory)
15346 - def get_Memory_Block_ID(self): return self.Memory_Block_ID
15347 - def set_Memory_Block_ID(self, Memory_Block_ID): self.Memory_Block_ID = Memory_Block_ID
15348 - def get_Start_Address(self): return self.Start_Address
15349 - def set_Start_Address(self, Start_Address): self.Start_Address = Start_Address
15350 - def export(self, outfile, level, namespace_='maec:', name_='Memory_Object_AttributesType', namespacedef_=''):
15351 showIndent(outfile, level) 15352 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15353 already_processed = [] 15354 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Memory_Object_AttributesType') 15355 if self.hasContent_(): 15356 outfile.write('>\n') 15357 self.exportChildren(outfile, level + 1, namespace_, name_) 15358 showIndent(outfile, level) 15359 outfile.write('</%s%s>\n' % (namespace_, name_)) 15360 else: 15361 outfile.write('/>\n')
15362 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Memory_Object_AttributesType'):
15363 pass
15364 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Memory_Object_AttributesType', fromsubclass_=False):
15365 if self.Memory_Block_ID is not None: 15366 showIndent(outfile, level) 15367 outfile.write('<%sMemory_Block_ID>%s</%sMemory_Block_ID>\n' % (namespace_, self.gds_format_string(quote_xml(self.Memory_Block_ID).encode(ExternalEncoding), input_name='Memory_Block_ID'), namespace_)) 15368 if self.Start_Address is not None: 15369 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
15370 - def hasContent_(self):
15371 if ( 15372 self.Memory_Block_ID is not None or 15373 self.Start_Address is not None 15374 ): 15375 return True 15376 else: 15377 return False
15378 - def exportLiteral(self, outfile, level, name_='Memory_Object_AttributesType'):
15379 level += 1 15380 self.exportLiteralAttributes(outfile, level, [], name_) 15381 if self.hasContent_(): 15382 self.exportLiteralChildren(outfile, level, name_)
15383 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15384 pass
15385 - def exportLiteralChildren(self, outfile, level, name_):
15386 if self.Memory_Block_ID is not None: 15387 showIndent(outfile, level) 15388 outfile.write('Memory_Block_ID=%s,\n' % quote_python(self.Memory_Block_ID).encode(ExternalEncoding)) 15389 if self.Start_Address is not None: 15390 showIndent(outfile, level) 15391 outfile.write('Start_Address=model_.xs_hexBinary(\n') 15392 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address') 15393 showIndent(outfile, level) 15394 outfile.write('),\n')
15395 - def build(self, node):
15396 self.buildAttributes(node, node.attrib, []) 15397 for child in node: 15398 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15399 self.buildChildren(child, node, nodeName_)
15400 - def buildAttributes(self, node, attrs, already_processed):
15401 pass
15402 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15403 if nodeName_ == 'Memory_Block_ID': 15404 Memory_Block_ID_ = child_.text 15405 Memory_Block_ID_ = self.gds_validate_string(Memory_Block_ID_, node, 'Memory_Block_ID') 15406 self.Memory_Block_ID = Memory_Block_ID_ 15407 elif nodeName_ == 'Start_Address': 15408 obj_ = xs_hexBinary.factory() 15409 obj_.build(child_) 15410 self.set_Start_Address(obj_)
15411 # end class Memory_Object_AttributesType 15412 15413
15414 -class Network_Object_AttributesType(GeneratedsSuper):
15415 subclass = None 15416 superclass = None
15417 - def __init__(self, Internal_Port=None, External_Port=None, Socket_Type=None, Socket_ID=None, Internal_IP_Address=None, External_IP_Address=None, IP_Protocol=None, Application_Layer_Protocol=None):
15418 self.Internal_Port = Internal_Port 15419 self.External_Port = External_Port 15420 self.Socket_Type = Socket_Type 15421 self.Socket_ID = Socket_ID 15422 self.Internal_IP_Address = Internal_IP_Address 15423 self.External_IP_Address = External_IP_Address 15424 self.IP_Protocol = IP_Protocol 15425 self.Application_Layer_Protocol = Application_Layer_Protocol
15426 - def factory(*args_, **kwargs_):
15427 if Network_Object_AttributesType.subclass: 15428 return Network_Object_AttributesType.subclass(*args_, **kwargs_) 15429 else: 15430 return Network_Object_AttributesType(*args_, **kwargs_)
15431 factory = staticmethod(factory)
15432 - def get_Internal_Port(self): return self.Internal_Port
15433 - def set_Internal_Port(self, Internal_Port): self.Internal_Port = Internal_Port
15434 - def get_External_Port(self): return self.External_Port
15435 - def set_External_Port(self, External_Port): self.External_Port = External_Port
15436 - def get_Socket_Type(self): return self.Socket_Type
15437 - def set_Socket_Type(self, Socket_Type): self.Socket_Type = Socket_Type
15438 - def get_Socket_ID(self): return self.Socket_ID
15439 - def set_Socket_ID(self, Socket_ID): self.Socket_ID = Socket_ID
15440 - def get_Internal_IP_Address(self): return self.Internal_IP_Address
15441 - def set_Internal_IP_Address(self, Internal_IP_Address): self.Internal_IP_Address = Internal_IP_Address
15442 - def get_External_IP_Address(self): return self.External_IP_Address
15443 - def set_External_IP_Address(self, External_IP_Address): self.External_IP_Address = External_IP_Address
15444 - def get_IP_Protocol(self): return self.IP_Protocol
15445 - def set_IP_Protocol(self, IP_Protocol): self.IP_Protocol = IP_Protocol
15446 - def validate_IPTypeEnum(self, value):
15447 # Validate type IPTypeEnum, a restriction on xs:string. 15448 pass
15449 - def get_Application_Layer_Protocol(self): return self.Application_Layer_Protocol
15450 - def set_Application_Layer_Protocol(self, Application_Layer_Protocol): self.Application_Layer_Protocol = Application_Layer_Protocol
15451 - def validate_ApplicationProtocolEnum(self, value):
15452 # Validate type ApplicationProtocolEnum, a restriction on xs:string. 15453 pass
15454 - def export(self, outfile, level, namespace_='maec:', name_='Network_Object_AttributesType', namespacedef_=''):
15455 showIndent(outfile, level) 15456 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15457 already_processed = [] 15458 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Network_Object_AttributesType') 15459 if self.hasContent_(): 15460 outfile.write('>\n') 15461 self.exportChildren(outfile, level + 1, namespace_, name_) 15462 showIndent(outfile, level) 15463 outfile.write('</%s%s>\n' % (namespace_, name_)) 15464 else: 15465 outfile.write('/>\n')
15466 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Network_Object_AttributesType'):
15467 pass
15468 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Network_Object_AttributesType', fromsubclass_=False):
15469 if self.Internal_Port is not None: 15470 showIndent(outfile, level) 15471 outfile.write('<%sInternal_Port>%s</%sInternal_Port>\n' % (namespace_, self.gds_format_integer(self.Internal_Port, input_name='Internal_Port'), namespace_)) 15472 if self.External_Port is not None: 15473 showIndent(outfile, level) 15474 outfile.write('<%sExternal_Port>%s</%sExternal_Port>\n' % (namespace_, self.gds_format_integer(self.External_Port, input_name='External_Port'), namespace_)) 15475 if self.Socket_Type is not None: 15476 showIndent(outfile, level) 15477 outfile.write('<%sSocket_Type>%s</%sSocket_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Socket_Type).encode(ExternalEncoding), input_name='Socket_Type'), namespace_)) 15478 if self.Socket_ID is not None: 15479 showIndent(outfile, level) 15480 outfile.write('<%sSocket_ID>%s</%sSocket_ID>\n' % (namespace_, self.gds_format_integer(self.Socket_ID, input_name='Socket_ID'), namespace_)) 15481 if self.Internal_IP_Address is not None: 15482 self.Internal_IP_Address.export(outfile, level, namespace_, name_='Internal_IP_Address') 15483 if self.External_IP_Address is not None: 15484 self.External_IP_Address.export(outfile, level, namespace_, name_='External_IP_Address') 15485 if self.IP_Protocol is not None: 15486 showIndent(outfile, level) 15487 outfile.write('<%sIP_Protocol>%s</%sIP_Protocol>\n' % (namespace_, self.gds_format_string(quote_xml(self.IP_Protocol).encode(ExternalEncoding), input_name='IP_Protocol'), namespace_)) 15488 if self.Application_Layer_Protocol is not None: 15489 showIndent(outfile, level) 15490 outfile.write('<%sApplication_Layer_Protocol>%s</%sApplication_Layer_Protocol>\n' % (namespace_, self.gds_format_string(quote_xml(self.Application_Layer_Protocol).encode(ExternalEncoding), input_name='Application_Layer_Protocol'), namespace_))
15491 - def hasContent_(self):
15492 if ( 15493 self.Internal_Port is not None or 15494 self.External_Port is not None or 15495 self.Socket_Type is not None or 15496 self.Socket_ID is not None or 15497 self.Internal_IP_Address is not None or 15498 self.External_IP_Address is not None or 15499 self.IP_Protocol is not None or 15500 self.Application_Layer_Protocol is not None 15501 ): 15502 return True 15503 else: 15504 return False
15505 - def exportLiteral(self, outfile, level, name_='Network_Object_AttributesType'):
15506 level += 1 15507 self.exportLiteralAttributes(outfile, level, [], name_) 15508 if self.hasContent_(): 15509 self.exportLiteralChildren(outfile, level, name_)
15510 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15511 pass
15512 - def exportLiteralChildren(self, outfile, level, name_):
15513 if self.Internal_Port is not None: 15514 showIndent(outfile, level) 15515 outfile.write('Internal_Port=%d,\n' % self.Internal_Port) 15516 if self.External_Port is not None: 15517 showIndent(outfile, level) 15518 outfile.write('External_Port=%d,\n' % self.External_Port) 15519 if self.Socket_Type is not None: 15520 showIndent(outfile, level) 15521 outfile.write('Socket_Type=%s,\n' % quote_python(self.Socket_Type).encode(ExternalEncoding)) 15522 if self.Socket_ID is not None: 15523 showIndent(outfile, level) 15524 outfile.write('Socket_ID=%d,\n' % self.Socket_ID) 15525 if self.Internal_IP_Address is not None: 15526 showIndent(outfile, level) 15527 outfile.write('Internal_IP_Address=model_.IPAddress(\n') 15528 self.Internal_IP_Address.exportLiteral(outfile, level, name_='Internal_IP_Address') 15529 showIndent(outfile, level) 15530 outfile.write('),\n') 15531 if self.External_IP_Address is not None: 15532 showIndent(outfile, level) 15533 outfile.write('External_IP_Address=model_.IPAddress(\n') 15534 self.External_IP_Address.exportLiteral(outfile, level, name_='External_IP_Address') 15535 showIndent(outfile, level) 15536 outfile.write('),\n') 15537 if self.IP_Protocol is not None: 15538 showIndent(outfile, level) 15539 outfile.write('IP_Protocol=%s,\n' % quote_python(self.IP_Protocol).encode(ExternalEncoding)) 15540 if self.Application_Layer_Protocol is not None: 15541 showIndent(outfile, level) 15542 outfile.write('Application_Layer_Protocol=%s,\n' % quote_python(self.Application_Layer_Protocol).encode(ExternalEncoding))
15543 - def build(self, node):
15544 self.buildAttributes(node, node.attrib, []) 15545 for child in node: 15546 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15547 self.buildChildren(child, node, nodeName_)
15548 - def buildAttributes(self, node, attrs, already_processed):
15549 pass
15550 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15551 if nodeName_ == 'Internal_Port': 15552 sval_ = child_.text 15553 try: 15554 ival_ = int(sval_) 15555 except (TypeError, ValueError) as e: 15556 raise_parse_error(child_, 'requires integer: %s' % e) 15557 ival_ = self.gds_validate_integer(ival_, node, 'Internal_Port') 15558 self.Internal_Port = ival_ 15559 elif nodeName_ == 'External_Port': 15560 sval_ = child_.text 15561 try: 15562 ival_ = int(sval_) 15563 except (TypeError, ValueError) as e: 15564 raise_parse_error(child_, 'requires integer: %s' % e) 15565 ival_ = self.gds_validate_integer(ival_, node, 'External_Port') 15566 self.External_Port = ival_ 15567 elif nodeName_ == 'Socket_Type': 15568 Socket_Type_ = child_.text 15569 Socket_Type_ = self.gds_validate_string(Socket_Type_, node, 'Socket_Type') 15570 self.Socket_Type = Socket_Type_ 15571 elif nodeName_ == 'Socket_ID': 15572 sval_ = child_.text 15573 try: 15574 ival_ = int(sval_) 15575 except (TypeError, ValueError) as e: 15576 raise_parse_error(child_, 'requires integer: %s' % e) 15577 ival_ = self.gds_validate_integer(ival_, node, 'Socket_ID') 15578 self.Socket_ID = ival_ 15579 elif nodeName_ == 'Internal_IP_Address': 15580 obj_ = IPAddress.factory() 15581 obj_.build(child_) 15582 self.set_Internal_IP_Address(obj_) 15583 elif nodeName_ == 'External_IP_Address': 15584 obj_ = IPAddress.factory() 15585 obj_.build(child_) 15586 self.set_External_IP_Address(obj_) 15587 elif nodeName_ == 'IP_Protocol': 15588 IP_Protocol_ = child_.text 15589 IP_Protocol_ = self.gds_validate_string(IP_Protocol_, node, 'IP_Protocol') 15590 self.IP_Protocol = IP_Protocol_ 15591 self.validate_IPTypeEnum(self.IP_Protocol) # validate type IPTypeEnum 15592 elif nodeName_ == 'Application_Layer_Protocol': 15593 Application_Layer_Protocol_ = child_.text 15594 Application_Layer_Protocol_ = self.gds_validate_string(Application_Layer_Protocol_, node, 'Application_Layer_Protocol') 15595 self.Application_Layer_Protocol = Application_Layer_Protocol_ 15596 self.validate_ApplicationProtocolEnum(self.Application_Layer_Protocol) # validate type ApplicationProtocolEnum
15597 # end class Network_Object_AttributesType 15598 15599
15600 -class Socket_Type(GeneratedsSuper):
15601 """The Socket_Type field contains the socket type for socket network 15602 objects. Possible values: Streaming, Datagram, Raw, RDM, 15603 Sequential_Packet, Other.""" 15604 subclass = None 15605 superclass = None
15606 - def __init__(self):
15607 pass
15608 - def factory(*args_, **kwargs_):
15609 if Socket_Type.subclass: 15610 return Socket_Type.subclass(*args_, **kwargs_) 15611 else: 15612 return Socket_Type(*args_, **kwargs_)
15613 factory = staticmethod(factory)
15614 - def export(self, outfile, level, namespace_='maec:', name_='Socket_Type', namespacedef_=''):
15615 showIndent(outfile, level) 15616 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15617 already_processed = [] 15618 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Socket_Type') 15619 if self.hasContent_(): 15620 outfile.write('>\n') 15621 self.exportChildren(outfile, level + 1, namespace_, name_) 15622 outfile.write('</%s%s>\n' % (namespace_, name_)) 15623 else: 15624 outfile.write('/>\n')
15625 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Socket_Type'):
15626 pass
15627 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Socket_Type', fromsubclass_=False):
15628 pass
15629 - def hasContent_(self):
15630 if ( 15631 15632 ): 15633 return True 15634 else: 15635 return False
15636 - def exportLiteral(self, outfile, level, name_='Socket_Type'):
15637 level += 1 15638 self.exportLiteralAttributes(outfile, level, [], name_) 15639 if self.hasContent_(): 15640 self.exportLiteralChildren(outfile, level, name_)
15641 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15642 pass
15643 - def exportLiteralChildren(self, outfile, level, name_):
15644 pass
15645 - def build(self, node):
15646 self.buildAttributes(node, node.attrib, []) 15647 for child in node: 15648 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15649 self.buildChildren(child, node, nodeName_)
15650 - def buildAttributes(self, node, attrs, already_processed):
15651 pass
15652 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15653 pass
15654 # end class Socket_Type 15655 15656
15657 -class Daemon_Object_AttributesType(GeneratedsSuper):
15658 subclass = None 15659 superclass = None
15660 - def __init__(self, Service_Type=None, Start_Type=None, Display_Name=None, Daemon_Binary_Object=None, Load_Order_Group=None):
15661 self.Service_Type = Service_Type 15662 self.Start_Type = Start_Type 15663 self.Display_Name = Display_Name 15664 self.Daemon_Binary_Object = Daemon_Binary_Object 15665 self.Load_Order_Group = Load_Order_Group
15666 - def factory(*args_, **kwargs_):
15667 if Daemon_Object_AttributesType.subclass: 15668 return Daemon_Object_AttributesType.subclass(*args_, **kwargs_) 15669 else: 15670 return Daemon_Object_AttributesType(*args_, **kwargs_)
15671 factory = staticmethod(factory)
15672 - def get_Service_Type(self): return self.Service_Type
15673 - def set_Service_Type(self, Service_Type): self.Service_Type = Service_Type
15674 - def get_Start_Type(self): return self.Start_Type
15675 - def set_Start_Type(self, Start_Type): self.Start_Type = Start_Type
15676 - def get_Display_Name(self): return self.Display_Name
15677 - def set_Display_Name(self, Display_Name): self.Display_Name = Display_Name
15678 - def get_Daemon_Binary_Object(self): return self.Daemon_Binary_Object
15679 - def set_Daemon_Binary_Object(self, Daemon_Binary_Object): self.Daemon_Binary_Object = Daemon_Binary_Object
15680 - def get_Load_Order_Group(self): return self.Load_Order_Group
15681 - def set_Load_Order_Group(self, Load_Order_Group): self.Load_Order_Group = Load_Order_Group
15682 - def export(self, outfile, level, namespace_='maec:', name_='Daemon_Object_AttributesType', namespacedef_=''):
15683 showIndent(outfile, level) 15684 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15685 already_processed = [] 15686 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Daemon_Object_AttributesType') 15687 if self.hasContent_(): 15688 outfile.write('>\n') 15689 self.exportChildren(outfile, level + 1, namespace_, name_) 15690 showIndent(outfile, level) 15691 outfile.write('</%s%s>\n' % (namespace_, name_)) 15692 else: 15693 outfile.write('/>\n')
15694 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Daemon_Object_AttributesType'):
15695 pass
15696 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Daemon_Object_AttributesType', fromsubclass_=False):
15697 if self.Service_Type is not None: 15698 showIndent(outfile, level) 15699 outfile.write('<%sService_Type>%s</%sService_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Service_Type).encode(ExternalEncoding), input_name='Service_Type'), namespace_)) 15700 if self.Start_Type is not None: 15701 showIndent(outfile, level) 15702 outfile.write('<%sStart_Type>%s</%sStart_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Start_Type).encode(ExternalEncoding), input_name='Start_Type'), namespace_)) 15703 if self.Display_Name is not None: 15704 showIndent(outfile, level) 15705 outfile.write('<%sDisplay_Name>%s</%sDisplay_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Display_Name).encode(ExternalEncoding), input_name='Display_Name'), namespace_)) 15706 if self.Daemon_Binary_Object is not None: 15707 self.Daemon_Binary_Object.export(outfile, level, namespace_, name_='Daemon_Binary_Object') 15708 if self.Load_Order_Group is not None: 15709 showIndent(outfile, level) 15710 outfile.write('<%sLoad_Order_Group>%s</%sLoad_Order_Group>\n' % (namespace_, self.gds_format_string(quote_xml(self.Load_Order_Group).encode(ExternalEncoding), input_name='Load_Order_Group'), namespace_))
15711 - def hasContent_(self):
15712 if ( 15713 self.Service_Type is not None or 15714 self.Start_Type is not None or 15715 self.Display_Name is not None or 15716 self.Daemon_Binary_Object is not None or 15717 self.Load_Order_Group is not None 15718 ): 15719 return True 15720 else: 15721 return False
15722 - def exportLiteral(self, outfile, level, name_='Daemon_Object_AttributesType'):
15723 level += 1 15724 self.exportLiteralAttributes(outfile, level, [], name_) 15725 if self.hasContent_(): 15726 self.exportLiteralChildren(outfile, level, name_)
15727 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15728 pass
15729 - def exportLiteralChildren(self, outfile, level, name_):
15730 if self.Service_Type is not None: 15731 showIndent(outfile, level) 15732 outfile.write('Service_Type=%s,\n' % quote_python(self.Service_Type).encode(ExternalEncoding)) 15733 if self.Start_Type is not None: 15734 showIndent(outfile, level) 15735 outfile.write('Start_Type=%s,\n' % quote_python(self.Start_Type).encode(ExternalEncoding)) 15736 if self.Display_Name is not None: 15737 showIndent(outfile, level) 15738 outfile.write('Display_Name=%s,\n' % quote_python(self.Display_Name).encode(ExternalEncoding)) 15739 if self.Daemon_Binary_Object is not None: 15740 showIndent(outfile, level) 15741 outfile.write('Daemon_Binary_Object=model_.ObjectType(\n') 15742 self.Daemon_Binary_Object.exportLiteral(outfile, level, name_='Daemon_Binary_Object') 15743 showIndent(outfile, level) 15744 outfile.write('),\n') 15745 if self.Load_Order_Group is not None: 15746 showIndent(outfile, level) 15747 outfile.write('Load_Order_Group=%s,\n' % quote_python(self.Load_Order_Group).encode(ExternalEncoding))
15748 - def build(self, node):
15749 self.buildAttributes(node, node.attrib, []) 15750 for child in node: 15751 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15752 self.buildChildren(child, node, nodeName_)
15753 - def buildAttributes(self, node, attrs, already_processed):
15754 pass
15755 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15756 if nodeName_ == 'Service_Type': 15757 Service_Type_ = child_.text 15758 Service_Type_ = self.gds_validate_string(Service_Type_, node, 'Service_Type') 15759 self.Service_Type = Service_Type_ 15760 elif nodeName_ == 'Start_Type': 15761 Start_Type_ = child_.text 15762 Start_Type_ = self.gds_validate_string(Start_Type_, node, 'Start_Type') 15763 self.Start_Type = Start_Type_ 15764 elif nodeName_ == 'Display_Name': 15765 Display_Name_ = child_.text 15766 Display_Name_ = self.gds_validate_string(Display_Name_, node, 'Display_Name') 15767 self.Display_Name = Display_Name_ 15768 elif nodeName_ == 'Daemon_Binary_Object': 15769 obj_ = ObjectType.factory() 15770 obj_.build(child_) 15771 self.set_Daemon_Binary_Object(obj_) 15772 elif nodeName_ == 'Load_Order_Group': 15773 Load_Order_Group_ = child_.text 15774 Load_Order_Group_ = self.gds_validate_string(Load_Order_Group_, node, 'Load_Order_Group') 15775 self.Load_Order_Group = Load_Order_Group_
15776 # end class Daemon_Object_AttributesType 15777 15778
15779 -class Service_Type(GeneratedsSuper):
15780 """The Service_Type field contains the type of the service object. 15781 Possible values: SERVICE_ADAPTER, SERVICE_FILE_SYSTEM_DRIVER, 15782 SERVICE_KERNEL_DRIVER, SERVICE_RECOGNIZER_DRIVER, 15783 SERVICE_WIN32_OWN_PROCESS, SERVICE_WIN32_SHARE_PROCESS.""" 15784 subclass = None 15785 superclass = None
15786 - def __init__(self):
15787 pass
15788 - def factory(*args_, **kwargs_):
15789 if Service_Type.subclass: 15790 return Service_Type.subclass(*args_, **kwargs_) 15791 else: 15792 return Service_Type(*args_, **kwargs_)
15793 factory = staticmethod(factory)
15794 - def export(self, outfile, level, namespace_='maec:', name_='Service_Type', namespacedef_=''):
15795 showIndent(outfile, level) 15796 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15797 already_processed = [] 15798 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Service_Type') 15799 if self.hasContent_(): 15800 outfile.write('>\n') 15801 self.exportChildren(outfile, level + 1, namespace_, name_) 15802 outfile.write('</%s%s>\n' % (namespace_, name_)) 15803 else: 15804 outfile.write('/>\n')
15805 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Service_Type'):
15806 pass
15807 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Service_Type', fromsubclass_=False):
15808 pass
15809 - def hasContent_(self):
15810 if ( 15811 15812 ): 15813 return True 15814 else: 15815 return False
15816 - def exportLiteral(self, outfile, level, name_='Service_Type'):
15817 level += 1 15818 self.exportLiteralAttributes(outfile, level, [], name_) 15819 if self.hasContent_(): 15820 self.exportLiteralChildren(outfile, level, name_)
15821 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15822 pass
15823 - def exportLiteralChildren(self, outfile, level, name_):
15824 pass
15825 - def build(self, node):
15826 self.buildAttributes(node, node.attrib, []) 15827 for child in node: 15828 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15829 self.buildChildren(child, node, nodeName_)
15830 - def buildAttributes(self, node, attrs, already_processed):
15831 pass
15832 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15833 pass
15834 # end class Service_Type 15835 15836
15837 -class Custom_Object_AttributesType(GeneratedsSuper):
15838 subclass = None 15839 superclass = None
15840 - def __init__(self, Custom_Attribute=None):
15841 if Custom_Attribute is None: 15842 self.Custom_Attribute = [] 15843 else: 15844 self.Custom_Attribute = Custom_Attribute
15845 - def factory(*args_, **kwargs_):
15846 if Custom_Object_AttributesType.subclass: 15847 return Custom_Object_AttributesType.subclass(*args_, **kwargs_) 15848 else: 15849 return Custom_Object_AttributesType(*args_, **kwargs_)
15850 factory = staticmethod(factory)
15851 - def get_Custom_Attribute(self): return self.Custom_Attribute
15852 - def set_Custom_Attribute(self, Custom_Attribute): self.Custom_Attribute = Custom_Attribute
15853 - def add_Custom_Attribute(self, value): self.Custom_Attribute.append(value)
15854 - def insert_Custom_Attribute(self, index, value): self.Custom_Attribute[index] = value
15855 - def export(self, outfile, level, namespace_='maec:', name_='Custom_Object_AttributesType', namespacedef_=''):
15856 showIndent(outfile, level) 15857 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15858 already_processed = [] 15859 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Custom_Object_AttributesType') 15860 if self.hasContent_(): 15861 outfile.write('>\n') 15862 self.exportChildren(outfile, level + 1, namespace_, name_) 15863 showIndent(outfile, level) 15864 outfile.write('</%s%s>\n' % (namespace_, name_)) 15865 else: 15866 outfile.write('/>\n')
15867 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Custom_Object_AttributesType'):
15868 pass
15869 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Custom_Object_AttributesType', fromsubclass_=False):
15870 for Custom_Attribute_ in self.Custom_Attribute: 15871 Custom_Attribute_.export(outfile, level, namespace_, name_='Custom_Attribute')
15872 - def hasContent_(self):
15873 if ( 15874 self.Custom_Attribute 15875 ): 15876 return True 15877 else: 15878 return False
15879 - def exportLiteral(self, outfile, level, name_='Custom_Object_AttributesType'):
15880 level += 1 15881 self.exportLiteralAttributes(outfile, level, [], name_) 15882 if self.hasContent_(): 15883 self.exportLiteralChildren(outfile, level, name_)
15884 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15885 pass
15886 - def exportLiteralChildren(self, outfile, level, name_):
15887 showIndent(outfile, level) 15888 outfile.write('Custom_Attribute=[\n') 15889 level += 1 15890 for Custom_Attribute_ in self.Custom_Attribute: 15891 showIndent(outfile, level) 15892 outfile.write('model_.Custom_AttributeType(\n') 15893 Custom_Attribute_.exportLiteral(outfile, level, name_='Custom_AttributeType') 15894 showIndent(outfile, level) 15895 outfile.write('),\n') 15896 level -= 1 15897 showIndent(outfile, level) 15898 outfile.write('],\n')
15899 - def build(self, node):
15900 self.buildAttributes(node, node.attrib, []) 15901 for child in node: 15902 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15903 self.buildChildren(child, node, nodeName_)
15904 - def buildAttributes(self, node, attrs, already_processed):
15905 pass
15906 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15907 if nodeName_ == 'Custom_Attribute': 15908 obj_ = Custom_AttributeType.factory() 15909 obj_.build(child_) 15910 self.Custom_Attribute.append(obj_)
15911 # end class Custom_Object_AttributesType 15912 15913
15914 -class Custom_AttributeType(GeneratedsSuper):
15915 """The custom_attribute_name attribute contains the name of the custom 15916 attribute.""" 15917 subclass = None 15918 superclass = None
15919 - def __init__(self, custom_attribute_name=None, valueOf_=None):
15920 self.custom_attribute_name = _cast(None, custom_attribute_name) 15921 self.valueOf_ = valueOf_
15922 - def factory(*args_, **kwargs_):
15923 if Custom_AttributeType.subclass: 15924 return Custom_AttributeType.subclass(*args_, **kwargs_) 15925 else: 15926 return Custom_AttributeType(*args_, **kwargs_)
15927 factory = staticmethod(factory)
15928 - def get_custom_attribute_name(self): return self.custom_attribute_name
15929 - def set_custom_attribute_name(self, custom_attribute_name): self.custom_attribute_name = custom_attribute_name
15930 - def get_valueOf_(self): return self.valueOf_
15931 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
15932 - def export(self, outfile, level, namespace_='maec:', name_='Custom_AttributeType', namespacedef_=''):
15933 showIndent(outfile, level) 15934 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 15935 already_processed = [] 15936 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Custom_AttributeType') 15937 if self.hasContent_(): 15938 outfile.write('>') 15939 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 15940 self.exportChildren(outfile, level + 1, namespace_, name_) 15941 outfile.write('</%s%s>\n' % (namespace_, name_)) 15942 else: 15943 outfile.write('/>\n')
15944 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Custom_AttributeType'):
15945 if self.custom_attribute_name is not None and 'custom_attribute_name' not in already_processed: 15946 already_processed.append('custom_attribute_name') 15947 outfile.write(' custom_attribute_name=%s' % (self.gds_format_string(quote_attrib(self.custom_attribute_name).encode(ExternalEncoding), input_name='custom_attribute_name'), ))
15948 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Custom_AttributeType', fromsubclass_=False):
15949 pass
15950 - def hasContent_(self):
15951 if ( 15952 self.valueOf_ 15953 ): 15954 return True 15955 else: 15956 return False
15957 - def exportLiteral(self, outfile, level, name_='Custom_AttributeType'):
15958 level += 1 15959 self.exportLiteralAttributes(outfile, level, [], name_) 15960 if self.hasContent_(): 15961 self.exportLiteralChildren(outfile, level, name_) 15962 showIndent(outfile, level) 15963 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
15964 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
15965 if self.custom_attribute_name is not None and 'custom_attribute_name' not in already_processed: 15966 already_processed.append('custom_attribute_name') 15967 showIndent(outfile, level) 15968 outfile.write('custom_attribute_name = "%s",\n' % (self.custom_attribute_name,))
15969 - def exportLiteralChildren(self, outfile, level, name_):
15970 pass
15971 - def build(self, node):
15972 self.buildAttributes(node, node.attrib, []) 15973 self.valueOf_ = get_all_text_(node) 15974 for child in node: 15975 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 15976 self.buildChildren(child, node, nodeName_)
15977 - def buildAttributes(self, node, attrs, already_processed):
15978 value = find_attr_value_('custom_attribute_name', node) 15979 if value is not None and 'custom_attribute_name' not in already_processed: 15980 already_processed.append('custom_attribute_name') 15981 self.custom_attribute_name = value
15982 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15983 pass
15984 # end class Custom_AttributeType 15985 15986
15987 -class Affected_ObjectsType(GeneratedsSuper):
15988 subclass = None 15989 superclass = None
15990 - def __init__(self, Affected_Object=None):
15991 if Affected_Object is None: 15992 self.Affected_Object = [] 15993 else: 15994 self.Affected_Object = Affected_Object
15995 - def factory(*args_, **kwargs_):
15996 if Affected_ObjectsType.subclass: 15997 return Affected_ObjectsType.subclass(*args_, **kwargs_) 15998 else: 15999 return Affected_ObjectsType(*args_, **kwargs_)
16000 factory = staticmethod(factory)
16001 - def get_Affected_Object(self): return self.Affected_Object
16002 - def set_Affected_Object(self, Affected_Object): self.Affected_Object = Affected_Object
16003 - def add_Affected_Object(self, value): self.Affected_Object.append(value)
16004 - def insert_Affected_Object(self, index, value): self.Affected_Object[index] = value
16005 - def export(self, outfile, level, namespace_='maec:', name_='Affected_ObjectsType', namespacedef_=''):
16006 showIndent(outfile, level) 16007 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16008 already_processed = [] 16009 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Affected_ObjectsType') 16010 if self.hasContent_(): 16011 outfile.write('>\n') 16012 self.exportChildren(outfile, level + 1, namespace_, name_) 16013 showIndent(outfile, level) 16014 outfile.write('</%s%s>\n' % (namespace_, name_)) 16015 else: 16016 outfile.write('/>\n')
16017 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Affected_ObjectsType'):
16018 pass
16019 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Affected_ObjectsType', fromsubclass_=False):
16020 for Affected_Object_ in self.Affected_Object: 16021 Affected_Object_.export(outfile, level, namespace_, name_='Affected_Object')
16022 - def hasContent_(self):
16023 if ( 16024 self.Affected_Object 16025 ): 16026 return True 16027 else: 16028 return False
16029 - def exportLiteral(self, outfile, level, name_='Affected_ObjectsType'):
16030 level += 1 16031 self.exportLiteralAttributes(outfile, level, [], name_) 16032 if self.hasContent_(): 16033 self.exportLiteralChildren(outfile, level, name_)
16034 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16035 pass
16036 - def exportLiteralChildren(self, outfile, level, name_):
16037 showIndent(outfile, level) 16038 outfile.write('Affected_Object=[\n') 16039 level += 1 16040 for Affected_Object_ in self.Affected_Object: 16041 showIndent(outfile, level) 16042 outfile.write('model_.Affected_ObjectType(\n') 16043 Affected_Object_.exportLiteral(outfile, level, name_='Affected_ObjectType') 16044 showIndent(outfile, level) 16045 outfile.write('),\n') 16046 level -= 1 16047 showIndent(outfile, level) 16048 outfile.write('],\n')
16049 - def build(self, node):
16050 self.buildAttributes(node, node.attrib, []) 16051 for child in node: 16052 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16053 self.buildChildren(child, node, nodeName_)
16054 - def buildAttributes(self, node, attrs, already_processed):
16055 pass
16056 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16057 if nodeName_ == 'Affected_Object': 16058 obj_ = Affected_ObjectType.factory() 16059 obj_.build(child_) 16060 self.Affected_Object.append(obj_)
16061 # end class Affected_ObjectsType 16062 16063
16064 -class Affected_ObjectType(GeneratedsSuper):
16065 subclass = None 16066 superclass = None
16067 - def __init__(self, effect_type=None, Object_Reference=None):
16068 self.effect_type = _cast(None, effect_type) 16069 self.Object_Reference = Object_Reference
16070 - def factory(*args_, **kwargs_):
16071 if Affected_ObjectType.subclass: 16072 return Affected_ObjectType.subclass(*args_, **kwargs_) 16073 else: 16074 return Affected_ObjectType(*args_, **kwargs_)
16075 factory = staticmethod(factory)
16076 - def get_Object_Reference(self): return self.Object_Reference
16077 - def set_Object_Reference(self, Object_Reference): self.Object_Reference = Object_Reference
16078 - def get_effect_type(self): return self.effect_type
16079 - def set_effect_type(self, effect_type): self.effect_type = effect_type
16080 - def export(self, outfile, level, namespace_='maec:', name_='Affected_ObjectType', namespacedef_=''):
16081 showIndent(outfile, level) 16082 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16083 already_processed = [] 16084 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Affected_ObjectType') 16085 if self.hasContent_(): 16086 outfile.write('>\n') 16087 self.exportChildren(outfile, level + 1, namespace_, name_) 16088 showIndent(outfile, level) 16089 outfile.write('</%s%s>\n' % (namespace_, name_)) 16090 else: 16091 outfile.write('/>\n')
16092 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Affected_ObjectType'):
16093 if self.effect_type is not None and 'effect_type' not in already_processed: 16094 already_processed.append('effect_type') 16095 outfile.write(' effect_type=%s' % (quote_attrib(self.effect_type), ))
16096 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Affected_ObjectType', fromsubclass_=False):
16097 if self.Object_Reference is not None: 16098 self.Object_Reference.export(outfile, level, namespace_, name_='Object_Reference', )
16099 - def hasContent_(self):
16100 if ( 16101 self.Object_Reference is not None 16102 ): 16103 return True 16104 else: 16105 return False
16106 - def exportLiteral(self, outfile, level, name_='Affected_ObjectType'):
16107 level += 1 16108 self.exportLiteralAttributes(outfile, level, [], name_) 16109 if self.hasContent_(): 16110 self.exportLiteralChildren(outfile, level, name_)
16111 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16112 if self.effect_type is not None and 'effect_type' not in already_processed: 16113 already_processed.append('effect_type') 16114 showIndent(outfile, level) 16115 outfile.write('effect_type = %s,\n' % (self.effect_type,))
16116 - def exportLiteralChildren(self, outfile, level, name_):
16117 if self.Object_Reference is not None: 16118 showIndent(outfile, level) 16119 outfile.write('Object_Reference=model_.ObjectReferenceType(\n') 16120 self.Object_Reference.exportLiteral(outfile, level, name_='Object_Reference') 16121 showIndent(outfile, level) 16122 outfile.write('),\n')
16123 - def build(self, node):
16124 self.buildAttributes(node, node.attrib, []) 16125 for child in node: 16126 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16127 self.buildChildren(child, node, nodeName_)
16128 - def buildAttributes(self, node, attrs, already_processed):
16129 value = find_attr_value_('effect_type', node) 16130 if value is not None and 'effect_type' not in already_processed: 16131 already_processed.append('effect_type') 16132 self.effect_type = value
16133 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16134 if nodeName_ == 'Object_Reference': 16135 obj_ = ObjectReferenceType.factory() 16136 obj_.build(child_) 16137 self.set_Object_Reference(obj_)
16138 # end class Affected_ObjectType 16139 16140
16141 -class Constituent_EffectsType(GeneratedsSuper):
16142 subclass = None 16143 superclass = None
16144 - def __init__(self, Effect_Reference=None):
16145 if Effect_Reference is None: 16146 self.Effect_Reference = [] 16147 else: 16148 self.Effect_Reference = Effect_Reference
16149 - def factory(*args_, **kwargs_):
16150 if Constituent_EffectsType.subclass: 16151 return Constituent_EffectsType.subclass(*args_, **kwargs_) 16152 else: 16153 return Constituent_EffectsType(*args_, **kwargs_)
16154 factory = staticmethod(factory)
16155 - def get_Effect_Reference(self): return self.Effect_Reference
16156 - def set_Effect_Reference(self, Effect_Reference): self.Effect_Reference = Effect_Reference
16157 - def add_Effect_Reference(self, value): self.Effect_Reference.append(value)
16158 - def insert_Effect_Reference(self, index, value): self.Effect_Reference[index] = value
16159 - def export(self, outfile, level, namespace_='maec:', name_='Constituent_EffectsType', namespacedef_=''):
16160 showIndent(outfile, level) 16161 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16162 already_processed = [] 16163 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Constituent_EffectsType') 16164 if self.hasContent_(): 16165 outfile.write('>\n') 16166 self.exportChildren(outfile, level + 1, namespace_, name_) 16167 showIndent(outfile, level) 16168 outfile.write('</%s%s>\n' % (namespace_, name_)) 16169 else: 16170 outfile.write('/>\n')
16171 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Constituent_EffectsType'):
16172 pass
16173 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Constituent_EffectsType', fromsubclass_=False):
16174 for Effect_Reference_ in self.Effect_Reference: 16175 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
16176 - def hasContent_(self):
16177 if ( 16178 self.Effect_Reference 16179 ): 16180 return True 16181 else: 16182 return False
16183 - def exportLiteral(self, outfile, level, name_='Constituent_EffectsType'):
16184 level += 1 16185 self.exportLiteralAttributes(outfile, level, [], name_) 16186 if self.hasContent_(): 16187 self.exportLiteralChildren(outfile, level, name_)
16188 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16189 pass
16190 - def exportLiteralChildren(self, outfile, level, name_):
16191 showIndent(outfile, level) 16192 outfile.write('Effect_Reference=[\n') 16193 level += 1 16194 for Effect_Reference_ in self.Effect_Reference: 16195 showIndent(outfile, level) 16196 outfile.write('model_.EffectReferenceType(\n') 16197 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType') 16198 showIndent(outfile, level) 16199 outfile.write('),\n') 16200 level -= 1 16201 showIndent(outfile, level) 16202 outfile.write('],\n')
16203 - def build(self, node):
16204 self.buildAttributes(node, node.attrib, []) 16205 for child in node: 16206 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16207 self.buildChildren(child, node, nodeName_)
16208 - def buildAttributes(self, node, attrs, already_processed):
16209 pass
16210 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16211 if nodeName_ == 'Effect_Reference': 16212 obj_ = EffectReferenceType.factory() 16213 obj_.build(child_) 16214 self.Effect_Reference.append(obj_)
16215 # end class Constituent_EffectsType 16216 16217
16218 -class Vulnerability_ExploitType(GeneratedsSuper):
16219 """This field refers to whether the vulnerability that is being 16220 exploited is known or unknown. Only known vulnerabilities will 16221 have an associated CPE identifier. Possible values: Known, 16222 Unknown.""" 16223 subclass = None 16224 superclass = None
16225 - def __init__(self, vulnerability_type=None, Known_Exploit=None):
16226 self.vulnerability_type = _cast(None, vulnerability_type) 16227 self.Known_Exploit = Known_Exploit
16228 - def factory(*args_, **kwargs_):
16229 if Vulnerability_ExploitType.subclass: 16230 return Vulnerability_ExploitType.subclass(*args_, **kwargs_) 16231 else: 16232 return Vulnerability_ExploitType(*args_, **kwargs_)
16233 factory = staticmethod(factory)
16234 - def get_Known_Exploit(self): return self.Known_Exploit
16235 - def set_Known_Exploit(self, Known_Exploit): self.Known_Exploit = Known_Exploit
16236 - def get_vulnerability_type(self): return self.vulnerability_type
16237 - def set_vulnerability_type(self, vulnerability_type): self.vulnerability_type = vulnerability_type
16238 - def export(self, outfile, level, namespace_='maec:', name_='Vulnerability_ExploitType', namespacedef_=''):
16239 showIndent(outfile, level) 16240 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16241 already_processed = [] 16242 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Vulnerability_ExploitType') 16243 if self.hasContent_(): 16244 outfile.write('>\n') 16245 self.exportChildren(outfile, level + 1, namespace_, name_) 16246 showIndent(outfile, level) 16247 outfile.write('</%s%s>\n' % (namespace_, name_)) 16248 else: 16249 outfile.write('/>\n')
16250 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Vulnerability_ExploitType'):
16251 if self.vulnerability_type is not None and 'vulnerability_type' not in already_processed: 16252 already_processed.append('vulnerability_type') 16253 outfile.write(' vulnerability_type=%s' % (self.gds_format_string(quote_attrib(self.vulnerability_type).encode(ExternalEncoding), input_name='vulnerability_type'), ))
16254 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Vulnerability_ExploitType', fromsubclass_=False):
16255 if self.Known_Exploit is not None: 16256 self.Known_Exploit.export(outfile, level, namespace_, name_='Known_Exploit', )
16257 - def hasContent_(self):
16258 if ( 16259 self.Known_Exploit is not None 16260 ): 16261 return True 16262 else: 16263 return False
16264 - def exportLiteral(self, outfile, level, name_='Vulnerability_ExploitType'):
16265 level += 1 16266 self.exportLiteralAttributes(outfile, level, [], name_) 16267 if self.hasContent_(): 16268 self.exportLiteralChildren(outfile, level, name_)
16269 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16270 if self.vulnerability_type is not None and 'vulnerability_type' not in already_processed: 16271 already_processed.append('vulnerability_type') 16272 showIndent(outfile, level) 16273 outfile.write('vulnerability_type = "%s",\n' % (self.vulnerability_type,))
16274 - def exportLiteralChildren(self, outfile, level, name_):
16275 if self.Known_Exploit is not None: 16276 showIndent(outfile, level) 16277 outfile.write('Known_Exploit=model_.CVEVulnerabilityType(\n') 16278 self.Known_Exploit.exportLiteral(outfile, level, name_='Known_Exploit') 16279 showIndent(outfile, level) 16280 outfile.write('),\n')
16281 - def build(self, node):
16282 self.buildAttributes(node, node.attrib, []) 16283 for child in node: 16284 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16285 self.buildChildren(child, node, nodeName_)
16286 - def buildAttributes(self, node, attrs, already_processed):
16287 value = find_attr_value_('vulnerability_type', node) 16288 if value is not None and 'vulnerability_type' not in already_processed: 16289 already_processed.append('vulnerability_type') 16290 self.vulnerability_type = value
16291 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16292 if nodeName_ == 'Known_Exploit': 16293 obj_ = CVEVulnerabilityType.factory() 16294 obj_.build(child_) 16295 self.set_Known_Exploit(obj_)
16296 # end class Vulnerability_ExploitType 16297 16298
16299 -class ImagesType(GeneratedsSuper):
16300 subclass = None 16301 superclass = None
16302 - def __init__(self, Image=None):
16303 if Image is None: 16304 self.Image = [] 16305 else: 16306 self.Image = Image
16307 - def factory(*args_, **kwargs_):
16308 if ImagesType.subclass: 16309 return ImagesType.subclass(*args_, **kwargs_) 16310 else: 16311 return ImagesType(*args_, **kwargs_)
16312 factory = staticmethod(factory)
16313 - def get_Image(self): return self.Image
16314 - def set_Image(self, Image): self.Image = Image
16315 - def add_Image(self, value): self.Image.append(value)
16316 - def insert_Image(self, index, value): self.Image[index] = value
16317 - def export(self, outfile, level, namespace_='maec:', name_='ImagesType', namespacedef_=''):
16318 showIndent(outfile, level) 16319 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16320 already_processed = [] 16321 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImagesType') 16322 if self.hasContent_(): 16323 outfile.write('>\n') 16324 self.exportChildren(outfile, level + 1, namespace_, name_) 16325 showIndent(outfile, level) 16326 outfile.write('</%s%s>\n' % (namespace_, name_)) 16327 else: 16328 outfile.write('/>\n')
16329 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImagesType'):
16330 pass
16331 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImagesType', fromsubclass_=False):
16332 for Image_ in self.Image: 16333 Image_.export(outfile, level, namespace_, name_='Image')
16334 - def hasContent_(self):
16335 if ( 16336 self.Image 16337 ): 16338 return True 16339 else: 16340 return False
16341 - def exportLiteral(self, outfile, level, name_='ImagesType'):
16342 level += 1 16343 self.exportLiteralAttributes(outfile, level, [], name_) 16344 if self.hasContent_(): 16345 self.exportLiteralChildren(outfile, level, name_)
16346 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16347 pass
16348 - def exportLiteralChildren(self, outfile, level, name_):
16349 showIndent(outfile, level) 16350 outfile.write('Image=[\n') 16351 level += 1 16352 for Image_ in self.Image: 16353 showIndent(outfile, level) 16354 outfile.write('model_.ImageType(\n') 16355 Image_.exportLiteral(outfile, level, name_='ImageType') 16356 showIndent(outfile, level) 16357 outfile.write('),\n') 16358 level -= 1 16359 showIndent(outfile, level) 16360 outfile.write('],\n')
16361 - def build(self, node):
16362 self.buildAttributes(node, node.attrib, []) 16363 for child in node: 16364 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16365 self.buildChildren(child, node, nodeName_)
16366 - def buildAttributes(self, node, attrs, already_processed):
16367 pass
16368 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16369 if nodeName_ == 'Image': 16370 obj_ = ImageType.factory() 16371 obj_.build(child_) 16372 self.Image.append(obj_)
16373 # end class ImagesType 16374 16375
16376 -class ImageType(GeneratedsSuper):
16377 subclass = None 16378 superclass = None
16379 - def __init__(self, Image_Location=None, Image_Title=None):
16380 self.Image_Location = Image_Location 16381 self.Image_Title = Image_Title
16382 - def factory(*args_, **kwargs_):
16383 if ImageType.subclass: 16384 return ImageType.subclass(*args_, **kwargs_) 16385 else: 16386 return ImageType(*args_, **kwargs_)
16387 factory = staticmethod(factory)
16388 - def get_Image_Location(self): return self.Image_Location
16389 - def set_Image_Location(self, Image_Location): self.Image_Location = Image_Location
16390 - def get_Image_Title(self): return self.Image_Title
16391 - def set_Image_Title(self, Image_Title): self.Image_Title = Image_Title
16392 - def export(self, outfile, level, namespace_='maec:', name_='ImageType', namespacedef_=''):
16393 showIndent(outfile, level) 16394 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16395 already_processed = [] 16396 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImageType') 16397 if self.hasContent_(): 16398 outfile.write('>\n') 16399 self.exportChildren(outfile, level + 1, namespace_, name_) 16400 showIndent(outfile, level) 16401 outfile.write('</%s%s>\n' % (namespace_, name_)) 16402 else: 16403 outfile.write('/>\n')
16404 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImageType'):
16405 pass
16406 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImageType', fromsubclass_=False):
16407 if self.Image_Location is not None: 16408 showIndent(outfile, level) 16409 outfile.write('<%sImage_Location>%s</%sImage_Location>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Location).encode(ExternalEncoding), input_name='Image_Location'), namespace_)) 16410 if self.Image_Title is not None: 16411 showIndent(outfile, level) 16412 outfile.write('<%sImage_Title>%s</%sImage_Title>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Title).encode(ExternalEncoding), input_name='Image_Title'), namespace_))
16413 - def hasContent_(self):
16414 if ( 16415 self.Image_Location is not None or 16416 self.Image_Title is not None 16417 ): 16418 return True 16419 else: 16420 return False
16421 - def exportLiteral(self, outfile, level, name_='ImageType'):
16422 level += 1 16423 self.exportLiteralAttributes(outfile, level, [], name_) 16424 if self.hasContent_(): 16425 self.exportLiteralChildren(outfile, level, name_)
16426 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16427 pass
16428 - def exportLiteralChildren(self, outfile, level, name_):
16429 if self.Image_Location is not None: 16430 showIndent(outfile, level) 16431 outfile.write('Image_Location=%s,\n' % quote_python(self.Image_Location).encode(ExternalEncoding)) 16432 if self.Image_Title is not None: 16433 showIndent(outfile, level) 16434 outfile.write('Image_Title=%s,\n' % quote_python(self.Image_Title).encode(ExternalEncoding))
16435 - def build(self, node):
16436 self.buildAttributes(node, node.attrib, []) 16437 for child in node: 16438 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16439 self.buildChildren(child, node, nodeName_)
16440 - def buildAttributes(self, node, attrs, already_processed):
16441 pass
16442 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16443 if nodeName_ == 'Image_Location': 16444 Image_Location_ = child_.text 16445 Image_Location_ = self.gds_validate_string(Image_Location_, node, 'Image_Location') 16446 self.Image_Location = Image_Location_ 16447 elif nodeName_ == 'Image_Title': 16448 Image_Title_ = child_.text 16449 Image_Title_ = self.gds_validate_string(Image_Title_, node, 'Image_Title') 16450 self.Image_Title = Image_Title_
16451 # end class ImageType 16452 16453
16454 -class ImagesType1(GeneratedsSuper):
16455 subclass = None 16456 superclass = None
16457 - def __init__(self, Image=None):
16458 if Image is None: 16459 self.Image = [] 16460 else: 16461 self.Image = Image
16462 - def factory(*args_, **kwargs_):
16463 if ImagesType1.subclass: 16464 return ImagesType1.subclass(*args_, **kwargs_) 16465 else: 16466 return ImagesType1(*args_, **kwargs_)
16467 factory = staticmethod(factory)
16468 - def get_Image(self): return self.Image
16469 - def set_Image(self, Image): self.Image = Image
16470 - def add_Image(self, value): self.Image.append(value)
16471 - def insert_Image(self, index, value): self.Image[index] = value
16472 - def export(self, outfile, level, namespace_='maec:', name_='ImagesType1', namespacedef_=''):
16473 showIndent(outfile, level) 16474 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16475 already_processed = [] 16476 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImagesType1') 16477 if self.hasContent_(): 16478 outfile.write('>\n') 16479 self.exportChildren(outfile, level + 1, namespace_, name_) 16480 showIndent(outfile, level) 16481 outfile.write('</%s%s>\n' % (namespace_, name_)) 16482 else: 16483 outfile.write('/>\n')
16484 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImagesType1'):
16485 pass
16486 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImagesType1', fromsubclass_=False):
16487 for Image_ in self.Image: 16488 Image_.export(outfile, level, namespace_, name_='Image')
16489 - def hasContent_(self):
16490 if ( 16491 self.Image 16492 ): 16493 return True 16494 else: 16495 return False
16496 - def exportLiteral(self, outfile, level, name_='ImagesType1'):
16497 level += 1 16498 self.exportLiteralAttributes(outfile, level, [], name_) 16499 if self.hasContent_(): 16500 self.exportLiteralChildren(outfile, level, name_)
16501 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16502 pass
16503 - def exportLiteralChildren(self, outfile, level, name_):
16504 showIndent(outfile, level) 16505 outfile.write('Image=[\n') 16506 level += 1 16507 for Image_ in self.Image: 16508 showIndent(outfile, level) 16509 outfile.write('model_.ImageType1(\n') 16510 Image_.exportLiteral(outfile, level, name_='ImageType1') 16511 showIndent(outfile, level) 16512 outfile.write('),\n') 16513 level -= 1 16514 showIndent(outfile, level) 16515 outfile.write('],\n')
16516 - def build(self, node):
16517 self.buildAttributes(node, node.attrib, []) 16518 for child in node: 16519 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16520 self.buildChildren(child, node, nodeName_)
16521 - def buildAttributes(self, node, attrs, already_processed):
16522 pass
16523 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16524 if nodeName_ == 'Image': 16525 obj_ = ImageType1.factory() 16526 obj_.build(child_) 16527 self.Image.append(obj_)
16528 # end class ImagesType1 16529 16530
16531 -class ImageType1(GeneratedsSuper):
16532 subclass = None 16533 superclass = None
16534 - def __init__(self, Image_Location=None, Image_Title=None):
16535 self.Image_Location = Image_Location 16536 self.Image_Title = Image_Title
16537 - def factory(*args_, **kwargs_):
16538 if ImageType1.subclass: 16539 return ImageType1.subclass(*args_, **kwargs_) 16540 else: 16541 return ImageType1(*args_, **kwargs_)
16542 factory = staticmethod(factory)
16543 - def get_Image_Location(self): return self.Image_Location
16544 - def set_Image_Location(self, Image_Location): self.Image_Location = Image_Location
16545 - def get_Image_Title(self): return self.Image_Title
16546 - def set_Image_Title(self, Image_Title): self.Image_Title = Image_Title
16547 - def export(self, outfile, level, namespace_='maec:', name_='ImageType1', namespacedef_=''):
16548 showIndent(outfile, level) 16549 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16550 already_processed = [] 16551 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImageType1') 16552 if self.hasContent_(): 16553 outfile.write('>\n') 16554 self.exportChildren(outfile, level + 1, namespace_, name_) 16555 showIndent(outfile, level) 16556 outfile.write('</%s%s>\n' % (namespace_, name_)) 16557 else: 16558 outfile.write('/>\n')
16559 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImageType1'):
16560 pass
16561 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImageType1', fromsubclass_=False):
16562 if self.Image_Location is not None: 16563 showIndent(outfile, level) 16564 outfile.write('<%sImage_Location>%s</%sImage_Location>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Location).encode(ExternalEncoding), input_name='Image_Location'), namespace_)) 16565 if self.Image_Title is not None: 16566 showIndent(outfile, level) 16567 outfile.write('<%sImage_Title>%s</%sImage_Title>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Title).encode(ExternalEncoding), input_name='Image_Title'), namespace_))
16568 - def hasContent_(self):
16569 if ( 16570 self.Image_Location is not None or 16571 self.Image_Title is not None 16572 ): 16573 return True 16574 else: 16575 return False
16576 - def exportLiteral(self, outfile, level, name_='ImageType1'):
16577 level += 1 16578 self.exportLiteralAttributes(outfile, level, [], name_) 16579 if self.hasContent_(): 16580 self.exportLiteralChildren(outfile, level, name_)
16581 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16582 pass
16583 - def exportLiteralChildren(self, outfile, level, name_):
16584 if self.Image_Location is not None: 16585 showIndent(outfile, level) 16586 outfile.write('Image_Location=%s,\n' % quote_python(self.Image_Location).encode(ExternalEncoding)) 16587 if self.Image_Title is not None: 16588 showIndent(outfile, level) 16589 outfile.write('Image_Title=%s,\n' % quote_python(self.Image_Title).encode(ExternalEncoding))
16590 - def build(self, node):
16591 self.buildAttributes(node, node.attrib, []) 16592 for child in node: 16593 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16594 self.buildChildren(child, node, nodeName_)
16595 - def buildAttributes(self, node, attrs, already_processed):
16596 pass
16597 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16598 if nodeName_ == 'Image_Location': 16599 Image_Location_ = child_.text 16600 Image_Location_ = self.gds_validate_string(Image_Location_, node, 'Image_Location') 16601 self.Image_Location = Image_Location_ 16602 elif nodeName_ == 'Image_Title': 16603 Image_Title_ = child_.text 16604 Image_Title_ = self.gds_validate_string(Image_Title_, node, 'Image_Title') 16605 self.Image_Title = Image_Title_
16606 # end class ImageType1 16607 16608
16609 -class ImagesType2(GeneratedsSuper):
16610 subclass = None 16611 superclass = None
16612 - def __init__(self, Image=None):
16613 if Image is None: 16614 self.Image = [] 16615 else: 16616 self.Image = Image
16617 - def factory(*args_, **kwargs_):
16618 if ImagesType2.subclass: 16619 return ImagesType2.subclass(*args_, **kwargs_) 16620 else: 16621 return ImagesType2(*args_, **kwargs_)
16622 factory = staticmethod(factory)
16623 - def get_Image(self): return self.Image
16624 - def set_Image(self, Image): self.Image = Image
16625 - def add_Image(self, value): self.Image.append(value)
16626 - def insert_Image(self, index, value): self.Image[index] = value
16627 - def export(self, outfile, level, namespace_='maec:', name_='ImagesType2', namespacedef_=''):
16628 showIndent(outfile, level) 16629 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16630 already_processed = [] 16631 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImagesType2') 16632 if self.hasContent_(): 16633 outfile.write('>\n') 16634 self.exportChildren(outfile, level + 1, namespace_, name_) 16635 showIndent(outfile, level) 16636 outfile.write('</%s%s>\n' % (namespace_, name_)) 16637 else: 16638 outfile.write('/>\n')
16639 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImagesType2'):
16640 pass
16641 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImagesType2', fromsubclass_=False):
16642 for Image_ in self.Image: 16643 Image_.export(outfile, level, namespace_, name_='Image')
16644 - def hasContent_(self):
16645 if ( 16646 self.Image 16647 ): 16648 return True 16649 else: 16650 return False
16651 - def exportLiteral(self, outfile, level, name_='ImagesType2'):
16652 level += 1 16653 self.exportLiteralAttributes(outfile, level, [], name_) 16654 if self.hasContent_(): 16655 self.exportLiteralChildren(outfile, level, name_)
16656 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16657 pass
16658 - def exportLiteralChildren(self, outfile, level, name_):
16659 showIndent(outfile, level) 16660 outfile.write('Image=[\n') 16661 level += 1 16662 for Image_ in self.Image: 16663 showIndent(outfile, level) 16664 outfile.write('model_.ImageType2(\n') 16665 Image_.exportLiteral(outfile, level, name_='ImageType2') 16666 showIndent(outfile, level) 16667 outfile.write('),\n') 16668 level -= 1 16669 showIndent(outfile, level) 16670 outfile.write('],\n')
16671 - def build(self, node):
16672 self.buildAttributes(node, node.attrib, []) 16673 for child in node: 16674 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16675 self.buildChildren(child, node, nodeName_)
16676 - def buildAttributes(self, node, attrs, already_processed):
16677 pass
16678 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16679 if nodeName_ == 'Image': 16680 obj_ = ImageType2.factory() 16681 obj_.build(child_) 16682 self.Image.append(obj_)
16683 # end class ImagesType2 16684 16685
16686 -class ImageType2(GeneratedsSuper):
16687 subclass = None 16688 superclass = None
16689 - def __init__(self, Image_Location=None, Image_Title=None):
16690 self.Image_Location = Image_Location 16691 self.Image_Title = Image_Title
16692 - def factory(*args_, **kwargs_):
16693 if ImageType2.subclass: 16694 return ImageType2.subclass(*args_, **kwargs_) 16695 else: 16696 return ImageType2(*args_, **kwargs_)
16697 factory = staticmethod(factory)
16698 - def get_Image_Location(self): return self.Image_Location
16699 - def set_Image_Location(self, Image_Location): self.Image_Location = Image_Location
16700 - def get_Image_Title(self): return self.Image_Title
16701 - def set_Image_Title(self, Image_Title): self.Image_Title = Image_Title
16702 - def export(self, outfile, level, namespace_='maec:', name_='ImageType2', namespacedef_=''):
16703 showIndent(outfile, level) 16704 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16705 already_processed = [] 16706 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImageType2') 16707 if self.hasContent_(): 16708 outfile.write('>\n') 16709 self.exportChildren(outfile, level + 1, namespace_, name_) 16710 showIndent(outfile, level) 16711 outfile.write('</%s%s>\n' % (namespace_, name_)) 16712 else: 16713 outfile.write('/>\n')
16714 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImageType2'):
16715 pass
16716 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImageType2', fromsubclass_=False):
16717 if self.Image_Location is not None: 16718 showIndent(outfile, level) 16719 outfile.write('<%sImage_Location>%s</%sImage_Location>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Location).encode(ExternalEncoding), input_name='Image_Location'), namespace_)) 16720 if self.Image_Title is not None: 16721 showIndent(outfile, level) 16722 outfile.write('<%sImage_Title>%s</%sImage_Title>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Title).encode(ExternalEncoding), input_name='Image_Title'), namespace_))
16723 - def hasContent_(self):
16724 if ( 16725 self.Image_Location is not None or 16726 self.Image_Title is not None 16727 ): 16728 return True 16729 else: 16730 return False
16731 - def exportLiteral(self, outfile, level, name_='ImageType2'):
16732 level += 1 16733 self.exportLiteralAttributes(outfile, level, [], name_) 16734 if self.hasContent_(): 16735 self.exportLiteralChildren(outfile, level, name_)
16736 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16737 pass
16738 - def exportLiteralChildren(self, outfile, level, name_):
16739 if self.Image_Location is not None: 16740 showIndent(outfile, level) 16741 outfile.write('Image_Location=%s,\n' % quote_python(self.Image_Location).encode(ExternalEncoding)) 16742 if self.Image_Title is not None: 16743 showIndent(outfile, level) 16744 outfile.write('Image_Title=%s,\n' % quote_python(self.Image_Title).encode(ExternalEncoding))
16745 - def build(self, node):
16746 self.buildAttributes(node, node.attrib, []) 16747 for child in node: 16748 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16749 self.buildChildren(child, node, nodeName_)
16750 - def buildAttributes(self, node, attrs, already_processed):
16751 pass
16752 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16753 if nodeName_ == 'Image_Location': 16754 Image_Location_ = child_.text 16755 Image_Location_ = self.gds_validate_string(Image_Location_, node, 'Image_Location') 16756 self.Image_Location = Image_Location_ 16757 elif nodeName_ == 'Image_Title': 16758 Image_Title_ = child_.text 16759 Image_Title_ = self.gds_validate_string(Image_Title_, node, 'Image_Title') 16760 self.Image_Title = Image_Title_
16761 # end class ImageType2 16762 16763
16764 -class File_System_Action_AttributesType(GeneratedsSuper):
16765 subclass = None 16766 superclass = None
16767 - def __init__(self, Existing_File_Name=None, Destination_File_Name=None, Access_Mode=None, Flags=None, Open_Mode=None, File_Attributes=None):
16768 self.Existing_File_Name = Existing_File_Name 16769 self.Destination_File_Name = Destination_File_Name 16770 self.Access_Mode = Access_Mode 16771 self.Flags = Flags 16772 self.Open_Mode = Open_Mode 16773 self.File_Attributes = File_Attributes
16774 - def factory(*args_, **kwargs_):
16775 if File_System_Action_AttributesType.subclass: 16776 return File_System_Action_AttributesType.subclass(*args_, **kwargs_) 16777 else: 16778 return File_System_Action_AttributesType(*args_, **kwargs_)
16779 factory = staticmethod(factory)
16780 - def get_Existing_File_Name(self): return self.Existing_File_Name
16781 - def set_Existing_File_Name(self, Existing_File_Name): self.Existing_File_Name = Existing_File_Name
16782 - def get_Destination_File_Name(self): return self.Destination_File_Name
16783 - def set_Destination_File_Name(self, Destination_File_Name): self.Destination_File_Name = Destination_File_Name
16784 - def get_Access_Mode(self): return self.Access_Mode
16785 - def set_Access_Mode(self, Access_Mode): self.Access_Mode = Access_Mode
16786 - def get_Flags(self): return self.Flags
16787 - def set_Flags(self, Flags): self.Flags = Flags
16788 - def get_Open_Mode(self): return self.Open_Mode
16789 - def set_Open_Mode(self, Open_Mode): self.Open_Mode = Open_Mode
16790 - def get_File_Attributes(self): return self.File_Attributes
16791 - def set_File_Attributes(self, File_Attributes): self.File_Attributes = File_Attributes
16792 - def export(self, outfile, level, namespace_='maec:', name_='File_System_Action_AttributesType', namespacedef_=''):
16793 showIndent(outfile, level) 16794 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16795 already_processed = [] 16796 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_System_Action_AttributesType') 16797 if self.hasContent_(): 16798 outfile.write('>\n') 16799 self.exportChildren(outfile, level + 1, namespace_, name_) 16800 showIndent(outfile, level) 16801 outfile.write('</%s%s>\n' % (namespace_, name_)) 16802 else: 16803 outfile.write('/>\n')
16804 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_System_Action_AttributesType'):
16805 pass
16806 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_System_Action_AttributesType', fromsubclass_=False):
16807 if self.Existing_File_Name is not None: 16808 showIndent(outfile, level) 16809 outfile.write('<%sExisting_File_Name>%s</%sExisting_File_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Existing_File_Name).encode(ExternalEncoding), input_name='Existing_File_Name'), namespace_)) 16810 if self.Destination_File_Name is not None: 16811 showIndent(outfile, level) 16812 outfile.write('<%sDestination_File_Name>%s</%sDestination_File_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Destination_File_Name).encode(ExternalEncoding), input_name='Destination_File_Name'), namespace_)) 16813 if self.Access_Mode is not None: 16814 showIndent(outfile, level) 16815 outfile.write('<%sAccess_Mode>%s</%sAccess_Mode>\n' % (namespace_, self.gds_format_string(quote_xml(self.Access_Mode).encode(ExternalEncoding), input_name='Access_Mode'), namespace_)) 16816 if self.Flags is not None: 16817 showIndent(outfile, level) 16818 outfile.write('<%sFlags>%s</%sFlags>\n' % (namespace_, self.gds_format_string(quote_xml(self.Flags).encode(ExternalEncoding), input_name='Flags'), namespace_)) 16819 if self.Open_Mode is not None: 16820 showIndent(outfile, level) 16821 outfile.write('<%sOpen_Mode>%s</%sOpen_Mode>\n' % (namespace_, self.gds_format_string(quote_xml(self.Open_Mode).encode(ExternalEncoding), input_name='Open_Mode'), namespace_)) 16822 if self.File_Attributes is not None: 16823 showIndent(outfile, level) 16824 outfile.write('<%sFile_Attributes>%s</%sFile_Attributes>\n' % (namespace_, self.gds_format_string(quote_xml(self.File_Attributes).encode(ExternalEncoding), input_name='File_Attributes'), namespace_))
16825 - def hasContent_(self):
16826 if ( 16827 self.Existing_File_Name is not None or 16828 self.Destination_File_Name is not None or 16829 self.Access_Mode is not None or 16830 self.Flags is not None or 16831 self.Open_Mode is not None or 16832 self.File_Attributes is not None 16833 ): 16834 return True 16835 else: 16836 return False
16837 - def exportLiteral(self, outfile, level, name_='File_System_Action_AttributesType'):
16838 level += 1 16839 self.exportLiteralAttributes(outfile, level, [], name_) 16840 if self.hasContent_(): 16841 self.exportLiteralChildren(outfile, level, name_)
16842 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16843 pass
16844 - def exportLiteralChildren(self, outfile, level, name_):
16845 if self.Existing_File_Name is not None: 16846 showIndent(outfile, level) 16847 outfile.write('Existing_File_Name=%s,\n' % quote_python(self.Existing_File_Name).encode(ExternalEncoding)) 16848 if self.Destination_File_Name is not None: 16849 showIndent(outfile, level) 16850 outfile.write('Destination_File_Name=%s,\n' % quote_python(self.Destination_File_Name).encode(ExternalEncoding)) 16851 if self.Access_Mode is not None: 16852 showIndent(outfile, level) 16853 outfile.write('Access_Mode=%s,\n' % quote_python(self.Access_Mode).encode(ExternalEncoding)) 16854 if self.Flags is not None: 16855 showIndent(outfile, level) 16856 outfile.write('Flags=%s,\n' % quote_python(self.Flags).encode(ExternalEncoding)) 16857 if self.Open_Mode is not None: 16858 showIndent(outfile, level) 16859 outfile.write('Open_Mode=%s,\n' % quote_python(self.Open_Mode).encode(ExternalEncoding)) 16860 if self.File_Attributes is not None: 16861 showIndent(outfile, level) 16862 outfile.write('File_Attributes=%s,\n' % quote_python(self.File_Attributes).encode(ExternalEncoding))
16863 - def build(self, node):
16864 self.buildAttributes(node, node.attrib, []) 16865 for child in node: 16866 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16867 self.buildChildren(child, node, nodeName_)
16868 - def buildAttributes(self, node, attrs, already_processed):
16869 pass
16870 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16871 if nodeName_ == 'Existing_File_Name': 16872 Existing_File_Name_ = child_.text 16873 Existing_File_Name_ = self.gds_validate_string(Existing_File_Name_, node, 'Existing_File_Name') 16874 self.Existing_File_Name = Existing_File_Name_ 16875 elif nodeName_ == 'Destination_File_Name': 16876 Destination_File_Name_ = child_.text 16877 Destination_File_Name_ = self.gds_validate_string(Destination_File_Name_, node, 'Destination_File_Name') 16878 self.Destination_File_Name = Destination_File_Name_ 16879 elif nodeName_ == 'Access_Mode': 16880 Access_Mode_ = child_.text 16881 Access_Mode_ = self.gds_validate_string(Access_Mode_, node, 'Access_Mode') 16882 self.Access_Mode = Access_Mode_ 16883 elif nodeName_ == 'Flags': 16884 Flags_ = child_.text 16885 Flags_ = self.gds_validate_string(Flags_, node, 'Flags') 16886 self.Flags = Flags_ 16887 elif nodeName_ == 'Open_Mode': 16888 Open_Mode_ = child_.text 16889 Open_Mode_ = self.gds_validate_string(Open_Mode_, node, 'Open_Mode') 16890 self.Open_Mode = Open_Mode_ 16891 elif nodeName_ == 'File_Attributes': 16892 File_Attributes_ = child_.text 16893 File_Attributes_ = self.gds_validate_string(File_Attributes_, node, 'File_Attributes') 16894 self.File_Attributes = File_Attributes_
16895 # end class File_System_Action_AttributesType 16896 16897
16898 -class IPC_Action_AttributesType(GeneratedsSuper):
16899 subclass = None 16900 superclass = None
16901 - def __init__(self, Initial_Owner=None, Thread_ID=None, Target_PID=None, Start_Address=None):
16902 self.Initial_Owner = Initial_Owner 16903 self.Thread_ID = Thread_ID 16904 self.Target_PID = Target_PID 16905 self.Start_Address = Start_Address
16906 - def factory(*args_, **kwargs_):
16907 if IPC_Action_AttributesType.subclass: 16908 return IPC_Action_AttributesType.subclass(*args_, **kwargs_) 16909 else: 16910 return IPC_Action_AttributesType(*args_, **kwargs_)
16911 factory = staticmethod(factory)
16912 - def get_Initial_Owner(self): return self.Initial_Owner
16913 - def set_Initial_Owner(self, Initial_Owner): self.Initial_Owner = Initial_Owner
16914 - def get_Thread_ID(self): return self.Thread_ID
16915 - def set_Thread_ID(self, Thread_ID): self.Thread_ID = Thread_ID
16916 - def get_Target_PID(self): return self.Target_PID
16917 - def set_Target_PID(self, Target_PID): self.Target_PID = Target_PID
16918 - def get_Start_Address(self): return self.Start_Address
16919 - def set_Start_Address(self, Start_Address): self.Start_Address = Start_Address
16920 - def export(self, outfile, level, namespace_='maec:', name_='IPC_Action_AttributesType', namespacedef_=''):
16921 showIndent(outfile, level) 16922 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 16923 already_processed = [] 16924 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IPC_Action_AttributesType') 16925 if self.hasContent_(): 16926 outfile.write('>\n') 16927 self.exportChildren(outfile, level + 1, namespace_, name_) 16928 showIndent(outfile, level) 16929 outfile.write('</%s%s>\n' % (namespace_, name_)) 16930 else: 16931 outfile.write('/>\n')
16932 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='IPC_Action_AttributesType'):
16933 pass
16934 - def exportChildren(self, outfile, level, namespace_='maec:', name_='IPC_Action_AttributesType', fromsubclass_=False):
16935 if self.Initial_Owner is not None: 16936 showIndent(outfile, level) 16937 outfile.write('<%sInitial_Owner>%s</%sInitial_Owner>\n' % (namespace_, self.gds_format_string(quote_xml(self.Initial_Owner).encode(ExternalEncoding), input_name='Initial_Owner'), namespace_)) 16938 if self.Thread_ID is not None: 16939 showIndent(outfile, level) 16940 outfile.write('<%sThread_ID>%s</%sThread_ID>\n' % (namespace_, self.gds_format_integer(self.Thread_ID, input_name='Thread_ID'), namespace_)) 16941 if self.Target_PID is not None: 16942 showIndent(outfile, level) 16943 outfile.write('<%sTarget_PID>%s</%sTarget_PID>\n' % (namespace_, self.gds_format_integer(self.Target_PID, input_name='Target_PID'), namespace_)) 16944 if self.Start_Address is not None: 16945 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
16946 - def hasContent_(self):
16947 if ( 16948 self.Initial_Owner is not None or 16949 self.Thread_ID is not None or 16950 self.Target_PID is not None or 16951 self.Start_Address is not None 16952 ): 16953 return True 16954 else: 16955 return False
16956 - def exportLiteral(self, outfile, level, name_='IPC_Action_AttributesType'):
16957 level += 1 16958 self.exportLiteralAttributes(outfile, level, [], name_) 16959 if self.hasContent_(): 16960 self.exportLiteralChildren(outfile, level, name_)
16961 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
16962 pass
16963 - def exportLiteralChildren(self, outfile, level, name_):
16964 if self.Initial_Owner is not None: 16965 showIndent(outfile, level) 16966 outfile.write('Initial_Owner=%s,\n' % quote_python(self.Initial_Owner).encode(ExternalEncoding)) 16967 if self.Thread_ID is not None: 16968 showIndent(outfile, level) 16969 outfile.write('Thread_ID=%d,\n' % self.Thread_ID) 16970 if self.Target_PID is not None: 16971 showIndent(outfile, level) 16972 outfile.write('Target_PID=%d,\n' % self.Target_PID) 16973 if self.Start_Address is not None: 16974 showIndent(outfile, level) 16975 outfile.write('Start_Address=model_.xs_hexBinary(\n') 16976 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address') 16977 showIndent(outfile, level) 16978 outfile.write('),\n')
16979 - def build(self, node):
16980 self.buildAttributes(node, node.attrib, []) 16981 for child in node: 16982 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 16983 self.buildChildren(child, node, nodeName_)
16984 - def buildAttributes(self, node, attrs, already_processed):
16985 pass
16986 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16987 if nodeName_ == 'Initial_Owner': 16988 Initial_Owner_ = child_.text 16989 Initial_Owner_ = self.gds_validate_string(Initial_Owner_, node, 'Initial_Owner') 16990 self.Initial_Owner = Initial_Owner_ 16991 elif nodeName_ == 'Thread_ID': 16992 sval_ = child_.text 16993 try: 16994 ival_ = int(sval_) 16995 except (TypeError, ValueError) as e: 16996 raise_parse_error(child_, 'requires integer: %s' % e) 16997 ival_ = self.gds_validate_integer(ival_, node, 'Thread_ID') 16998 self.Thread_ID = ival_ 16999 elif nodeName_ == 'Target_PID': 17000 sval_ = child_.text 17001 try: 17002 ival_ = int(sval_) 17003 except (TypeError, ValueError) as e: 17004 raise_parse_error(child_, 'requires integer: %s' % e) 17005 ival_ = self.gds_validate_integer(ival_, node, 'Target_PID') 17006 self.Target_PID = ival_ 17007 elif nodeName_ == 'Start_Address': 17008 obj_ = xs_hexBinary.factory() 17009 obj_.build(child_) 17010 self.set_Start_Address(obj_)
17011 # end class IPC_Action_AttributesType 17012 17013
17014 -class Process_Action_AttributesType(GeneratedsSuper):
17015 subclass = None 17016 superclass = None
17017 - def __init__(self, Process_Base_Address=None, Thread_ID=None, Start_Address=None, Creation_Flags=None, User_Name=None, Target_PID=None):
17018 self.Process_Base_Address = Process_Base_Address 17019 self.Thread_ID = Thread_ID 17020 self.Start_Address = Start_Address 17021 self.Creation_Flags = Creation_Flags 17022 self.User_Name = User_Name 17023 self.Target_PID = Target_PID
17024 - def factory(*args_, **kwargs_):
17025 if Process_Action_AttributesType.subclass: 17026 return Process_Action_AttributesType.subclass(*args_, **kwargs_) 17027 else: 17028 return Process_Action_AttributesType(*args_, **kwargs_)
17029 factory = staticmethod(factory)
17030 - def get_Process_Base_Address(self): return self.Process_Base_Address
17031 - def set_Process_Base_Address(self, Process_Base_Address): self.Process_Base_Address = Process_Base_Address
17032 - def get_Thread_ID(self): return self.Thread_ID
17033 - def set_Thread_ID(self, Thread_ID): self.Thread_ID = Thread_ID
17034 - def get_Start_Address(self): return self.Start_Address
17035 - def set_Start_Address(self, Start_Address): self.Start_Address = Start_Address
17036 - def get_Creation_Flags(self): return self.Creation_Flags
17037 - def set_Creation_Flags(self, Creation_Flags): self.Creation_Flags = Creation_Flags
17038 - def get_User_Name(self): return self.User_Name
17039 - def set_User_Name(self, User_Name): self.User_Name = User_Name
17040 - def get_Target_PID(self): return self.Target_PID
17041 - def set_Target_PID(self, Target_PID): self.Target_PID = Target_PID
17042 - def export(self, outfile, level, namespace_='maec:', name_='Process_Action_AttributesType', namespacedef_=''):
17043 showIndent(outfile, level) 17044 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17045 already_processed = [] 17046 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Process_Action_AttributesType') 17047 if self.hasContent_(): 17048 outfile.write('>\n') 17049 self.exportChildren(outfile, level + 1, namespace_, name_) 17050 showIndent(outfile, level) 17051 outfile.write('</%s%s>\n' % (namespace_, name_)) 17052 else: 17053 outfile.write('/>\n')
17054 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Process_Action_AttributesType'):
17055 pass
17056 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Process_Action_AttributesType', fromsubclass_=False):
17057 if self.Process_Base_Address is not None: 17058 self.Process_Base_Address.export(outfile, level, namespace_, name_='Process_Base_Address') 17059 if self.Thread_ID is not None: 17060 showIndent(outfile, level) 17061 outfile.write('<%sThread_ID>%s</%sThread_ID>\n' % (namespace_, self.gds_format_string(quote_xml(self.Thread_ID).encode(ExternalEncoding), input_name='Thread_ID'), namespace_)) 17062 if self.Start_Address is not None: 17063 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address') 17064 if self.Creation_Flags is not None: 17065 showIndent(outfile, level) 17066 outfile.write('<%sCreation_Flags>%s</%sCreation_Flags>\n' % (namespace_, self.gds_format_string(quote_xml(self.Creation_Flags).encode(ExternalEncoding), input_name='Creation_Flags'), namespace_)) 17067 if self.User_Name is not None: 17068 showIndent(outfile, level) 17069 outfile.write('<%sUser_Name>%s</%sUser_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.User_Name).encode(ExternalEncoding), input_name='User_Name'), namespace_)) 17070 if self.Target_PID is not None: 17071 showIndent(outfile, level) 17072 outfile.write('<%sTarget_PID>%s</%sTarget_PID>\n' % (namespace_, self.gds_format_integer(self.Target_PID, input_name='Target_PID'), namespace_))
17073 - def hasContent_(self):
17074 if ( 17075 self.Process_Base_Address is not None or 17076 self.Thread_ID is not None or 17077 self.Start_Address is not None or 17078 self.Creation_Flags is not None or 17079 self.User_Name is not None or 17080 self.Target_PID is not None 17081 ): 17082 return True 17083 else: 17084 return False
17085 - def exportLiteral(self, outfile, level, name_='Process_Action_AttributesType'):
17086 level += 1 17087 self.exportLiteralAttributes(outfile, level, [], name_) 17088 if self.hasContent_(): 17089 self.exportLiteralChildren(outfile, level, name_)
17090 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17091 pass
17092 - def exportLiteralChildren(self, outfile, level, name_):
17093 if self.Process_Base_Address is not None: 17094 showIndent(outfile, level) 17095 outfile.write('Process_Base_Address=model_.xs_hexBinary(\n') 17096 self.Process_Base_Address.exportLiteral(outfile, level, name_='Process_Base_Address') 17097 showIndent(outfile, level) 17098 outfile.write('),\n') 17099 if self.Thread_ID is not None: 17100 showIndent(outfile, level) 17101 outfile.write('Thread_ID=%s,\n' % quote_python(self.Thread_ID).encode(ExternalEncoding)) 17102 if self.Start_Address is not None: 17103 showIndent(outfile, level) 17104 outfile.write('Start_Address=model_.xs_hexBinary(\n') 17105 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address') 17106 showIndent(outfile, level) 17107 outfile.write('),\n') 17108 if self.Creation_Flags is not None: 17109 showIndent(outfile, level) 17110 outfile.write('Creation_Flags=%s,\n' % quote_python(self.Creation_Flags).encode(ExternalEncoding)) 17111 if self.User_Name is not None: 17112 showIndent(outfile, level) 17113 outfile.write('User_Name=%s,\n' % quote_python(self.User_Name).encode(ExternalEncoding)) 17114 if self.Target_PID is not None: 17115 showIndent(outfile, level) 17116 outfile.write('Target_PID=%d,\n' % self.Target_PID)
17117 - def build(self, node):
17118 self.buildAttributes(node, node.attrib, []) 17119 for child in node: 17120 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17121 self.buildChildren(child, node, nodeName_)
17122 - def buildAttributes(self, node, attrs, already_processed):
17123 pass
17124 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17125 if nodeName_ == 'Process_Base_Address': 17126 obj_ = xs_hexBinary.factory() 17127 obj_.build(child_) 17128 self.set_Process_Base_Address(obj_) 17129 elif nodeName_ == 'Thread_ID': 17130 Thread_ID_ = child_.text 17131 Thread_ID_ = self.gds_validate_string(Thread_ID_, node, 'Thread_ID') 17132 self.Thread_ID = Thread_ID_ 17133 elif nodeName_ == 'Start_Address': 17134 obj_ = xs_hexBinary.factory() 17135 obj_.build(child_) 17136 self.set_Start_Address(obj_) 17137 elif nodeName_ == 'Creation_Flags': 17138 Creation_Flags_ = child_.text 17139 Creation_Flags_ = self.gds_validate_string(Creation_Flags_, node, 'Creation_Flags') 17140 self.Creation_Flags = Creation_Flags_ 17141 elif nodeName_ == 'User_Name': 17142 User_Name_ = child_.text 17143 User_Name_ = self.gds_validate_string(User_Name_, node, 'User_Name') 17144 self.User_Name = User_Name_ 17145 elif nodeName_ == 'Target_PID': 17146 sval_ = child_.text 17147 try: 17148 ival_ = int(sval_) 17149 except (TypeError, ValueError) as e: 17150 raise_parse_error(child_, 'requires integer: %s' % e) 17151 ival_ = self.gds_validate_integer(ival_, node, 'Target_PID') 17152 self.Target_PID = ival_
17153 # end class Process_Action_AttributesType 17154 17155
17156 -class Memory_Action_AttributesType(GeneratedsSuper):
17157 subclass = None 17158 superclass = None
17159 - def __init__(self, Start_Address=None, Source_Address=None, Destination_Address=None, Page_Base_Address=None, Target_PID=None, Requested_Address=None):
17160 self.Start_Address = Start_Address 17161 self.Source_Address = Source_Address 17162 self.Destination_Address = Destination_Address 17163 self.Page_Base_Address = Page_Base_Address 17164 self.Target_PID = Target_PID 17165 self.Requested_Address = Requested_Address
17166 - def factory(*args_, **kwargs_):
17167 if Memory_Action_AttributesType.subclass: 17168 return Memory_Action_AttributesType.subclass(*args_, **kwargs_) 17169 else: 17170 return Memory_Action_AttributesType(*args_, **kwargs_)
17171 factory = staticmethod(factory)
17172 - def get_Start_Address(self): return self.Start_Address
17173 - def set_Start_Address(self, Start_Address): self.Start_Address = Start_Address
17174 - def get_Source_Address(self): return self.Source_Address
17175 - def set_Source_Address(self, Source_Address): self.Source_Address = Source_Address
17176 - def get_Destination_Address(self): return self.Destination_Address
17177 - def set_Destination_Address(self, Destination_Address): self.Destination_Address = Destination_Address
17178 - def get_Page_Base_Address(self): return self.Page_Base_Address
17179 - def set_Page_Base_Address(self, Page_Base_Address): self.Page_Base_Address = Page_Base_Address
17180 - def get_Target_PID(self): return self.Target_PID
17181 - def set_Target_PID(self, Target_PID): self.Target_PID = Target_PID
17182 - def get_Requested_Address(self): return self.Requested_Address
17183 - def set_Requested_Address(self, Requested_Address): self.Requested_Address = Requested_Address
17184 - def export(self, outfile, level, namespace_='maec:', name_='Memory_Action_AttributesType', namespacedef_=''):
17185 showIndent(outfile, level) 17186 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17187 already_processed = [] 17188 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Memory_Action_AttributesType') 17189 if self.hasContent_(): 17190 outfile.write('>\n') 17191 self.exportChildren(outfile, level + 1, namespace_, name_) 17192 showIndent(outfile, level) 17193 outfile.write('</%s%s>\n' % (namespace_, name_)) 17194 else: 17195 outfile.write('/>\n')
17196 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Memory_Action_AttributesType'):
17197 pass
17198 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Memory_Action_AttributesType', fromsubclass_=False):
17199 if self.Start_Address is not None: 17200 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address') 17201 if self.Source_Address is not None: 17202 self.Source_Address.export(outfile, level, namespace_, name_='Source_Address') 17203 if self.Destination_Address is not None: 17204 self.Destination_Address.export(outfile, level, namespace_, name_='Destination_Address') 17205 if self.Page_Base_Address is not None: 17206 self.Page_Base_Address.export(outfile, level, namespace_, name_='Page_Base_Address') 17207 if self.Target_PID is not None: 17208 showIndent(outfile, level) 17209 outfile.write('<%sTarget_PID>%s</%sTarget_PID>\n' % (namespace_, self.gds_format_integer(self.Target_PID, input_name='Target_PID'), namespace_)) 17210 if self.Requested_Address is not None: 17211 self.Requested_Address.export(outfile, level, namespace_, name_='Requested_Address')
17212 - def hasContent_(self):
17213 if ( 17214 self.Start_Address is not None or 17215 self.Source_Address is not None or 17216 self.Destination_Address is not None or 17217 self.Page_Base_Address is not None or 17218 self.Target_PID is not None or 17219 self.Requested_Address is not None 17220 ): 17221 return True 17222 else: 17223 return False
17224 - def exportLiteral(self, outfile, level, name_='Memory_Action_AttributesType'):
17225 level += 1 17226 self.exportLiteralAttributes(outfile, level, [], name_) 17227 if self.hasContent_(): 17228 self.exportLiteralChildren(outfile, level, name_)
17229 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17230 pass
17231 - def exportLiteralChildren(self, outfile, level, name_):
17232 if self.Start_Address is not None: 17233 showIndent(outfile, level) 17234 outfile.write('Start_Address=model_.xs_hexBinary(\n') 17235 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address') 17236 showIndent(outfile, level) 17237 outfile.write('),\n') 17238 if self.Source_Address is not None: 17239 showIndent(outfile, level) 17240 outfile.write('Source_Address=model_.xs_hexBinary(\n') 17241 self.Source_Address.exportLiteral(outfile, level, name_='Source_Address') 17242 showIndent(outfile, level) 17243 outfile.write('),\n') 17244 if self.Destination_Address is not None: 17245 showIndent(outfile, level) 17246 outfile.write('Destination_Address=model_.xs_hexBinary(\n') 17247 self.Destination_Address.exportLiteral(outfile, level, name_='Destination_Address') 17248 showIndent(outfile, level) 17249 outfile.write('),\n') 17250 if self.Page_Base_Address is not None: 17251 showIndent(outfile, level) 17252 outfile.write('Page_Base_Address=model_.xs_hexBinary(\n') 17253 self.Page_Base_Address.exportLiteral(outfile, level, name_='Page_Base_Address') 17254 showIndent(outfile, level) 17255 outfile.write('),\n') 17256 if self.Target_PID is not None: 17257 showIndent(outfile, level) 17258 outfile.write('Target_PID=%d,\n' % self.Target_PID) 17259 if self.Requested_Address is not None: 17260 showIndent(outfile, level) 17261 outfile.write('Requested_Address=model_.xs_hexBinary(\n') 17262 self.Requested_Address.exportLiteral(outfile, level, name_='Requested_Address') 17263 showIndent(outfile, level) 17264 outfile.write('),\n')
17265 - def build(self, node):
17266 self.buildAttributes(node, node.attrib, []) 17267 for child in node: 17268 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17269 self.buildChildren(child, node, nodeName_)
17270 - def buildAttributes(self, node, attrs, already_processed):
17271 pass
17272 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17273 if nodeName_ == 'Start_Address': 17274 obj_ = xs_hexBinary.factory() 17275 obj_.build(child_) 17276 self.set_Start_Address(obj_) 17277 elif nodeName_ == 'Source_Address': 17278 obj_ = xs_hexBinary.factory() 17279 obj_.build(child_) 17280 self.set_Source_Address(obj_) 17281 elif nodeName_ == 'Destination_Address': 17282 obj_ = xs_hexBinary.factory() 17283 obj_.build(child_) 17284 self.set_Destination_Address(obj_) 17285 elif nodeName_ == 'Page_Base_Address': 17286 obj_ = xs_hexBinary.factory() 17287 obj_.build(child_) 17288 self.set_Page_Base_Address(obj_) 17289 elif nodeName_ == 'Target_PID': 17290 sval_ = child_.text 17291 try: 17292 ival_ = int(sval_) 17293 except (TypeError, ValueError) as e: 17294 raise_parse_error(child_, 'requires integer: %s' % e) 17295 ival_ = self.gds_validate_integer(ival_, node, 'Target_PID') 17296 self.Target_PID = ival_ 17297 elif nodeName_ == 'Requested_Address': 17298 obj_ = xs_hexBinary.factory() 17299 obj_.build(child_) 17300 self.set_Requested_Address(obj_)
17301 # end class Memory_Action_AttributesType 17302 17303
17304 -class Registry_Action_AttributesType(GeneratedsSuper):
17305 subclass = None 17306 superclass = None
17307 - def __init__(self, Enumerated_Subkeys=None, Enumerated_Values=None):
17308 self.Enumerated_Subkeys = Enumerated_Subkeys 17309 self.Enumerated_Values = Enumerated_Values
17310 - def factory(*args_, **kwargs_):
17311 if Registry_Action_AttributesType.subclass: 17312 return Registry_Action_AttributesType.subclass(*args_, **kwargs_) 17313 else: 17314 return Registry_Action_AttributesType(*args_, **kwargs_)
17315 factory = staticmethod(factory)
17316 - def get_Enumerated_Subkeys(self): return self.Enumerated_Subkeys
17317 - def set_Enumerated_Subkeys(self, Enumerated_Subkeys): self.Enumerated_Subkeys = Enumerated_Subkeys
17318 - def get_Enumerated_Values(self): return self.Enumerated_Values
17319 - def set_Enumerated_Values(self, Enumerated_Values): self.Enumerated_Values = Enumerated_Values
17320 - def export(self, outfile, level, namespace_='maec:', name_='Registry_Action_AttributesType', namespacedef_=''):
17321 showIndent(outfile, level) 17322 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17323 already_processed = [] 17324 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Registry_Action_AttributesType') 17325 if self.hasContent_(): 17326 outfile.write('>\n') 17327 self.exportChildren(outfile, level + 1, namespace_, name_) 17328 showIndent(outfile, level) 17329 outfile.write('</%s%s>\n' % (namespace_, name_)) 17330 else: 17331 outfile.write('/>\n')
17332 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Registry_Action_AttributesType'):
17333 pass
17334 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Registry_Action_AttributesType', fromsubclass_=False):
17335 if self.Enumerated_Subkeys is not None: 17336 showIndent(outfile, level) 17337 outfile.write('<%sEnumerated_Subkeys>%s</%sEnumerated_Subkeys>\n' % (namespace_, self.gds_format_string(quote_xml(self.Enumerated_Subkeys).encode(ExternalEncoding), input_name='Enumerated_Subkeys'), namespace_)) 17338 if self.Enumerated_Values is not None: 17339 showIndent(outfile, level) 17340 outfile.write('<%sEnumerated_Values>%s</%sEnumerated_Values>\n' % (namespace_, self.gds_format_string(quote_xml(self.Enumerated_Values).encode(ExternalEncoding), input_name='Enumerated_Values'), namespace_))
17341 - def hasContent_(self):
17342 if ( 17343 self.Enumerated_Subkeys is not None or 17344 self.Enumerated_Values is not None 17345 ): 17346 return True 17347 else: 17348 return False
17349 - def exportLiteral(self, outfile, level, name_='Registry_Action_AttributesType'):
17350 level += 1 17351 self.exportLiteralAttributes(outfile, level, [], name_) 17352 if self.hasContent_(): 17353 self.exportLiteralChildren(outfile, level, name_)
17354 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17355 pass
17356 - def exportLiteralChildren(self, outfile, level, name_):
17357 if self.Enumerated_Subkeys is not None: 17358 showIndent(outfile, level) 17359 outfile.write('Enumerated_Subkeys=%s,\n' % quote_python(self.Enumerated_Subkeys).encode(ExternalEncoding)) 17360 if self.Enumerated_Values is not None: 17361 showIndent(outfile, level) 17362 outfile.write('Enumerated_Values=%s,\n' % quote_python(self.Enumerated_Values).encode(ExternalEncoding))
17363 - def build(self, node):
17364 self.buildAttributes(node, node.attrib, []) 17365 for child in node: 17366 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17367 self.buildChildren(child, node, nodeName_)
17368 - def buildAttributes(self, node, attrs, already_processed):
17369 pass
17370 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17371 if nodeName_ == 'Enumerated_Subkeys': 17372 Enumerated_Subkeys_ = child_.text 17373 Enumerated_Subkeys_ = self.gds_validate_string(Enumerated_Subkeys_, node, 'Enumerated_Subkeys') 17374 self.Enumerated_Subkeys = Enumerated_Subkeys_ 17375 elif nodeName_ == 'Enumerated_Values': 17376 Enumerated_Values_ = child_.text 17377 Enumerated_Values_ = self.gds_validate_string(Enumerated_Values_, node, 'Enumerated_Values') 17378 self.Enumerated_Values = Enumerated_Values_
17379 # end class Registry_Action_AttributesType 17380 17381
17382 -class Network_Action_AttributesType(GeneratedsSuper):
17383 subclass = None 17384 superclass = None
17385 - def __init__(self, Internal_Port=None, External_Port=None, Internal_IP_Address=None, External_IP_Address=None, Host_Name=None, Data_Sent=None, Data_Received=None, Buffer_Length=None):
17386 self.Internal_Port = Internal_Port 17387 self.External_Port = External_Port 17388 self.Internal_IP_Address = Internal_IP_Address 17389 self.External_IP_Address = External_IP_Address 17390 self.Host_Name = Host_Name 17391 self.Data_Sent = Data_Sent 17392 self.Data_Received = Data_Received 17393 self.Buffer_Length = Buffer_Length
17394 - def factory(*args_, **kwargs_):
17395 if Network_Action_AttributesType.subclass: 17396 return Network_Action_AttributesType.subclass(*args_, **kwargs_) 17397 else: 17398 return Network_Action_AttributesType(*args_, **kwargs_)
17399 factory = staticmethod(factory)
17400 - def get_Internal_Port(self): return self.Internal_Port
17401 - def set_Internal_Port(self, Internal_Port): self.Internal_Port = Internal_Port
17402 - def get_External_Port(self): return self.External_Port
17403 - def set_External_Port(self, External_Port): self.External_Port = External_Port
17404 - def get_Internal_IP_Address(self): return self.Internal_IP_Address
17405 - def set_Internal_IP_Address(self, Internal_IP_Address): self.Internal_IP_Address = Internal_IP_Address
17406 - def get_External_IP_Address(self): return self.External_IP_Address
17407 - def set_External_IP_Address(self, External_IP_Address): self.External_IP_Address = External_IP_Address
17408 - def get_Host_Name(self): return self.Host_Name
17409 - def set_Host_Name(self, Host_Name): self.Host_Name = Host_Name
17410 - def get_Data_Sent(self): return self.Data_Sent
17411 - def set_Data_Sent(self, Data_Sent): self.Data_Sent = Data_Sent
17412 - def get_Data_Received(self): return self.Data_Received
17413 - def set_Data_Received(self, Data_Received): self.Data_Received = Data_Received
17414 - def get_Buffer_Length(self): return self.Buffer_Length
17415 - def set_Buffer_Length(self, Buffer_Length): self.Buffer_Length = Buffer_Length
17416 - def export(self, outfile, level, namespace_='maec:', name_='Network_Action_AttributesType', namespacedef_=''):
17417 showIndent(outfile, level) 17418 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17419 already_processed = [] 17420 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Network_Action_AttributesType') 17421 if self.hasContent_(): 17422 outfile.write('>\n') 17423 self.exportChildren(outfile, level + 1, namespace_, name_) 17424 showIndent(outfile, level) 17425 outfile.write('</%s%s>\n' % (namespace_, name_)) 17426 else: 17427 outfile.write('/>\n')
17428 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Network_Action_AttributesType'):
17429 pass
17430 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Network_Action_AttributesType', fromsubclass_=False):
17431 if self.Internal_Port is not None: 17432 showIndent(outfile, level) 17433 outfile.write('<%sInternal_Port>%s</%sInternal_Port>\n' % (namespace_, self.gds_format_integer(self.Internal_Port, input_name='Internal_Port'), namespace_)) 17434 if self.External_Port is not None: 17435 showIndent(outfile, level) 17436 outfile.write('<%sExternal_Port>%s</%sExternal_Port>\n' % (namespace_, self.gds_format_integer(self.External_Port, input_name='External_Port'), namespace_)) 17437 if self.Internal_IP_Address is not None: 17438 showIndent(outfile, level) 17439 outfile.write('<%sInternal_IP_Address>%s</%sInternal_IP_Address>\n' % (namespace_, self.gds_format_string(quote_xml(self.Internal_IP_Address).encode(ExternalEncoding), input_name='Internal_IP_Address'), namespace_)) 17440 if self.External_IP_Address is not None: 17441 showIndent(outfile, level) 17442 outfile.write('<%sExternal_IP_Address>%s</%sExternal_IP_Address>\n' % (namespace_, self.gds_format_string(quote_xml(self.External_IP_Address).encode(ExternalEncoding), input_name='External_IP_Address'), namespace_)) 17443 if self.Host_Name is not None: 17444 showIndent(outfile, level) 17445 outfile.write('<%sHost_Name>%s</%sHost_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Host_Name).encode(ExternalEncoding), input_name='Host_Name'), namespace_)) 17446 if self.Data_Sent is not None: 17447 self.Data_Sent.export(outfile, level, namespace_, name_='Data_Sent') 17448 if self.Data_Received is not None: 17449 self.Data_Received.export(outfile, level, namespace_, name_='Data_Received') 17450 if self.Buffer_Length is not None: 17451 showIndent(outfile, level) 17452 outfile.write('<%sBuffer_Length>%s</%sBuffer_Length>\n' % (namespace_, self.gds_format_integer(self.Buffer_Length, input_name='Buffer_Length'), namespace_))
17453 - def hasContent_(self):
17454 if ( 17455 self.Internal_Port is not None or 17456 self.External_Port is not None or 17457 self.Internal_IP_Address is not None or 17458 self.External_IP_Address is not None or 17459 self.Host_Name is not None or 17460 self.Data_Sent is not None or 17461 self.Data_Received is not None or 17462 self.Buffer_Length is not None 17463 ): 17464 return True 17465 else: 17466 return False
17467 - def exportLiteral(self, outfile, level, name_='Network_Action_AttributesType'):
17468 level += 1 17469 self.exportLiteralAttributes(outfile, level, [], name_) 17470 if self.hasContent_(): 17471 self.exportLiteralChildren(outfile, level, name_)
17472 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17473 pass
17474 - def exportLiteralChildren(self, outfile, level, name_):
17475 if self.Internal_Port is not None: 17476 showIndent(outfile, level) 17477 outfile.write('Internal_Port=%d,\n' % self.Internal_Port) 17478 if self.External_Port is not None: 17479 showIndent(outfile, level) 17480 outfile.write('External_Port=%d,\n' % self.External_Port) 17481 if self.Internal_IP_Address is not None: 17482 showIndent(outfile, level) 17483 outfile.write('Internal_IP_Address=%s,\n' % quote_python(self.Internal_IP_Address).encode(ExternalEncoding)) 17484 if self.External_IP_Address is not None: 17485 showIndent(outfile, level) 17486 outfile.write('External_IP_Address=%s,\n' % quote_python(self.External_IP_Address).encode(ExternalEncoding)) 17487 if self.Host_Name is not None: 17488 showIndent(outfile, level) 17489 outfile.write('Host_Name=%s,\n' % quote_python(self.Host_Name).encode(ExternalEncoding)) 17490 if self.Data_Sent is not None: 17491 showIndent(outfile, level) 17492 outfile.write('Data_Sent=model_.DataType(\n') 17493 self.Data_Sent.exportLiteral(outfile, level, name_='Data_Sent') 17494 showIndent(outfile, level) 17495 outfile.write('),\n') 17496 if self.Data_Received is not None: 17497 showIndent(outfile, level) 17498 outfile.write('Data_Received=model_.DataType(\n') 17499 self.Data_Received.exportLiteral(outfile, level, name_='Data_Received') 17500 showIndent(outfile, level) 17501 outfile.write('),\n') 17502 if self.Buffer_Length is not None: 17503 showIndent(outfile, level) 17504 outfile.write('Buffer_Length=%d,\n' % self.Buffer_Length)
17505 - def build(self, node):
17506 self.buildAttributes(node, node.attrib, []) 17507 for child in node: 17508 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17509 self.buildChildren(child, node, nodeName_)
17510 - def buildAttributes(self, node, attrs, already_processed):
17511 pass
17512 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17513 if nodeName_ == 'Internal_Port': 17514 sval_ = child_.text 17515 try: 17516 ival_ = int(sval_) 17517 except (TypeError, ValueError) as e: 17518 raise_parse_error(child_, 'requires integer: %s' % e) 17519 ival_ = self.gds_validate_integer(ival_, node, 'Internal_Port') 17520 self.Internal_Port = ival_ 17521 elif nodeName_ == 'External_Port': 17522 sval_ = child_.text 17523 try: 17524 ival_ = int(sval_) 17525 except (TypeError, ValueError) as e: 17526 raise_parse_error(child_, 'requires integer: %s' % e) 17527 ival_ = self.gds_validate_integer(ival_, node, 'External_Port') 17528 self.External_Port = ival_ 17529 elif nodeName_ == 'Internal_IP_Address': 17530 Internal_IP_Address_ = child_.text 17531 Internal_IP_Address_ = self.gds_validate_string(Internal_IP_Address_, node, 'Internal_IP_Address') 17532 self.Internal_IP_Address = Internal_IP_Address_ 17533 elif nodeName_ == 'External_IP_Address': 17534 External_IP_Address_ = child_.text 17535 External_IP_Address_ = self.gds_validate_string(External_IP_Address_, node, 'External_IP_Address') 17536 self.External_IP_Address = External_IP_Address_ 17537 elif nodeName_ == 'Host_Name': 17538 Host_Name_ = child_.text 17539 Host_Name_ = self.gds_validate_string(Host_Name_, node, 'Host_Name') 17540 self.Host_Name = Host_Name_ 17541 elif nodeName_ == 'Data_Sent': 17542 obj_ = DataType.factory() 17543 obj_.build(child_) 17544 self.set_Data_Sent(obj_) 17545 elif nodeName_ == 'Data_Received': 17546 obj_ = DataType.factory() 17547 obj_.build(child_) 17548 self.set_Data_Received(obj_) 17549 elif nodeName_ == 'Buffer_Length': 17550 sval_ = child_.text 17551 try: 17552 ival_ = int(sval_) 17553 except (TypeError, ValueError) as e: 17554 raise_parse_error(child_, 'requires integer: %s' % e) 17555 ival_ = self.gds_validate_integer(ival_, node, 'Buffer_Length') 17556 self.Buffer_Length = ival_
17557 # end class Network_Action_AttributesType 17558 17559
17560 -class Module_Action_AttributesType(GeneratedsSuper):
17561 subclass = None 17562 superclass = None
17563 - def __init__(self, Function_Name=None, Flags=None):
17564 self.Function_Name = Function_Name 17565 self.Flags = Flags
17566 - def factory(*args_, **kwargs_):
17567 if Module_Action_AttributesType.subclass: 17568 return Module_Action_AttributesType.subclass(*args_, **kwargs_) 17569 else: 17570 return Module_Action_AttributesType(*args_, **kwargs_)
17571 factory = staticmethod(factory)
17572 - def get_Function_Name(self): return self.Function_Name
17573 - def set_Function_Name(self, Function_Name): self.Function_Name = Function_Name
17574 - def get_Flags(self): return self.Flags
17575 - def set_Flags(self, Flags): self.Flags = Flags
17576 - def export(self, outfile, level, namespace_='maec:', name_='Module_Action_AttributesType', namespacedef_=''):
17577 showIndent(outfile, level) 17578 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17579 already_processed = [] 17580 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Module_Action_AttributesType') 17581 if self.hasContent_(): 17582 outfile.write('>\n') 17583 self.exportChildren(outfile, level + 1, namespace_, name_) 17584 showIndent(outfile, level) 17585 outfile.write('</%s%s>\n' % (namespace_, name_)) 17586 else: 17587 outfile.write('/>\n')
17588 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Module_Action_AttributesType'):
17589 pass
17590 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Module_Action_AttributesType', fromsubclass_=False):
17591 if self.Function_Name is not None: 17592 showIndent(outfile, level) 17593 outfile.write('<%sFunction_Name>%s</%sFunction_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Function_Name).encode(ExternalEncoding), input_name='Function_Name'), namespace_)) 17594 if self.Flags is not None: 17595 showIndent(outfile, level) 17596 outfile.write('<%sFlags>%s</%sFlags>\n' % (namespace_, self.gds_format_string(quote_xml(self.Flags).encode(ExternalEncoding), input_name='Flags'), namespace_))
17597 - def hasContent_(self):
17598 if ( 17599 self.Function_Name is not None or 17600 self.Flags is not None 17601 ): 17602 return True 17603 else: 17604 return False
17605 - def exportLiteral(self, outfile, level, name_='Module_Action_AttributesType'):
17606 level += 1 17607 self.exportLiteralAttributes(outfile, level, [], name_) 17608 if self.hasContent_(): 17609 self.exportLiteralChildren(outfile, level, name_)
17610 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17611 pass
17612 - def exportLiteralChildren(self, outfile, level, name_):
17613 if self.Function_Name is not None: 17614 showIndent(outfile, level) 17615 outfile.write('Function_Name=%s,\n' % quote_python(self.Function_Name).encode(ExternalEncoding)) 17616 if self.Flags is not None: 17617 showIndent(outfile, level) 17618 outfile.write('Flags=%s,\n' % quote_python(self.Flags).encode(ExternalEncoding))
17619 - def build(self, node):
17620 self.buildAttributes(node, node.attrib, []) 17621 for child in node: 17622 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17623 self.buildChildren(child, node, nodeName_)
17624 - def buildAttributes(self, node, attrs, already_processed):
17625 pass
17626 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17627 if nodeName_ == 'Function_Name': 17628 Function_Name_ = child_.text 17629 Function_Name_ = self.gds_validate_string(Function_Name_, node, 'Function_Name') 17630 self.Function_Name = Function_Name_ 17631 elif nodeName_ == 'Flags': 17632 Flags_ = child_.text 17633 Flags_ = self.gds_validate_string(Flags_, node, 'Flags') 17634 self.Flags = Flags_
17635 # end class Module_Action_AttributesType 17636 17637
17638 -class Daemon_Action_AttributesType(GeneratedsSuper):
17639 subclass = None 17640 superclass = None
17641 - def __init__(self, Options=None, Start_Type=None, Desired_Access_Type=None, Enumerated_Daemons=None):
17642 self.Options = Options 17643 self.Start_Type = Start_Type 17644 self.Desired_Access_Type = Desired_Access_Type 17645 self.Enumerated_Daemons = Enumerated_Daemons
17646 - def factory(*args_, **kwargs_):
17647 if Daemon_Action_AttributesType.subclass: 17648 return Daemon_Action_AttributesType.subclass(*args_, **kwargs_) 17649 else: 17650 return Daemon_Action_AttributesType(*args_, **kwargs_)
17651 factory = staticmethod(factory)
17652 - def get_Options(self): return self.Options
17653 - def set_Options(self, Options): self.Options = Options
17654 - def get_Start_Type(self): return self.Start_Type
17655 - def set_Start_Type(self, Start_Type): self.Start_Type = Start_Type
17656 - def get_Desired_Access_Type(self): return self.Desired_Access_Type
17657 - def set_Desired_Access_Type(self, Desired_Access_Type): self.Desired_Access_Type = Desired_Access_Type
17658 - def get_Enumerated_Daemons(self): return self.Enumerated_Daemons
17659 - def set_Enumerated_Daemons(self, Enumerated_Daemons): self.Enumerated_Daemons = Enumerated_Daemons
17660 - def export(self, outfile, level, namespace_='maec:', name_='Daemon_Action_AttributesType', namespacedef_=''):
17661 showIndent(outfile, level) 17662 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17663 already_processed = [] 17664 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Daemon_Action_AttributesType') 17665 if self.hasContent_(): 17666 outfile.write('>\n') 17667 self.exportChildren(outfile, level + 1, namespace_, name_) 17668 showIndent(outfile, level) 17669 outfile.write('</%s%s>\n' % (namespace_, name_)) 17670 else: 17671 outfile.write('/>\n')
17672 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Daemon_Action_AttributesType'):
17673 pass
17674 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Daemon_Action_AttributesType', fromsubclass_=False):
17675 if self.Options is not None: 17676 showIndent(outfile, level) 17677 outfile.write('<%sOptions>%s</%sOptions>\n' % (namespace_, self.gds_format_string(quote_xml(self.Options).encode(ExternalEncoding), input_name='Options'), namespace_)) 17678 if self.Start_Type is not None: 17679 showIndent(outfile, level) 17680 outfile.write('<%sStart_Type>%s</%sStart_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Start_Type).encode(ExternalEncoding), input_name='Start_Type'), namespace_)) 17681 if self.Desired_Access_Type is not None: 17682 showIndent(outfile, level) 17683 outfile.write('<%sDesired_Access_Type>%s</%sDesired_Access_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Desired_Access_Type).encode(ExternalEncoding), input_name='Desired_Access_Type'), namespace_)) 17684 if self.Enumerated_Daemons is not None: 17685 self.Enumerated_Daemons.export(outfile, level, namespace_, name_='Enumerated_Daemons')
17686 - def hasContent_(self):
17687 if ( 17688 self.Options is not None or 17689 self.Start_Type is not None or 17690 self.Desired_Access_Type is not None or 17691 self.Enumerated_Daemons is not None 17692 ): 17693 return True 17694 else: 17695 return False
17696 - def exportLiteral(self, outfile, level, name_='Daemon_Action_AttributesType'):
17697 level += 1 17698 self.exportLiteralAttributes(outfile, level, [], name_) 17699 if self.hasContent_(): 17700 self.exportLiteralChildren(outfile, level, name_)
17701 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17702 pass
17703 - def exportLiteralChildren(self, outfile, level, name_):
17704 if self.Options is not None: 17705 showIndent(outfile, level) 17706 outfile.write('Options=%s,\n' % quote_python(self.Options).encode(ExternalEncoding)) 17707 if self.Start_Type is not None: 17708 showIndent(outfile, level) 17709 outfile.write('Start_Type=%s,\n' % quote_python(self.Start_Type).encode(ExternalEncoding)) 17710 if self.Desired_Access_Type is not None: 17711 showIndent(outfile, level) 17712 outfile.write('Desired_Access_Type=%s,\n' % quote_python(self.Desired_Access_Type).encode(ExternalEncoding)) 17713 if self.Enumerated_Daemons is not None: 17714 showIndent(outfile, level) 17715 outfile.write('Enumerated_Daemons=model_.Enumerated_DaemonsType(\n') 17716 self.Enumerated_Daemons.exportLiteral(outfile, level, name_='Enumerated_Daemons') 17717 showIndent(outfile, level) 17718 outfile.write('),\n')
17719 - def build(self, node):
17720 self.buildAttributes(node, node.attrib, []) 17721 for child in node: 17722 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17723 self.buildChildren(child, node, nodeName_)
17724 - def buildAttributes(self, node, attrs, already_processed):
17725 pass
17726 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17727 if nodeName_ == 'Options': 17728 Options_ = child_.text 17729 Options_ = self.gds_validate_string(Options_, node, 'Options') 17730 self.Options = Options_ 17731 elif nodeName_ == 'Start_Type': 17732 Start_Type_ = child_.text 17733 Start_Type_ = self.gds_validate_string(Start_Type_, node, 'Start_Type') 17734 self.Start_Type = Start_Type_ 17735 elif nodeName_ == 'Desired_Access_Type': 17736 Desired_Access_Type_ = child_.text 17737 Desired_Access_Type_ = self.gds_validate_string(Desired_Access_Type_, node, 'Desired_Access_Type') 17738 self.Desired_Access_Type = Desired_Access_Type_ 17739 elif nodeName_ == 'Enumerated_Daemons': 17740 obj_ = Enumerated_DaemonsType.factory() 17741 obj_.build(child_) 17742 self.set_Enumerated_Daemons(obj_)
17743 # end class Daemon_Action_AttributesType 17744 17745
17746 -class Enumerated_DaemonsType(GeneratedsSuper):
17747 subclass = None 17748 superclass = None
17749 - def __init__(self, Daemon_Reference=None):
17750 if Daemon_Reference is None: 17751 self.Daemon_Reference = [] 17752 else: 17753 self.Daemon_Reference = Daemon_Reference
17754 - def factory(*args_, **kwargs_):
17755 if Enumerated_DaemonsType.subclass: 17756 return Enumerated_DaemonsType.subclass(*args_, **kwargs_) 17757 else: 17758 return Enumerated_DaemonsType(*args_, **kwargs_)
17759 factory = staticmethod(factory)
17760 - def get_Daemon_Reference(self): return self.Daemon_Reference
17761 - def set_Daemon_Reference(self, Daemon_Reference): self.Daemon_Reference = Daemon_Reference
17762 - def add_Daemon_Reference(self, value): self.Daemon_Reference.append(value)
17763 - def insert_Daemon_Reference(self, index, value): self.Daemon_Reference[index] = value
17764 - def export(self, outfile, level, namespace_='maec:', name_='Enumerated_DaemonsType', namespacedef_=''):
17765 showIndent(outfile, level) 17766 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17767 already_processed = [] 17768 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Enumerated_DaemonsType') 17769 if self.hasContent_(): 17770 outfile.write('>\n') 17771 self.exportChildren(outfile, level + 1, namespace_, name_) 17772 showIndent(outfile, level) 17773 outfile.write('</%s%s>\n' % (namespace_, name_)) 17774 else: 17775 outfile.write('/>\n')
17776 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Enumerated_DaemonsType'):
17777 pass
17778 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Enumerated_DaemonsType', fromsubclass_=False):
17779 for Daemon_Reference_ in self.Daemon_Reference: 17780 Daemon_Reference_.export(outfile, level, namespace_, name_='Daemon_Reference')
17781 - def hasContent_(self):
17782 if ( 17783 self.Daemon_Reference 17784 ): 17785 return True 17786 else: 17787 return False
17788 - def exportLiteral(self, outfile, level, name_='Enumerated_DaemonsType'):
17789 level += 1 17790 self.exportLiteralAttributes(outfile, level, [], name_) 17791 if self.hasContent_(): 17792 self.exportLiteralChildren(outfile, level, name_)
17793 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17794 pass
17795 - def exportLiteralChildren(self, outfile, level, name_):
17796 showIndent(outfile, level) 17797 outfile.write('Daemon_Reference=[\n') 17798 level += 1 17799 for Daemon_Reference_ in self.Daemon_Reference: 17800 showIndent(outfile, level) 17801 outfile.write('model_.ObjectReferenceType(\n') 17802 Daemon_Reference_.exportLiteral(outfile, level, name_='ObjectReferenceType') 17803 showIndent(outfile, level) 17804 outfile.write('),\n') 17805 level -= 1 17806 showIndent(outfile, level) 17807 outfile.write('],\n')
17808 - def build(self, node):
17809 self.buildAttributes(node, node.attrib, []) 17810 for child in node: 17811 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17812 self.buildChildren(child, node, nodeName_)
17813 - def buildAttributes(self, node, attrs, already_processed):
17814 pass
17815 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17816 if nodeName_ == 'Daemon_Reference': 17817 obj_ = ObjectReferenceType.factory() 17818 obj_.build(child_) 17819 self.Daemon_Reference.append(obj_)
17820 # end class Enumerated_DaemonsType 17821 17822
17823 -class System_Action_AttributesType(GeneratedsSuper):
17824 subclass = None 17825 superclass = None
17826 - def __init__(self, Computer_Name=None, Local_Time=None):
17827 self.Computer_Name = Computer_Name 17828 self.Local_Time = Local_Time
17829 - def factory(*args_, **kwargs_):
17830 if System_Action_AttributesType.subclass: 17831 return System_Action_AttributesType.subclass(*args_, **kwargs_) 17832 else: 17833 return System_Action_AttributesType(*args_, **kwargs_)
17834 factory = staticmethod(factory)
17835 - def get_Computer_Name(self): return self.Computer_Name
17836 - def set_Computer_Name(self, Computer_Name): self.Computer_Name = Computer_Name
17837 - def get_Local_Time(self): return self.Local_Time
17838 - def set_Local_Time(self, Local_Time): self.Local_Time = Local_Time
17839 - def export(self, outfile, level, namespace_='maec:', name_='System_Action_AttributesType', namespacedef_=''):
17840 showIndent(outfile, level) 17841 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17842 already_processed = [] 17843 self.exportAttributes(outfile, level, already_processed, namespace_, name_='System_Action_AttributesType') 17844 if self.hasContent_(): 17845 outfile.write('>\n') 17846 self.exportChildren(outfile, level + 1, namespace_, name_) 17847 showIndent(outfile, level) 17848 outfile.write('</%s%s>\n' % (namespace_, name_)) 17849 else: 17850 outfile.write('/>\n')
17851 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='System_Action_AttributesType'):
17852 pass
17853 - def exportChildren(self, outfile, level, namespace_='maec:', name_='System_Action_AttributesType', fromsubclass_=False):
17854 if self.Computer_Name is not None: 17855 showIndent(outfile, level) 17856 outfile.write('<%sComputer_Name>%s</%sComputer_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Computer_Name).encode(ExternalEncoding), input_name='Computer_Name'), namespace_)) 17857 if self.Local_Time is not None: 17858 self.Local_Time.export(outfile, level, namespace_, name_='Local_Time')
17859 - def hasContent_(self):
17860 if ( 17861 self.Computer_Name is not None or 17862 self.Local_Time is not None 17863 ): 17864 return True 17865 else: 17866 return False
17867 - def exportLiteral(self, outfile, level, name_='System_Action_AttributesType'):
17868 level += 1 17869 self.exportLiteralAttributes(outfile, level, [], name_) 17870 if self.hasContent_(): 17871 self.exportLiteralChildren(outfile, level, name_)
17872 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17873 pass
17874 - def exportLiteralChildren(self, outfile, level, name_):
17875 if self.Computer_Name is not None: 17876 showIndent(outfile, level) 17877 outfile.write('Computer_Name=%s,\n' % quote_python(self.Computer_Name).encode(ExternalEncoding)) 17878 if self.Local_Time is not None: 17879 showIndent(outfile, level) 17880 outfile.write('Local_Time=model_.xs_time(\n') 17881 self.Local_Time.exportLiteral(outfile, level, name_='Local_Time') 17882 showIndent(outfile, level) 17883 outfile.write('),\n')
17884 - def build(self, node):
17885 self.buildAttributes(node, node.attrib, []) 17886 for child in node: 17887 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17888 self.buildChildren(child, node, nodeName_)
17889 - def buildAttributes(self, node, attrs, already_processed):
17890 pass
17891 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17892 if nodeName_ == 'Computer_Name': 17893 Computer_Name_ = child_.text 17894 Computer_Name_ = self.gds_validate_string(Computer_Name_, node, 'Computer_Name') 17895 self.Computer_Name = Computer_Name_ 17896 elif nodeName_ == 'Local_Time': 17897 obj_ = xs_time.factory() 17898 obj_.build(child_) 17899 self.set_Local_Time(obj_)
17900 # end class System_Action_AttributesType 17901 17902
17903 -class Internet_Action_AttributesType(GeneratedsSuper):
17904 subclass = None 17905 superclass = None
17906 - def __init__(self, URL_Connected=None):
17907 self.URL_Connected = URL_Connected
17908 - def factory(*args_, **kwargs_):
17909 if Internet_Action_AttributesType.subclass: 17910 return Internet_Action_AttributesType.subclass(*args_, **kwargs_) 17911 else: 17912 return Internet_Action_AttributesType(*args_, **kwargs_)
17913 factory = staticmethod(factory)
17914 - def get_URL_Connected(self): return self.URL_Connected
17915 - def set_URL_Connected(self, URL_Connected): self.URL_Connected = URL_Connected
17916 - def export(self, outfile, level, namespace_='maec:', name_='Internet_Action_AttributesType', namespacedef_=''):
17917 showIndent(outfile, level) 17918 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17919 already_processed = [] 17920 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Internet_Action_AttributesType') 17921 if self.hasContent_(): 17922 outfile.write('>\n') 17923 self.exportChildren(outfile, level + 1, namespace_, name_) 17924 showIndent(outfile, level) 17925 outfile.write('</%s%s>\n' % (namespace_, name_)) 17926 else: 17927 outfile.write('/>\n')
17928 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Internet_Action_AttributesType'):
17929 pass
17930 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Internet_Action_AttributesType', fromsubclass_=False):
17931 if self.URL_Connected is not None: 17932 self.URL_Connected.export(outfile, level, namespace_, name_='URL_Connected')
17933 - def hasContent_(self):
17934 if ( 17935 self.URL_Connected is not None 17936 ): 17937 return True 17938 else: 17939 return False
17940 - def exportLiteral(self, outfile, level, name_='Internet_Action_AttributesType'):
17941 level += 1 17942 self.exportLiteralAttributes(outfile, level, [], name_) 17943 if self.hasContent_(): 17944 self.exportLiteralChildren(outfile, level, name_)
17945 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
17946 pass
17947 - def exportLiteralChildren(self, outfile, level, name_):
17948 if self.URL_Connected is not None: 17949 showIndent(outfile, level) 17950 outfile.write('URL_Connected=model_.uriObject(\n') 17951 self.URL_Connected.exportLiteral(outfile, level, name_='URL_Connected') 17952 showIndent(outfile, level) 17953 outfile.write('),\n')
17954 - def build(self, node):
17955 self.buildAttributes(node, node.attrib, []) 17956 for child in node: 17957 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 17958 self.buildChildren(child, node, nodeName_)
17959 - def buildAttributes(self, node, attrs, already_processed):
17960 pass
17961 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17962 if nodeName_ == 'URL_Connected': 17963 obj_ = uriObject.factory() 17964 obj_.build(child_) 17965 self.set_URL_Connected(obj_)
17966 # end class Internet_Action_AttributesType 17967 17968
17969 -class TitleType(GeneratedsSuper):
17970 """This field holds a shortform descriptor for the language that the 17971 Title field is expressed in. Attempting to install the relevant 17972 ISO 2- and 3-letter codes as the enumerated possible values is 17973 probably never going to be a realistic possibility. See RFC 3066 17974 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry at 17975 http://www.iana.org/assignments/lang-tag-apps.htm for further 17976 information. The union allows for the 'un-declaration' of 17977 xml:lang with the empty string.""" 17978 subclass = None 17979 superclass = None
17980 - def __init__(self, lang=None, valueOf_=None):
17981 self.lang = _cast(None, lang) 17982 self.valueOf_ = valueOf_
17983 - def factory(*args_, **kwargs_):
17984 if TitleType.subclass: 17985 return TitleType.subclass(*args_, **kwargs_) 17986 else: 17987 return TitleType(*args_, **kwargs_)
17988 factory = staticmethod(factory)
17989 - def get_lang(self): return self.lang
17990 - def set_lang(self, lang): self.lang = lang
17991 - def get_valueOf_(self): return self.valueOf_
17992 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
17993 - def export(self, outfile, level, namespace_='maec:', name_='TitleType', namespacedef_=''):
17994 showIndent(outfile, level) 17995 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 17996 already_processed = [] 17997 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TitleType') 17998 if self.hasContent_(): 17999 outfile.write('>') 18000 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 18001 self.exportChildren(outfile, level + 1, namespace_, name_) 18002 outfile.write('</%s%s>\n' % (namespace_, name_)) 18003 else: 18004 outfile.write('/>\n')
18005 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='TitleType'):
18006 if self.lang is not None and 'lang' not in already_processed: 18007 already_processed.append('lang') 18008 outfile.write(' lang=%s' % (self.gds_format_string(quote_attrib(self.lang).encode(ExternalEncoding), input_name='lang'), ))
18009 - def exportChildren(self, outfile, level, namespace_='maec:', name_='TitleType', fromsubclass_=False):
18010 pass
18011 - def hasContent_(self):
18012 if ( 18013 self.valueOf_ 18014 ): 18015 return True 18016 else: 18017 return False
18018 - def exportLiteral(self, outfile, level, name_='TitleType'):
18019 level += 1 18020 self.exportLiteralAttributes(outfile, level, [], name_) 18021 if self.hasContent_(): 18022 self.exportLiteralChildren(outfile, level, name_) 18023 showIndent(outfile, level) 18024 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
18025 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18026 if self.lang is not None and 'lang' not in already_processed: 18027 already_processed.append('lang') 18028 showIndent(outfile, level) 18029 outfile.write('lang = "%s",\n' % (self.lang,))
18030 - def exportLiteralChildren(self, outfile, level, name_):
18031 pass
18032 - def build(self, node):
18033 self.buildAttributes(node, node.attrib, []) 18034 self.valueOf_ = get_all_text_(node) 18035 for child in node: 18036 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18037 self.buildChildren(child, node, nodeName_)
18038 - def buildAttributes(self, node, attrs, already_processed):
18039 value = find_attr_value_('lang', node) 18040 if value is not None and 'lang' not in already_processed: 18041 already_processed.append('lang') 18042 self.lang = value
18043 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18044 pass
18045 # end class TitleType 18046 18047
18048 -class meta_item_metadataType(GeneratedsSuper):
18049 """The modification-date attribute represents the last time that any 18050 CPE property has been modified.The status attribute contains the 18051 internal NVD status of a CPE.The nvd-id attribute contains the 18052 NVD specific unique identifier for a CPE. This is provided as a 18053 long-term identifier that can be used to map different versions 18054 of CPE syntax to a CPE with the same meaning. This is not a 18055 replacement of a CPEName. Use of a CPEName is still the standard 18056 ID naming scheme for CPE 2.x.The xmlns-meta attribute contains 18057 the XML CPE metadata namespace descriptor for the CPE namespace 18058 relevant to this CPE Name use.""" 18059 subclass = None 18060 superclass = None
18061 - def __init__(self, status=None, nvd_id=None, xmlns_meta=None, modification_date=None):
18062 self.status = _cast(None, status) 18063 self.nvd_id = _cast(int, nvd_id) 18064 self.xmlns_meta = _cast(None, xmlns_meta) 18065 self.modification_date = _cast(None, modification_date) 18066 pass
18067 - def factory(*args_, **kwargs_):
18068 if meta_item_metadataType.subclass: 18069 return meta_item_metadataType.subclass(*args_, **kwargs_) 18070 else: 18071 return meta_item_metadataType(*args_, **kwargs_)
18072 factory = staticmethod(factory)
18073 - def get_status(self): return self.status
18074 - def set_status(self, status): self.status = status
18075 - def get_nvd_id(self): return self.nvd_id
18076 - def set_nvd_id(self, nvd_id): self.nvd_id = nvd_id
18077 - def get_xmlns_meta(self): return self.xmlns_meta
18078 - def set_xmlns_meta(self, xmlns_meta): self.xmlns_meta = xmlns_meta
18079 - def get_modification_date(self): return self.modification_date
18080 - def set_modification_date(self, modification_date): self.modification_date = modification_date
18081 - def export(self, outfile, level, namespace_='maec:', name_='meta-item-metadataType', namespacedef_=''):
18082 showIndent(outfile, level) 18083 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18084 already_processed = [] 18085 self.exportAttributes(outfile, level, already_processed, namespace_, name_='meta-item-metadataType') 18086 if self.hasContent_(): 18087 outfile.write('>\n') 18088 self.exportChildren(outfile, level + 1, namespace_, name_) 18089 outfile.write('</%s%s>\n' % (namespace_, name_)) 18090 else: 18091 outfile.write('/>\n')
18092 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='meta-item-metadataType'):
18093 if self.status is not None and 'status' not in already_processed: 18094 already_processed.append('status') 18095 outfile.write(' status=%s' % (self.gds_format_string(quote_attrib(self.status).encode(ExternalEncoding), input_name='status'), )) 18096 if self.nvd_id is not None and 'nvd_id' not in already_processed: 18097 already_processed.append('nvd_id') 18098 outfile.write(' nvd-id="%s"' % self.gds_format_integer(self.nvd_id, input_name='nvd-id')) 18099 if self.xmlns_meta is not None and 'xmlns_meta' not in already_processed: 18100 already_processed.append('xmlns_meta') 18101 outfile.write(' xmlns-meta=%s' % (self.gds_format_string(quote_attrib(self.xmlns_meta).encode(ExternalEncoding), input_name='xmlns-meta'), )) 18102 if self.modification_date is not None and 'modification_date' not in already_processed: 18103 already_processed.append('modification_date') 18104 outfile.write(' modification-date=%s' % (self.gds_format_string(quote_attrib(self.modification_date).encode(ExternalEncoding), input_name='modification-date'), ))
18105 - def exportChildren(self, outfile, level, namespace_='maec:', name_='meta-item-metadataType', fromsubclass_=False):
18106 pass
18107 - def hasContent_(self):
18108 if ( 18109 18110 ): 18111 return True 18112 else: 18113 return False
18114 - def exportLiteral(self, outfile, level, name_='meta-item-metadataType'):
18115 level += 1 18116 self.exportLiteralAttributes(outfile, level, [], name_) 18117 if self.hasContent_(): 18118 self.exportLiteralChildren(outfile, level, name_)
18119 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18120 if self.status is not None and 'status' not in already_processed: 18121 already_processed.append('status') 18122 showIndent(outfile, level) 18123 outfile.write('status = "%s",\n' % (self.status,)) 18124 if self.nvd_id is not None and 'nvd_id' not in already_processed: 18125 already_processed.append('nvd_id') 18126 showIndent(outfile, level) 18127 outfile.write('nvd_id = %d,\n' % (self.nvd_id,)) 18128 if self.xmlns_meta is not None and 'xmlns_meta' not in already_processed: 18129 already_processed.append('xmlns_meta') 18130 showIndent(outfile, level) 18131 outfile.write('xmlns_meta = "%s",\n' % (self.xmlns_meta,)) 18132 if self.modification_date is not None and 'modification_date' not in already_processed: 18133 already_processed.append('modification_date') 18134 showIndent(outfile, level) 18135 outfile.write('modification_date = "%s",\n' % (self.modification_date,))
18136 - def exportLiteralChildren(self, outfile, level, name_):
18137 pass
18138 - def build(self, node):
18139 self.buildAttributes(node, node.attrib, []) 18140 for child in node: 18141 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18142 self.buildChildren(child, node, nodeName_)
18143 - def buildAttributes(self, node, attrs, already_processed):
18144 value = find_attr_value_('status', node) 18145 if value is not None and 'status' not in already_processed: 18146 already_processed.append('status') 18147 self.status = value 18148 value = find_attr_value_('nvd-id', node) 18149 if value is not None and 'nvd-id' not in already_processed: 18150 already_processed.append('nvd-id') 18151 try: 18152 self.nvd_id = int(value) 18153 except ValueError as e: 18154 raise_parse_error(node, 'Bad integer attribute: %s' % e) 18155 value = find_attr_value_('xmlns-meta', node) 18156 if value is not None and 'xmlns-meta' not in already_processed: 18157 already_processed.append('xmlns-meta') 18158 self.xmlns_meta = value 18159 value = find_attr_value_('modification-date', node) 18160 if value is not None and 'modification-date' not in already_processed: 18161 already_processed.append('modification-date') 18162 self.modification_date = value
18163 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18164 pass
18165 # end class meta_item_metadataType 18166 18167
18168 -class APICall_ParameterType(GeneratedsSuper):
18169 """This attribute refers to the ordinal position of the API function 18170 call parameter with respect to the function itself.""" 18171 subclass = None 18172 superclass = None
18173 - def __init__(self, ordinal_position=None, Name=None, Value=None):
18174 self.ordinal_position = _cast(int, ordinal_position) 18175 self.Name = Name 18176 self.Value = Value
18177 - def factory(*args_, **kwargs_):
18178 if APICall_ParameterType.subclass: 18179 return APICall_ParameterType.subclass(*args_, **kwargs_) 18180 else: 18181 return APICall_ParameterType(*args_, **kwargs_)
18182 factory = staticmethod(factory)
18183 - def get_Name(self): return self.Name
18184 - def set_Name(self, Name): self.Name = Name
18185 - def get_Value(self): return self.Value
18186 - def set_Value(self, Value): self.Value = Value
18187 - def get_ordinal_position(self): return self.ordinal_position
18188 - def set_ordinal_position(self, ordinal_position): self.ordinal_position = ordinal_position
18189 - def export(self, outfile, level, namespace_='maec:', name_='APICall_ParameterType', namespacedef_=''):
18190 showIndent(outfile, level) 18191 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18192 already_processed = [] 18193 self.exportAttributes(outfile, level, already_processed, namespace_, name_='APICall_ParameterType') 18194 if self.hasContent_(): 18195 outfile.write('>\n') 18196 self.exportChildren(outfile, level + 1, namespace_, name_) 18197 showIndent(outfile, level) 18198 outfile.write('</%s%s>\n' % (namespace_, name_)) 18199 else: 18200 outfile.write('/>\n')
18201 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='APICall_ParameterType'):
18202 if self.ordinal_position is not None and 'ordinal_position' not in already_processed: 18203 already_processed.append('ordinal_position') 18204 outfile.write(' ordinal_position="%s"' % self.gds_format_integer(self.ordinal_position, input_name='ordinal_position'))
18205 - def exportChildren(self, outfile, level, namespace_='maec:', name_='APICall_ParameterType', fromsubclass_=False):
18206 if self.Name is not None: 18207 showIndent(outfile, level) 18208 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) 18209 if self.Value is not None: 18210 showIndent(outfile, level) 18211 outfile.write('<%sValue>%s</%sValue>\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_))
18212 - def hasContent_(self):
18213 if ( 18214 self.Name is not None or 18215 self.Value is not None 18216 ): 18217 return True 18218 else: 18219 return False
18220 - def exportLiteral(self, outfile, level, name_='APICall_ParameterType'):
18221 level += 1 18222 self.exportLiteralAttributes(outfile, level, [], name_) 18223 if self.hasContent_(): 18224 self.exportLiteralChildren(outfile, level, name_)
18225 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18226 if self.ordinal_position is not None and 'ordinal_position' not in already_processed: 18227 already_processed.append('ordinal_position') 18228 showIndent(outfile, level) 18229 outfile.write('ordinal_position = %d,\n' % (self.ordinal_position,))
18230 - def exportLiteralChildren(self, outfile, level, name_):
18231 if self.Name is not None: 18232 showIndent(outfile, level) 18233 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) 18234 if self.Value is not None: 18235 showIndent(outfile, level) 18236 outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding))
18237 - def build(self, node):
18238 self.buildAttributes(node, node.attrib, []) 18239 for child in node: 18240 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18241 self.buildChildren(child, node, nodeName_)
18242 - def buildAttributes(self, node, attrs, already_processed):
18243 value = find_attr_value_('ordinal_position', node) 18244 if value is not None and 'ordinal_position' not in already_processed: 18245 already_processed.append('ordinal_position') 18246 try: 18247 self.ordinal_position = int(value) 18248 except ValueError as e: 18249 raise_parse_error(node, 'Bad integer attribute: %s' % e) 18250 if self.ordinal_position <= 0: 18251 raise_parse_error(node, 'Invalid PositiveInteger')
18252 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18253 if nodeName_ == 'Name': 18254 Name_ = child_.text 18255 Name_ = self.gds_validate_string(Name_, node, 'Name') 18256 self.Name = Name_ 18257 elif nodeName_ == 'Value': 18258 Value_ = child_.text 18259 Value_ = self.gds_validate_string(Value_, node, 'Value') 18260 self.Value = Value_
18261 # end class APICall_ParameterType 18262 18263
18264 -class SubjectType(GeneratedsSuper):
18265 subclass = None 18266 superclass = None
18267 - def __init__(self, URI=None, Object_Reference=None, Object=None, Subject_Field_Data=None):
18268 self.URI = URI 18269 self.Object_Reference = Object_Reference 18270 self.Object = Object 18271 self.Subject_Field_Data = Subject_Field_Data
18272 - def factory(*args_, **kwargs_):
18273 if SubjectType.subclass: 18274 return SubjectType.subclass(*args_, **kwargs_) 18275 else: 18276 return SubjectType(*args_, **kwargs_)
18277 factory = staticmethod(factory)
18278 - def get_URI(self): return self.URI
18279 - def set_URI(self, URI): self.URI = URI
18280 - def get_Object_Reference(self): return self.Object_Reference
18281 - def set_Object_Reference(self, Object_Reference): self.Object_Reference = Object_Reference
18282 - def get_Object(self): return self.Object
18283 - def set_Object(self, Object): self.Object = Object
18284 - def get_Subject_Field_Data(self): return self.Subject_Field_Data
18285 - def set_Subject_Field_Data(self, Subject_Field_Data): self.Subject_Field_Data = Subject_Field_Data
18286 - def export(self, outfile, level, namespace_='maec:', name_='SubjectType', namespacedef_=''):
18287 showIndent(outfile, level) 18288 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18289 already_processed = [] 18290 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SubjectType') 18291 if self.hasContent_(): 18292 outfile.write('>\n') 18293 self.exportChildren(outfile, level + 1, namespace_, name_) 18294 showIndent(outfile, level) 18295 outfile.write('</%s%s>\n' % (namespace_, name_)) 18296 else: 18297 outfile.write('/>\n')
18298 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='SubjectType'):
18299 pass
18300 - def exportChildren(self, outfile, level, namespace_='maec:', name_='SubjectType', fromsubclass_=False):
18301 if self.URI is not None: 18302 self.URI.export(outfile, level, namespace_, name_='URI') 18303 if self.Object_Reference is not None: 18304 self.Object_Reference.export(outfile, level, namespace_, name_='Object_Reference') 18305 if self.Object is not None: 18306 self.Object.export(outfile, level, namespace_, name_='Object') 18307 if self.Subject_Field_Data is not None: 18308 self.Subject_Field_Data.export(outfile, level, namespace_, name_='Subject_Field_Data')
18309 - def hasContent_(self):
18310 if ( 18311 self.URI is not None or 18312 self.Object_Reference is not None or 18313 self.Object is not None or 18314 self.Subject_Field_Data is not None 18315 ): 18316 return True 18317 else: 18318 return False
18319 - def exportLiteral(self, outfile, level, name_='SubjectType'):
18320 level += 1 18321 self.exportLiteralAttributes(outfile, level, [], name_) 18322 if self.hasContent_(): 18323 self.exportLiteralChildren(outfile, level, name_)
18324 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18325 pass
18326 - def exportLiteralChildren(self, outfile, level, name_):
18327 if self.URI is not None: 18328 showIndent(outfile, level) 18329 outfile.write('URI=model_.uriObject(\n') 18330 self.URI.exportLiteral(outfile, level, name_='URI') 18331 showIndent(outfile, level) 18332 outfile.write('),\n') 18333 if self.Object_Reference is not None: 18334 showIndent(outfile, level) 18335 outfile.write('Object_Reference=model_.ObjectReferenceType(\n') 18336 self.Object_Reference.exportLiteral(outfile, level, name_='Object_Reference') 18337 showIndent(outfile, level) 18338 outfile.write('),\n') 18339 if self.Object is not None: 18340 showIndent(outfile, level) 18341 outfile.write('Object=model_.ObjectType(\n') 18342 self.Object.exportLiteral(outfile, level, name_='Object') 18343 showIndent(outfile, level) 18344 outfile.write('),\n') 18345 if self.Subject_Field_Data is not None: 18346 showIndent(outfile, level) 18347 outfile.write('Subject_Field_Data=model_.fieldDataEntry(\n') 18348 self.Subject_Field_Data.exportLiteral(outfile, level, name_='Subject_Field_Data') 18349 showIndent(outfile, level) 18350 outfile.write('),\n')
18351 - def build(self, node):
18352 self.buildAttributes(node, node.attrib, []) 18353 for child in node: 18354 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18355 self.buildChildren(child, node, nodeName_)
18356 - def buildAttributes(self, node, attrs, already_processed):
18357 pass
18358 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18359 if nodeName_ == 'URI': 18360 obj_ = uriObject.factory() 18361 obj_.build(child_) 18362 self.set_URI(obj_) 18363 elif nodeName_ == 'Object_Reference': 18364 obj_ = ObjectReferenceType.factory() 18365 obj_.build(child_) 18366 self.set_Object_Reference(obj_) 18367 elif nodeName_ == 'Object': 18368 obj_ = ObjectType.factory() 18369 obj_.build(child_) 18370 self.set_Object(obj_) 18371 elif nodeName_ == 'Subject_Field_Data': 18372 obj_ = fieldDataEntry.factory() 18373 obj_.build(child_) 18374 self.set_Subject_Field_Data(obj_)
18375 # end class SubjectType 18376 18377
18378 -class AnalystsType(GeneratedsSuper):
18379 subclass = None 18380 superclass = None
18381 - def __init__(self, Analyst=None):
18382 if Analyst is None: 18383 self.Analyst = [] 18384 else: 18385 self.Analyst = Analyst
18386 - def factory(*args_, **kwargs_):
18387 if AnalystsType.subclass: 18388 return AnalystsType.subclass(*args_, **kwargs_) 18389 else: 18390 return AnalystsType(*args_, **kwargs_)
18391 factory = staticmethod(factory)
18392 - def get_Analyst(self): return self.Analyst
18393 - def set_Analyst(self, Analyst): self.Analyst = Analyst
18394 - def add_Analyst(self, value): self.Analyst.append(value)
18395 - def insert_Analyst(self, index, value): self.Analyst[index] = value
18396 - def export(self, outfile, level, namespace_='maec:', name_='AnalystsType', namespacedef_=''):
18397 showIndent(outfile, level) 18398 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18399 already_processed = [] 18400 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AnalystsType') 18401 if self.hasContent_(): 18402 outfile.write('>\n') 18403 self.exportChildren(outfile, level + 1, namespace_, name_) 18404 showIndent(outfile, level) 18405 outfile.write('</%s%s>\n' % (namespace_, name_)) 18406 else: 18407 outfile.write('/>\n')
18408 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='AnalystsType'):
18409 pass
18410 - def exportChildren(self, outfile, level, namespace_='maec:', name_='AnalystsType', fromsubclass_=False):
18411 for Analyst_ in self.Analyst: 18412 showIndent(outfile, level) 18413 outfile.write('<%sAnalyst>%s</%sAnalyst>\n' % (namespace_, self.gds_format_string(quote_xml(Analyst_).encode(ExternalEncoding), input_name='Analyst'), namespace_))
18414 - def hasContent_(self):
18415 if ( 18416 self.Analyst 18417 ): 18418 return True 18419 else: 18420 return False
18421 - def exportLiteral(self, outfile, level, name_='AnalystsType'):
18422 level += 1 18423 self.exportLiteralAttributes(outfile, level, [], name_) 18424 if self.hasContent_(): 18425 self.exportLiteralChildren(outfile, level, name_)
18426 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18427 pass
18428 - def exportLiteralChildren(self, outfile, level, name_):
18429 showIndent(outfile, level) 18430 outfile.write('Analyst=[\n') 18431 level += 1 18432 for Analyst_ in self.Analyst: 18433 showIndent(outfile, level) 18434 outfile.write('%s,\n' % quote_python(Analyst_).encode(ExternalEncoding)) 18435 level -= 1 18436 showIndent(outfile, level) 18437 outfile.write('],\n')
18438 - def build(self, node):
18439 self.buildAttributes(node, node.attrib, []) 18440 for child in node: 18441 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18442 self.buildChildren(child, node, nodeName_)
18443 - def buildAttributes(self, node, attrs, already_processed):
18444 pass
18445 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18446 if nodeName_ == 'Analyst': 18447 Analyst_ = child_.text 18448 Analyst_ = self.gds_validate_string(Analyst_, node, 'Analyst') 18449 self.Analyst.append(Analyst_)
18450 # end class AnalystsType 18451 18452
18453 -class SourceType(GeneratedsSuper):
18454 subclass = None 18455 superclass = None
18456 - def __init__(self, Organization_Name=None, POC=None, URI=None):
18457 self.Organization_Name = Organization_Name 18458 self.POC = POC 18459 self.URI = URI
18460 - def factory(*args_, **kwargs_):
18461 if SourceType.subclass: 18462 return SourceType.subclass(*args_, **kwargs_) 18463 else: 18464 return SourceType(*args_, **kwargs_)
18465 factory = staticmethod(factory)
18466 - def get_Organization_Name(self): return self.Organization_Name
18467 - def set_Organization_Name(self, Organization_Name): self.Organization_Name = Organization_Name
18468 - def get_POC(self): return self.POC
18469 - def set_POC(self, POC): self.POC = POC
18470 - def get_URI(self): return self.URI
18471 - def set_URI(self, URI): self.URI = URI
18472 - def export(self, outfile, level, namespace_='maec:', name_='SourceType', namespacedef_=''):
18473 showIndent(outfile, level) 18474 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18475 already_processed = [] 18476 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SourceType') 18477 if self.hasContent_(): 18478 outfile.write('>\n') 18479 self.exportChildren(outfile, level + 1, namespace_, name_) 18480 showIndent(outfile, level) 18481 outfile.write('</%s%s>\n' % (namespace_, name_)) 18482 else: 18483 outfile.write('/>\n')
18484 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='SourceType'):
18485 pass
18486 - def exportChildren(self, outfile, level, namespace_='maec:', name_='SourceType', fromsubclass_=False):
18487 if self.Organization_Name is not None: 18488 showIndent(outfile, level) 18489 outfile.write('<%sOrganization_Name>%s</%sOrganization_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Organization_Name).encode(ExternalEncoding), input_name='Organization_Name'), namespace_)) 18490 if self.POC is not None: 18491 showIndent(outfile, level) 18492 outfile.write('<%sPOC>%s</%sPOC>\n' % (namespace_, self.gds_format_string(quote_xml(self.POC).encode(ExternalEncoding), input_name='POC'), namespace_)) 18493 if self.URI is not None: 18494 self.URI.export(outfile, level, namespace_, name_='URI')
18495 - def hasContent_(self):
18496 if ( 18497 self.Organization_Name is not None or 18498 self.POC is not None or 18499 self.URI is not None 18500 ): 18501 return True 18502 else: 18503 return False
18504 - def exportLiteral(self, outfile, level, name_='SourceType'):
18505 level += 1 18506 self.exportLiteralAttributes(outfile, level, [], name_) 18507 if self.hasContent_(): 18508 self.exportLiteralChildren(outfile, level, name_)
18509 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18510 pass
18511 - def exportLiteralChildren(self, outfile, level, name_):
18512 if self.Organization_Name is not None: 18513 showIndent(outfile, level) 18514 outfile.write('Organization_Name=%s,\n' % quote_python(self.Organization_Name).encode(ExternalEncoding)) 18515 if self.POC is not None: 18516 showIndent(outfile, level) 18517 outfile.write('POC=%s,\n' % quote_python(self.POC).encode(ExternalEncoding)) 18518 if self.URI is not None: 18519 showIndent(outfile, level) 18520 outfile.write('URI=model_.uriObject(\n') 18521 self.URI.exportLiteral(outfile, level, name_='URI') 18522 showIndent(outfile, level) 18523 outfile.write('),\n')
18524 - def build(self, node):
18525 self.buildAttributes(node, node.attrib, []) 18526 for child in node: 18527 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18528 self.buildChildren(child, node, nodeName_)
18529 - def buildAttributes(self, node, attrs, already_processed):
18530 pass
18531 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18532 if nodeName_ == 'Organization_Name': 18533 Organization_Name_ = child_.text 18534 Organization_Name_ = self.gds_validate_string(Organization_Name_, node, 'Organization_Name') 18535 self.Organization_Name = Organization_Name_ 18536 elif nodeName_ == 'POC': 18537 POC_ = child_.text 18538 POC_ = self.gds_validate_string(POC_, node, 'POC') 18539 self.POC = POC_ 18540 elif nodeName_ == 'URI': 18541 obj_ = uriObject.factory() 18542 obj_.build(child_) 18543 self.set_URI(obj_)
18544 # end class SourceType 18545 18546
18547 -class Analysis_EnvironmentType(GeneratedsSuper):
18548 subclass = None 18549 superclass = None
18550 - def __init__(self, OS=None, Enivironment_Variables=None):
18551 self.OS = OS 18552 self.Enivironment_Variables = Enivironment_Variables
18553 - def factory(*args_, **kwargs_):
18554 if Analysis_EnvironmentType.subclass: 18555 return Analysis_EnvironmentType.subclass(*args_, **kwargs_) 18556 else: 18557 return Analysis_EnvironmentType(*args_, **kwargs_)
18558 factory = staticmethod(factory)
18559 - def get_OS(self): return self.OS
18560 - def set_OS(self, OS): self.OS = OS
18561 - def get_Enivironment_Variables(self): return self.Enivironment_Variables
18562 - def set_Enivironment_Variables(self, Enivironment_Variables): self.Enivironment_Variables = Enivironment_Variables
18563 - def export(self, outfile, level, namespace_='maec:', name_='Analysis_EnvironmentType', namespacedef_=''):
18564 showIndent(outfile, level) 18565 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18566 already_processed = [] 18567 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Analysis_EnvironmentType') 18568 if self.hasContent_(): 18569 outfile.write('>\n') 18570 self.exportChildren(outfile, level + 1, namespace_, name_) 18571 showIndent(outfile, level) 18572 outfile.write('</%s%s>\n' % (namespace_, name_)) 18573 else: 18574 outfile.write('/>\n')
18575 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Analysis_EnvironmentType'):
18576 pass
18577 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Analysis_EnvironmentType', fromsubclass_=False):
18578 if self.OS is not None: 18579 self.OS.export(outfile, level, namespace_, name_='OS') 18580 if self.Enivironment_Variables is not None: 18581 self.Enivironment_Variables.export(outfile, level, namespace_, name_='Enivironment_Variables')
18582 - def hasContent_(self):
18583 if ( 18584 self.OS is not None or 18585 self.Enivironment_Variables is not None 18586 ): 18587 return True 18588 else: 18589 return False
18590 - def exportLiteral(self, outfile, level, name_='Analysis_EnvironmentType'):
18591 level += 1 18592 self.exportLiteralAttributes(outfile, level, [], name_) 18593 if self.hasContent_(): 18594 self.exportLiteralChildren(outfile, level, name_)
18595 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18596 pass
18597 - def exportLiteralChildren(self, outfile, level, name_):
18598 if self.OS is not None: 18599 showIndent(outfile, level) 18600 outfile.write('OS=model_.CPESpecificationType(\n') 18601 self.OS.exportLiteral(outfile, level, name_='OS') 18602 showIndent(outfile, level) 18603 outfile.write('),\n') 18604 if self.Enivironment_Variables is not None: 18605 showIndent(outfile, level) 18606 outfile.write('Enivironment_Variables=model_.Enivironment_VariablesType(\n') 18607 self.Enivironment_Variables.exportLiteral(outfile, level, name_='Enivironment_Variables') 18608 showIndent(outfile, level) 18609 outfile.write('),\n')
18610 - def build(self, node):
18611 self.buildAttributes(node, node.attrib, []) 18612 for child in node: 18613 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18614 self.buildChildren(child, node, nodeName_)
18615 - def buildAttributes(self, node, attrs, already_processed):
18616 pass
18617 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18618 if nodeName_ == 'OS': 18619 obj_ = CPESpecificationType.factory() 18620 obj_.build(child_) 18621 self.set_OS(obj_) 18622 elif nodeName_ == 'Enivironment_Variables': 18623 obj_ = Enivironment_VariablesType.factory() 18624 obj_.build(child_) 18625 self.set_Enivironment_Variables(obj_)
18626 # end class Analysis_EnvironmentType 18627 18628
18629 -class Enivironment_VariablesType(GeneratedsSuper):
18630 subclass = None 18631 superclass = None
18632 - def __init__(self, Environment_Variable=None):
18633 if Environment_Variable is None: 18634 self.Environment_Variable = [] 18635 else: 18636 self.Environment_Variable = Environment_Variable
18637 - def factory(*args_, **kwargs_):
18638 if Enivironment_VariablesType.subclass: 18639 return Enivironment_VariablesType.subclass(*args_, **kwargs_) 18640 else: 18641 return Enivironment_VariablesType(*args_, **kwargs_)
18642 factory = staticmethod(factory)
18643 - def get_Environment_Variable(self): return self.Environment_Variable
18644 - def set_Environment_Variable(self, Environment_Variable): self.Environment_Variable = Environment_Variable
18645 - def add_Environment_Variable(self, value): self.Environment_Variable.append(value)
18646 - def insert_Environment_Variable(self, index, value): self.Environment_Variable[index] = value
18647 - def export(self, outfile, level, namespace_='maec:', name_='Enivironment_VariablesType', namespacedef_=''):
18648 showIndent(outfile, level) 18649 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18650 already_processed = [] 18651 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Enivironment_VariablesType') 18652 if self.hasContent_(): 18653 outfile.write('>\n') 18654 self.exportChildren(outfile, level + 1, namespace_, name_) 18655 showIndent(outfile, level) 18656 outfile.write('</%s%s>\n' % (namespace_, name_)) 18657 else: 18658 outfile.write('/>\n')
18659 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Enivironment_VariablesType'):
18660 pass
18661 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Enivironment_VariablesType', fromsubclass_=False):
18662 for Environment_Variable_ in self.Environment_Variable: 18663 Environment_Variable_.export(outfile, level, namespace_, name_='Environment_Variable')
18664 - def hasContent_(self):
18665 if ( 18666 self.Environment_Variable 18667 ): 18668 return True 18669 else: 18670 return False
18671 - def exportLiteral(self, outfile, level, name_='Enivironment_VariablesType'):
18672 level += 1 18673 self.exportLiteralAttributes(outfile, level, [], name_) 18674 if self.hasContent_(): 18675 self.exportLiteralChildren(outfile, level, name_)
18676 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18677 pass
18678 - def exportLiteralChildren(self, outfile, level, name_):
18679 showIndent(outfile, level) 18680 outfile.write('Environment_Variable=[\n') 18681 level += 1 18682 for Environment_Variable_ in self.Environment_Variable: 18683 showIndent(outfile, level) 18684 outfile.write('model_.Environment_VariableType(\n') 18685 Environment_Variable_.exportLiteral(outfile, level, name_='Environment_VariableType') 18686 showIndent(outfile, level) 18687 outfile.write('),\n') 18688 level -= 1 18689 showIndent(outfile, level) 18690 outfile.write('],\n')
18691 - def build(self, node):
18692 self.buildAttributes(node, node.attrib, []) 18693 for child in node: 18694 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18695 self.buildChildren(child, node, nodeName_)
18696 - def buildAttributes(self, node, attrs, already_processed):
18697 pass
18698 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18699 if nodeName_ == 'Environment_Variable': 18700 obj_ = Environment_VariableType.factory() 18701 obj_.build(child_) 18702 self.Environment_Variable.append(obj_)
18703 # end class Enivironment_VariablesType 18704 18705
18706 -class Environment_VariableType(GeneratedsSuper):
18707 subclass = None 18708 superclass = None
18709 - def __init__(self, Name=None, Value=None):
18710 self.Name = Name 18711 self.Value = Value
18712 - def factory(*args_, **kwargs_):
18713 if Environment_VariableType.subclass: 18714 return Environment_VariableType.subclass(*args_, **kwargs_) 18715 else: 18716 return Environment_VariableType(*args_, **kwargs_)
18717 factory = staticmethod(factory)
18718 - def get_Name(self): return self.Name
18719 - def set_Name(self, Name): self.Name = Name
18720 - def get_Value(self): return self.Value
18721 - def set_Value(self, Value): self.Value = Value
18722 - def export(self, outfile, level, namespace_='maec:', name_='Environment_VariableType', namespacedef_=''):
18723 showIndent(outfile, level) 18724 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18725 already_processed = [] 18726 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Environment_VariableType') 18727 if self.hasContent_(): 18728 outfile.write('>\n') 18729 self.exportChildren(outfile, level + 1, namespace_, name_) 18730 showIndent(outfile, level) 18731 outfile.write('</%s%s>\n' % (namespace_, name_)) 18732 else: 18733 outfile.write('/>\n')
18734 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Environment_VariableType'):
18735 pass
18736 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Environment_VariableType', fromsubclass_=False):
18737 if self.Name is not None: 18738 showIndent(outfile, level) 18739 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) 18740 if self.Value is not None: 18741 showIndent(outfile, level) 18742 outfile.write('<%sValue>%s</%sValue>\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_))
18743 - def hasContent_(self):
18744 if ( 18745 self.Name is not None or 18746 self.Value is not None 18747 ): 18748 return True 18749 else: 18750 return False
18751 - def exportLiteral(self, outfile, level, name_='Environment_VariableType'):
18752 level += 1 18753 self.exportLiteralAttributes(outfile, level, [], name_) 18754 if self.hasContent_(): 18755 self.exportLiteralChildren(outfile, level, name_)
18756 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18757 pass
18758 - def exportLiteralChildren(self, outfile, level, name_):
18759 if self.Name is not None: 18760 showIndent(outfile, level) 18761 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) 18762 if self.Value is not None: 18763 showIndent(outfile, level) 18764 outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding))
18765 - def build(self, node):
18766 self.buildAttributes(node, node.attrib, []) 18767 for child in node: 18768 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18769 self.buildChildren(child, node, nodeName_)
18770 - def buildAttributes(self, node, attrs, already_processed):
18771 pass
18772 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18773 if nodeName_ == 'Name': 18774 Name_ = child_.text 18775 Name_ = self.gds_validate_string(Name_, node, 'Name') 18776 self.Name = Name_ 18777 elif nodeName_ == 'Value': 18778 Value_ = child_.text 18779 Value_ = self.gds_validate_string(Value_, node, 'Value') 18780 self.Value = Value_
18781 # end class Environment_VariableType 18782 18783
18784 -class Tools_UsedType(GeneratedsSuper):
18785 subclass = None 18786 superclass = None
18787 - def __init__(self, Tool=None):
18788 if Tool is None: 18789 self.Tool = [] 18790 else: 18791 self.Tool = Tool
18792 - def factory(*args_, **kwargs_):
18793 if Tools_UsedType.subclass: 18794 return Tools_UsedType.subclass(*args_, **kwargs_) 18795 else: 18796 return Tools_UsedType(*args_, **kwargs_)
18797 factory = staticmethod(factory)
18798 - def get_Tool(self): return self.Tool
18799 - def set_Tool(self, Tool): self.Tool = Tool
18800 - def add_Tool(self, value): self.Tool.append(value)
18801 - def insert_Tool(self, index, value): self.Tool[index] = value
18802 - def export(self, outfile, level, namespace_='maec:', name_='Tools_UsedType', namespacedef_=''):
18803 showIndent(outfile, level) 18804 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18805 already_processed = [] 18806 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Tools_UsedType') 18807 if self.hasContent_(): 18808 outfile.write('>\n') 18809 self.exportChildren(outfile, level + 1, namespace_, name_) 18810 showIndent(outfile, level) 18811 outfile.write('</%s%s>\n' % (namespace_, name_)) 18812 else: 18813 outfile.write('/>\n')
18814 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Tools_UsedType'):
18815 pass
18816 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Tools_UsedType', fromsubclass_=False):
18817 for Tool_ in self.Tool: 18818 Tool_.export(outfile, level, namespace_, name_='Tool')
18819 - def hasContent_(self):
18820 if ( 18821 self.Tool 18822 ): 18823 return True 18824 else: 18825 return False
18826 - def exportLiteral(self, outfile, level, name_='Tools_UsedType'):
18827 level += 1 18828 self.exportLiteralAttributes(outfile, level, [], name_) 18829 if self.hasContent_(): 18830 self.exportLiteralChildren(outfile, level, name_)
18831 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18832 pass
18833 - def exportLiteralChildren(self, outfile, level, name_):
18834 showIndent(outfile, level) 18835 outfile.write('Tool=[\n') 18836 level += 1 18837 for Tool_ in self.Tool: 18838 showIndent(outfile, level) 18839 outfile.write('model_.ToolType(\n') 18840 Tool_.exportLiteral(outfile, level, name_='ToolType') 18841 showIndent(outfile, level) 18842 outfile.write('),\n') 18843 level -= 1 18844 showIndent(outfile, level) 18845 outfile.write('],\n')
18846 - def build(self, node):
18847 self.buildAttributes(node, node.attrib, []) 18848 for child in node: 18849 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18850 self.buildChildren(child, node, nodeName_)
18851 - def buildAttributes(self, node, attrs, already_processed):
18852 pass
18853 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18854 if nodeName_ == 'Tool': 18855 obj_ = ToolType.factory() 18856 obj_.build(child_) 18857 self.Tool.append(obj_)
18858 # end class Tools_UsedType 18859 18860
18861 -class NotesType(GeneratedsSuper):
18862 subclass = None 18863 superclass = None
18864 - def __init__(self, Note=None):
18865 if Note is None: 18866 self.Note = [] 18867 else: 18868 self.Note = Note
18869 - def factory(*args_, **kwargs_):
18870 if NotesType.subclass: 18871 return NotesType.subclass(*args_, **kwargs_) 18872 else: 18873 return NotesType(*args_, **kwargs_)
18874 factory = staticmethod(factory)
18875 - def get_Note(self): return self.Note
18876 - def set_Note(self, Note): self.Note = Note
18877 - def add_Note(self, value): self.Note.append(value)
18878 - def insert_Note(self, index, value): self.Note[index] = value
18879 - def export(self, outfile, level, namespace_='maec:', name_='NotesType', namespacedef_=''):
18880 showIndent(outfile, level) 18881 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18882 already_processed = [] 18883 self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotesType') 18884 if self.hasContent_(): 18885 outfile.write('>\n') 18886 self.exportChildren(outfile, level + 1, namespace_, name_) 18887 showIndent(outfile, level) 18888 outfile.write('</%s%s>\n' % (namespace_, name_)) 18889 else: 18890 outfile.write('/>\n')
18891 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='NotesType'):
18892 pass
18893 - def exportChildren(self, outfile, level, namespace_='maec:', name_='NotesType', fromsubclass_=False):
18894 for Note_ in self.Note: 18895 showIndent(outfile, level) 18896 outfile.write('<%sNote>%s</%sNote>\n' % (namespace_, self.gds_format_string(quote_xml(Note_).encode(ExternalEncoding), input_name='Note'), namespace_))
18897 - def hasContent_(self):
18898 if ( 18899 self.Note 18900 ): 18901 return True 18902 else: 18903 return False
18904 - def exportLiteral(self, outfile, level, name_='NotesType'):
18905 level += 1 18906 self.exportLiteralAttributes(outfile, level, [], name_) 18907 if self.hasContent_(): 18908 self.exportLiteralChildren(outfile, level, name_)
18909 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18910 pass
18911 - def exportLiteralChildren(self, outfile, level, name_):
18912 showIndent(outfile, level) 18913 outfile.write('Note=[\n') 18914 level += 1 18915 for Note_ in self.Note: 18916 showIndent(outfile, level) 18917 outfile.write('%s,\n' % quote_python(Note_).encode(ExternalEncoding)) 18918 level -= 1 18919 showIndent(outfile, level) 18920 outfile.write('],\n')
18921 - def build(self, node):
18922 self.buildAttributes(node, node.attrib, []) 18923 for child in node: 18924 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18925 self.buildChildren(child, node, nodeName_)
18926 - def buildAttributes(self, node, attrs, already_processed):
18927 pass
18928 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18929 if nodeName_ == 'Note': 18930 Note_ = child_.text 18931 Note_ = self.gds_validate_string(Note_, node, 'Note') 18932 self.Note.append(Note_)
18933 # end class NotesType 18934 18935
18936 -class Data_SizeType(GeneratedsSuper):
18937 """This attribute represents the Units used in the object size field. 18938 Possible values are: Bytes, Kilobytes, Megabytes.""" 18939 subclass = None 18940 superclass = None
18941 - def __init__(self, units=None, valueOf_=None):
18942 self.units = _cast(None, units) 18943 self.valueOf_ = valueOf_
18944 - def factory(*args_, **kwargs_):
18945 if Data_SizeType.subclass: 18946 return Data_SizeType.subclass(*args_, **kwargs_) 18947 else: 18948 return Data_SizeType(*args_, **kwargs_)
18949 factory = staticmethod(factory)
18950 - def get_units(self): return self.units
18951 - def set_units(self, units): self.units = units
18952 - def get_valueOf_(self): return self.valueOf_
18953 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
18954 - def export(self, outfile, level, namespace_='maec:', name_='Data_SizeType', namespacedef_=''):
18955 showIndent(outfile, level) 18956 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 18957 already_processed = [] 18958 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Data_SizeType') 18959 if self.hasContent_(): 18960 outfile.write('>') 18961 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 18962 self.exportChildren(outfile, level + 1, namespace_, name_) 18963 outfile.write('</%s%s>\n' % (namespace_, name_)) 18964 else: 18965 outfile.write('/>\n')
18966 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Data_SizeType'):
18967 if self.units is not None and 'units' not in already_processed: 18968 already_processed.append('units') 18969 outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
18970 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Data_SizeType', fromsubclass_=False):
18971 pass
18972 - def hasContent_(self):
18973 if ( 18974 self.valueOf_ 18975 ): 18976 return True 18977 else: 18978 return False
18979 - def exportLiteral(self, outfile, level, name_='Data_SizeType'):
18980 level += 1 18981 self.exportLiteralAttributes(outfile, level, [], name_) 18982 if self.hasContent_(): 18983 self.exportLiteralChildren(outfile, level, name_) 18984 showIndent(outfile, level) 18985 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
18986 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
18987 if self.units is not None and 'units' not in already_processed: 18988 already_processed.append('units') 18989 showIndent(outfile, level) 18990 outfile.write('units = "%s",\n' % (self.units,))
18991 - def exportLiteralChildren(self, outfile, level, name_):
18992 pass
18993 - def build(self, node):
18994 self.buildAttributes(node, node.attrib, []) 18995 self.valueOf_ = get_all_text_(node) 18996 for child in node: 18997 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 18998 self.buildChildren(child, node, nodeName_)
18999 - def buildAttributes(self, node, attrs, already_processed):
19000 value = find_attr_value_('units', node) 19001 if value is not None and 'units' not in already_processed: 19002 already_processed.append('units') 19003 self.units = value
19004 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19005 pass
19006 # end class Data_SizeType 19007 19008
19009 -class HashesType5(GeneratedsSuper):
19010 subclass = None 19011 superclass = None
19012 - def __init__(self, Hash=None):
19013 if Hash is None: 19014 self.Hash = [] 19015 else: 19016 self.Hash = Hash
19017 - def factory(*args_, **kwargs_):
19018 if HashesType5.subclass: 19019 return HashesType5.subclass(*args_, **kwargs_) 19020 else: 19021 return HashesType5(*args_, **kwargs_)
19022 factory = staticmethod(factory)
19023 - def get_Hash(self): return self.Hash
19024 - def set_Hash(self, Hash): self.Hash = Hash
19025 - def add_Hash(self, value): self.Hash.append(value)
19026 - def insert_Hash(self, index, value): self.Hash[index] = value
19027 - def export(self, outfile, level, namespace_='maec:', name_='HashesType5', namespacedef_=''):
19028 showIndent(outfile, level) 19029 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19030 already_processed = [] 19031 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType5') 19032 if self.hasContent_(): 19033 outfile.write('>\n') 19034 self.exportChildren(outfile, level + 1, namespace_, name_) 19035 showIndent(outfile, level) 19036 outfile.write('</%s%s>\n' % (namespace_, name_)) 19037 else: 19038 outfile.write('/>\n')
19039 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType5'):
19040 pass
19041 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType5', fromsubclass_=False):
19042 for Hash_ in self.Hash: 19043 Hash_.export(outfile, level, namespace_, name_='Hash')
19044 - def hasContent_(self):
19045 if ( 19046 self.Hash 19047 ): 19048 return True 19049 else: 19050 return False
19051 - def exportLiteral(self, outfile, level, name_='HashesType5'):
19052 level += 1 19053 self.exportLiteralAttributes(outfile, level, [], name_) 19054 if self.hasContent_(): 19055 self.exportLiteralChildren(outfile, level, name_)
19056 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19057 pass
19058 - def exportLiteralChildren(self, outfile, level, name_):
19059 showIndent(outfile, level) 19060 outfile.write('Hash=[\n') 19061 level += 1 19062 for Hash_ in self.Hash: 19063 showIndent(outfile, level) 19064 outfile.write('model_.HashType(\n') 19065 Hash_.exportLiteral(outfile, level, name_='HashType') 19066 showIndent(outfile, level) 19067 outfile.write('),\n') 19068 level -= 1 19069 showIndent(outfile, level) 19070 outfile.write('],\n')
19071 - def build(self, node):
19072 self.buildAttributes(node, node.attrib, []) 19073 for child in node: 19074 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19075 self.buildChildren(child, node, nodeName_)
19076 - def buildAttributes(self, node, attrs, already_processed):
19077 pass
19078 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19079 if nodeName_ == 'Hash': 19080 obj_ = HashType.factory() 19081 obj_.build(child_) 19082 self.Hash.append(obj_)
19083 # end class HashesType5 19084 19085
19086 -class HashesType6(GeneratedsSuper):
19087 subclass = None 19088 superclass = None
19089 - def __init__(self, Hash=None):
19090 if Hash is None: 19091 self.Hash = [] 19092 else: 19093 self.Hash = Hash
19094 - def factory(*args_, **kwargs_):
19095 if HashesType6.subclass: 19096 return HashesType6.subclass(*args_, **kwargs_) 19097 else: 19098 return HashesType6(*args_, **kwargs_)
19099 factory = staticmethod(factory)
19100 - def get_Hash(self): return self.Hash
19101 - def set_Hash(self, Hash): self.Hash = Hash
19102 - def add_Hash(self, value): self.Hash.append(value)
19103 - def insert_Hash(self, index, value): self.Hash[index] = value
19104 - def export(self, outfile, level, namespace_='maec:', name_='HashesType6', namespacedef_=''):
19105 showIndent(outfile, level) 19106 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19107 already_processed = [] 19108 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType6') 19109 if self.hasContent_(): 19110 outfile.write('>\n') 19111 self.exportChildren(outfile, level + 1, namespace_, name_) 19112 showIndent(outfile, level) 19113 outfile.write('</%s%s>\n' % (namespace_, name_)) 19114 else: 19115 outfile.write('/>\n')
19116 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType6'):
19117 pass
19118 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType6', fromsubclass_=False):
19119 for Hash_ in self.Hash: 19120 Hash_.export(outfile, level, namespace_, name_='Hash')
19121 - def hasContent_(self):
19122 if ( 19123 self.Hash 19124 ): 19125 return True 19126 else: 19127 return False
19128 - def exportLiteral(self, outfile, level, name_='HashesType6'):
19129 level += 1 19130 self.exportLiteralAttributes(outfile, level, [], name_) 19131 if self.hasContent_(): 19132 self.exportLiteralChildren(outfile, level, name_)
19133 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19134 pass
19135 - def exportLiteralChildren(self, outfile, level, name_):
19136 showIndent(outfile, level) 19137 outfile.write('Hash=[\n') 19138 level += 1 19139 for Hash_ in self.Hash: 19140 showIndent(outfile, level) 19141 outfile.write('model_.HashType(\n') 19142 Hash_.exportLiteral(outfile, level, name_='HashType') 19143 showIndent(outfile, level) 19144 outfile.write('),\n') 19145 level -= 1 19146 showIndent(outfile, level) 19147 outfile.write('],\n')
19148 - def build(self, node):
19149 self.buildAttributes(node, node.attrib, []) 19150 for child in node: 19151 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19152 self.buildChildren(child, node, nodeName_)
19153 - def buildAttributes(self, node, attrs, already_processed):
19154 pass
19155 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19156 if nodeName_ == 'Hash': 19157 obj_ = HashType.factory() 19158 obj_.build(child_) 19159 self.Hash.append(obj_)
19160 # end class HashesType6 19161 19162
19163 -class Imported_FunctionsType(GeneratedsSuper):
19164 subclass = None 19165 superclass = None
19166 - def __init__(self, Imported_Function=None):
19167 if Imported_Function is None: 19168 self.Imported_Function = [] 19169 else: 19170 self.Imported_Function = Imported_Function
19171 - def factory(*args_, **kwargs_):
19172 if Imported_FunctionsType.subclass: 19173 return Imported_FunctionsType.subclass(*args_, **kwargs_) 19174 else: 19175 return Imported_FunctionsType(*args_, **kwargs_)
19176 factory = staticmethod(factory)
19177 - def get_Imported_Function(self): return self.Imported_Function
19178 - def set_Imported_Function(self, Imported_Function): self.Imported_Function = Imported_Function
19179 - def add_Imported_Function(self, value): self.Imported_Function.append(value)
19180 - def insert_Imported_Function(self, index, value): self.Imported_Function[index] = value
19181 - def export(self, outfile, level, namespace_='maec:', name_='Imported_FunctionsType', namespacedef_=''):
19182 showIndent(outfile, level) 19183 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19184 already_processed = [] 19185 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Imported_FunctionsType') 19186 if self.hasContent_(): 19187 outfile.write('>\n') 19188 self.exportChildren(outfile, level + 1, namespace_, name_) 19189 showIndent(outfile, level) 19190 outfile.write('</%s%s>\n' % (namespace_, name_)) 19191 else: 19192 outfile.write('/>\n')
19193 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Imported_FunctionsType'):
19194 pass
19195 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Imported_FunctionsType', fromsubclass_=False):
19196 for Imported_Function_ in self.Imported_Function: 19197 Imported_Function_.export(outfile, level, namespace_, name_='Imported_Function')
19198 - def hasContent_(self):
19199 if ( 19200 self.Imported_Function 19201 ): 19202 return True 19203 else: 19204 return False
19205 - def exportLiteral(self, outfile, level, name_='Imported_FunctionsType'):
19206 level += 1 19207 self.exportLiteralAttributes(outfile, level, [], name_) 19208 if self.hasContent_(): 19209 self.exportLiteralChildren(outfile, level, name_)
19210 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19211 pass
19212 - def exportLiteralChildren(self, outfile, level, name_):
19213 showIndent(outfile, level) 19214 outfile.write('Imported_Function=[\n') 19215 level += 1 19216 for Imported_Function_ in self.Imported_Function: 19217 showIndent(outfile, level) 19218 outfile.write('model_.Imported_FunctionType(\n') 19219 Imported_Function_.exportLiteral(outfile, level, name_='Imported_FunctionType') 19220 showIndent(outfile, level) 19221 outfile.write('),\n') 19222 level -= 1 19223 showIndent(outfile, level) 19224 outfile.write('],\n')
19225 - def build(self, node):
19226 self.buildAttributes(node, node.attrib, []) 19227 for child in node: 19228 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19229 self.buildChildren(child, node, nodeName_)
19230 - def buildAttributes(self, node, attrs, already_processed):
19231 pass
19232 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19233 if nodeName_ == 'Imported_Function': 19234 obj_ = Imported_FunctionType.factory() 19235 obj_.build(child_) 19236 self.Imported_Function.append(obj_)
19237 # end class Imported_FunctionsType 19238 19239
19240 -class Imported_FunctionType(GeneratedsSuper):
19241 subclass = None 19242 superclass = None
19243 - def __init__(self, Function_Name=None, Virtual_Address=None, Hint=None, Ordinal=None):
19244 self.Function_Name = Function_Name 19245 self.Virtual_Address = Virtual_Address 19246 self.Hint = Hint 19247 self.Ordinal = Ordinal
19248 - def factory(*args_, **kwargs_):
19249 if Imported_FunctionType.subclass: 19250 return Imported_FunctionType.subclass(*args_, **kwargs_) 19251 else: 19252 return Imported_FunctionType(*args_, **kwargs_)
19253 factory = staticmethod(factory)
19254 - def get_Function_Name(self): return self.Function_Name
19255 - def set_Function_Name(self, Function_Name): self.Function_Name = Function_Name
19256 - def get_Virtual_Address(self): return self.Virtual_Address
19257 - def set_Virtual_Address(self, Virtual_Address): self.Virtual_Address = Virtual_Address
19258 - def get_Hint(self): return self.Hint
19259 - def set_Hint(self, Hint): self.Hint = Hint
19260 - def get_Ordinal(self): return self.Ordinal
19261 - def set_Ordinal(self, Ordinal): self.Ordinal = Ordinal
19262 - def export(self, outfile, level, namespace_='maec:', name_='Imported_FunctionType', namespacedef_=''):
19263 showIndent(outfile, level) 19264 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19265 already_processed = [] 19266 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Imported_FunctionType') 19267 if self.hasContent_(): 19268 outfile.write('>\n') 19269 self.exportChildren(outfile, level + 1, namespace_, name_) 19270 showIndent(outfile, level) 19271 outfile.write('</%s%s>\n' % (namespace_, name_)) 19272 else: 19273 outfile.write('/>\n')
19274 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Imported_FunctionType'):
19275 pass
19276 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Imported_FunctionType', fromsubclass_=False):
19277 if self.Function_Name is not None: 19278 showIndent(outfile, level) 19279 outfile.write('<%sFunction_Name>%s</%sFunction_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Function_Name).encode(ExternalEncoding), input_name='Function_Name'), namespace_)) 19280 if self.Virtual_Address is not None: 19281 showIndent(outfile, level) 19282 outfile.write('<%sVirtual_Address>%s</%sVirtual_Address>\n' % (namespace_, self.gds_format_string(quote_xml(self.Virtual_Address).encode(ExternalEncoding), input_name='Virtual_Address'), namespace_)) 19283 if self.Hint is not None: 19284 self.Hint.export(outfile, level, namespace_, name_='Hint') 19285 if self.Ordinal is not None: 19286 showIndent(outfile, level) 19287 outfile.write('<%sOrdinal>%s</%sOrdinal>\n' % (namespace_, self.gds_format_integer(self.Ordinal, input_name='Ordinal'), namespace_))
19288 - def hasContent_(self):
19289 if ( 19290 self.Function_Name is not None or 19291 self.Virtual_Address is not None or 19292 self.Hint is not None or 19293 self.Ordinal is not None 19294 ): 19295 return True 19296 else: 19297 return False
19298 - def exportLiteral(self, outfile, level, name_='Imported_FunctionType'):
19299 level += 1 19300 self.exportLiteralAttributes(outfile, level, [], name_) 19301 if self.hasContent_(): 19302 self.exportLiteralChildren(outfile, level, name_)
19303 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19304 pass
19305 - def exportLiteralChildren(self, outfile, level, name_):
19306 if self.Function_Name is not None: 19307 showIndent(outfile, level) 19308 outfile.write('Function_Name=%s,\n' % quote_python(self.Function_Name).encode(ExternalEncoding)) 19309 if self.Virtual_Address is not None: 19310 showIndent(outfile, level) 19311 outfile.write('Virtual_Address=model_.xs_hexBinary(\n') 19312 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address') 19313 showIndent(outfile, level) 19314 outfile.write('),\n') 19315 if self.Hint is not None: 19316 showIndent(outfile, level) 19317 outfile.write('Hint=model_.xs_hexBinary(\n') 19318 self.Hint.exportLiteral(outfile, level, name_='Hint') 19319 showIndent(outfile, level) 19320 outfile.write('),\n') 19321 if self.Ordinal is not None: 19322 showIndent(outfile, level) 19323 outfile.write('Ordinal=%d,\n' % self.Ordinal)
19324 - def build(self, node):
19325 self.buildAttributes(node, node.attrib, []) 19326 for child in node: 19327 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19328 self.buildChildren(child, node, nodeName_)
19329 - def buildAttributes(self, node, attrs, already_processed):
19330 pass
19331 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19332 if nodeName_ == 'Function_Name': 19333 Function_Name_ = child_.text 19334 Function_Name_ = self.gds_validate_string(Function_Name_, node, 'Function_Name') 19335 self.Function_Name = Function_Name_ 19336 elif nodeName_ == 'Virtual_Address': 19337 obj_ = xs_hexBinary.factory() 19338 obj_.build(child_) 19339 self.set_Virtual_Address(obj_) 19340 elif nodeName_ == 'Hint': 19341 obj_ = xs_hexBinary.factory() 19342 obj_.build(child_) 19343 self.set_Hint(obj_) 19344 elif nodeName_ == 'Ordinal': 19345 sval_ = child_.text 19346 try: 19347 ival_ = int(sval_) 19348 except (TypeError, ValueError) as e: 19349 raise_parse_error(child_, 'requires integer: %s' % e) 19350 ival_ = self.gds_validate_integer(ival_, node, 'Ordinal') 19351 self.Ordinal = ival_
19352 # end class Imported_FunctionType 19353 19354
19355 -class Header_HashesType(GeneratedsSuper):
19356 subclass = None 19357 superclass = None
19358 - def __init__(self, Hash=None):
19359 if Hash is None: 19360 self.Hash = [] 19361 else: 19362 self.Hash = Hash
19363 - def factory(*args_, **kwargs_):
19364 if Header_HashesType.subclass: 19365 return Header_HashesType.subclass(*args_, **kwargs_) 19366 else: 19367 return Header_HashesType(*args_, **kwargs_)
19368 factory = staticmethod(factory)
19369 - def get_Hash(self): return self.Hash
19370 - def set_Hash(self, Hash): self.Hash = Hash
19371 - def add_Hash(self, value): self.Hash.append(value)
19372 - def insert_Hash(self, index, value): self.Hash[index] = value
19373 - def export(self, outfile, level, namespace_='maec:', name_='Header_HashesType', namespacedef_=''):
19374 showIndent(outfile, level) 19375 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19376 already_processed = [] 19377 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Header_HashesType') 19378 if self.hasContent_(): 19379 outfile.write('>\n') 19380 self.exportChildren(outfile, level + 1, namespace_, name_) 19381 showIndent(outfile, level) 19382 outfile.write('</%s%s>\n' % (namespace_, name_)) 19383 else: 19384 outfile.write('/>\n')
19385 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Header_HashesType'):
19386 pass
19387 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Header_HashesType', fromsubclass_=False):
19388 for Hash_ in self.Hash: 19389 Hash_.export(outfile, level, namespace_, name_='Hash')
19390 - def hasContent_(self):
19391 if ( 19392 self.Hash 19393 ): 19394 return True 19395 else: 19396 return False
19397 - def exportLiteral(self, outfile, level, name_='Header_HashesType'):
19398 level += 1 19399 self.exportLiteralAttributes(outfile, level, [], name_) 19400 if self.hasContent_(): 19401 self.exportLiteralChildren(outfile, level, name_)
19402 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19403 pass
19404 - def exportLiteralChildren(self, outfile, level, name_):
19405 showIndent(outfile, level) 19406 outfile.write('Hash=[\n') 19407 level += 1 19408 for Hash_ in self.Hash: 19409 showIndent(outfile, level) 19410 outfile.write('model_.HashType(\n') 19411 Hash_.exportLiteral(outfile, level, name_='HashType') 19412 showIndent(outfile, level) 19413 outfile.write('),\n') 19414 level -= 1 19415 showIndent(outfile, level) 19416 outfile.write('],\n')
19417 - def build(self, node):
19418 self.buildAttributes(node, node.attrib, []) 19419 for child in node: 19420 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19421 self.buildChildren(child, node, nodeName_)
19422 - def buildAttributes(self, node, attrs, already_processed):
19423 pass
19424 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19425 if nodeName_ == 'Hash': 19426 obj_ = HashType.factory() 19427 obj_.build(child_) 19428 self.Hash.append(obj_)
19429 # end class Header_HashesType 19430 19431
19432 -class Data_HashesType(GeneratedsSuper):
19433 subclass = None 19434 superclass = None
19435 - def __init__(self, Hash=None):
19436 if Hash is None: 19437 self.Hash = [] 19438 else: 19439 self.Hash = Hash
19440 - def factory(*args_, **kwargs_):
19441 if Data_HashesType.subclass: 19442 return Data_HashesType.subclass(*args_, **kwargs_) 19443 else: 19444 return Data_HashesType(*args_, **kwargs_)
19445 factory = staticmethod(factory)
19446 - def get_Hash(self): return self.Hash
19447 - def set_Hash(self, Hash): self.Hash = Hash
19448 - def add_Hash(self, value): self.Hash.append(value)
19449 - def insert_Hash(self, index, value): self.Hash[index] = value
19450 - def export(self, outfile, level, namespace_='maec:', name_='Data_HashesType', namespacedef_=''):
19451 showIndent(outfile, level) 19452 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19453 already_processed = [] 19454 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Data_HashesType') 19455 if self.hasContent_(): 19456 outfile.write('>\n') 19457 self.exportChildren(outfile, level + 1, namespace_, name_) 19458 showIndent(outfile, level) 19459 outfile.write('</%s%s>\n' % (namespace_, name_)) 19460 else: 19461 outfile.write('/>\n')
19462 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Data_HashesType'):
19463 pass
19464 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Data_HashesType', fromsubclass_=False):
19465 for Hash_ in self.Hash: 19466 Hash_.export(outfile, level, namespace_, name_='Hash')
19467 - def hasContent_(self):
19468 if ( 19469 self.Hash 19470 ): 19471 return True 19472 else: 19473 return False
19474 - def exportLiteral(self, outfile, level, name_='Data_HashesType'):
19475 level += 1 19476 self.exportLiteralAttributes(outfile, level, [], name_) 19477 if self.hasContent_(): 19478 self.exportLiteralChildren(outfile, level, name_)
19479 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19480 pass
19481 - def exportLiteralChildren(self, outfile, level, name_):
19482 showIndent(outfile, level) 19483 outfile.write('Hash=[\n') 19484 level += 1 19485 for Hash_ in self.Hash: 19486 showIndent(outfile, level) 19487 outfile.write('model_.HashType(\n') 19488 Hash_.exportLiteral(outfile, level, name_='HashType') 19489 showIndent(outfile, level) 19490 outfile.write('),\n') 19491 level -= 1 19492 showIndent(outfile, level) 19493 outfile.write('],\n')
19494 - def build(self, node):
19495 self.buildAttributes(node, node.attrib, []) 19496 for child in node: 19497 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19498 self.buildChildren(child, node, nodeName_)
19499 - def buildAttributes(self, node, attrs, already_processed):
19500 pass
19501 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19502 if nodeName_ == 'Hash': 19503 obj_ = HashType.factory() 19504 obj_.build(child_) 19505 self.Hash.append(obj_)
19506 # end class Data_HashesType 19507 19508
19509 -class HashesType7(GeneratedsSuper):
19510 subclass = None 19511 superclass = None
19512 - def __init__(self, Hash=None):
19513 if Hash is None: 19514 self.Hash = [] 19515 else: 19516 self.Hash = Hash
19517 - def factory(*args_, **kwargs_):
19518 if HashesType7.subclass: 19519 return HashesType7.subclass(*args_, **kwargs_) 19520 else: 19521 return HashesType7(*args_, **kwargs_)
19522 factory = staticmethod(factory)
19523 - def get_Hash(self): return self.Hash
19524 - def set_Hash(self, Hash): self.Hash = Hash
19525 - def add_Hash(self, value): self.Hash.append(value)
19526 - def insert_Hash(self, index, value): self.Hash[index] = value
19527 - def export(self, outfile, level, namespace_='maec:', name_='HashesType7', namespacedef_=''):
19528 showIndent(outfile, level) 19529 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19530 already_processed = [] 19531 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType7') 19532 if self.hasContent_(): 19533 outfile.write('>\n') 19534 self.exportChildren(outfile, level + 1, namespace_, name_) 19535 showIndent(outfile, level) 19536 outfile.write('</%s%s>\n' % (namespace_, name_)) 19537 else: 19538 outfile.write('/>\n')
19539 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType7'):
19540 pass
19541 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType7', fromsubclass_=False):
19542 for Hash_ in self.Hash: 19543 Hash_.export(outfile, level, namespace_, name_='Hash')
19544 - def hasContent_(self):
19545 if ( 19546 self.Hash 19547 ): 19548 return True 19549 else: 19550 return False
19551 - def exportLiteral(self, outfile, level, name_='HashesType7'):
19552 level += 1 19553 self.exportLiteralAttributes(outfile, level, [], name_) 19554 if self.hasContent_(): 19555 self.exportLiteralChildren(outfile, level, name_)
19556 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19557 pass
19558 - def exportLiteralChildren(self, outfile, level, name_):
19559 showIndent(outfile, level) 19560 outfile.write('Hash=[\n') 19561 level += 1 19562 for Hash_ in self.Hash: 19563 showIndent(outfile, level) 19564 outfile.write('model_.HashType(\n') 19565 Hash_.exportLiteral(outfile, level, name_='HashType') 19566 showIndent(outfile, level) 19567 outfile.write('),\n') 19568 level -= 1 19569 showIndent(outfile, level) 19570 outfile.write('],\n')
19571 - def build(self, node):
19572 self.buildAttributes(node, node.attrib, []) 19573 for child in node: 19574 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19575 self.buildChildren(child, node, nodeName_)
19576 - def buildAttributes(self, node, attrs, already_processed):
19577 pass
19578 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19579 if nodeName_ == 'Hash': 19580 obj_ = HashType.factory() 19581 obj_.build(child_) 19582 self.Hash.append(obj_)
19583 # end class HashesType7 19584 19585
19586 -class objectsType(GeneratedsSuper):
19587 subclass = None 19588 superclass = None
19589 - def __init__(self, file=None, uri=None, domain=None, registry=None, ip=None, asn=None, entity=None, classification=None):
19590 if file is None: 19591 self.file = [] 19592 else: 19593 self.file = file 19594 if uri is None: 19595 self.uri = [] 19596 else: 19597 self.uri = uri 19598 if domain is None: 19599 self.domain = [] 19600 else: 19601 self.domain = domain 19602 if registry is None: 19603 self.registry = [] 19604 else: 19605 self.registry = registry 19606 if ip is None: 19607 self.ip = [] 19608 else: 19609 self.ip = ip 19610 if asn is None: 19611 self.asn = [] 19612 else: 19613 self.asn = asn 19614 if entity is None: 19615 self.entity = [] 19616 else: 19617 self.entity = entity 19618 if classification is None: 19619 self.classification = [] 19620 else: 19621 self.classification = classification
19622 - def factory(*args_, **kwargs_):
19623 if objectsType.subclass: 19624 return objectsType.subclass(*args_, **kwargs_) 19625 else: 19626 return objectsType(*args_, **kwargs_)
19627 factory = staticmethod(factory)
19628 - def get_file(self): return self.file
19629 - def set_file(self, file): self.file = file
19630 - def add_file(self, value): self.file.append(value)
19631 - def insert_file(self, index, value): self.file[index] = value
19632 - def get_uri(self): return self.uri
19633 - def set_uri(self, uri): self.uri = uri
19634 - def add_uri(self, value): self.uri.append(value)
19635 - def insert_uri(self, index, value): self.uri[index] = value
19636 - def get_domain(self): return self.domain
19637 - def set_domain(self, domain): self.domain = domain
19638 - def add_domain(self, value): self.domain.append(value)
19639 - def insert_domain(self, index, value): self.domain[index] = value
19640 - def get_registry(self): return self.registry
19641 - def set_registry(self, registry): self.registry = registry
19642 - def add_registry(self, value): self.registry.append(value)
19643 - def insert_registry(self, index, value): self.registry[index] = value
19644 - def get_ip(self): return self.ip
19645 - def set_ip(self, ip): self.ip = ip
19646 - def add_ip(self, value): self.ip.append(value)
19647 - def insert_ip(self, index, value): self.ip[index] = value
19648 - def get_asn(self): return self.asn
19649 - def set_asn(self, asn): self.asn = asn
19650 - def add_asn(self, value): self.asn.append(value)
19651 - def insert_asn(self, index, value): self.asn[index] = value
19652 - def get_entity(self): return self.entity
19653 - def set_entity(self, entity): self.entity = entity
19654 - def add_entity(self, value): self.entity.append(value)
19655 - def insert_entity(self, index, value): self.entity[index] = value
19656 - def get_classification(self): return self.classification
19657 - def set_classification(self, classification): self.classification = classification
19658 - def add_classification(self, value): self.classification.append(value)
19659 - def insert_classification(self, index, value): self.classification[index] = value
19660 - def export(self, outfile, level, namespace_='maec:', name_='objectsType', namespacedef_=''):
19661 showIndent(outfile, level) 19662 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19663 already_processed = [] 19664 self.exportAttributes(outfile, level, already_processed, namespace_, name_='objectsType') 19665 if self.hasContent_(): 19666 outfile.write('>\n') 19667 self.exportChildren(outfile, level + 1, namespace_, name_) 19668 showIndent(outfile, level) 19669 outfile.write('</%s%s>\n' % (namespace_, name_)) 19670 else: 19671 outfile.write('/>\n')
19672 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='objectsType'):
19673 pass
19674 - def exportChildren(self, outfile, level, namespace_='maec:', name_='objectsType', fromsubclass_=False):
19675 for file_ in self.file: 19676 file_.export(outfile, level, namespace_, name_='file') 19677 for uri_ in self.uri: 19678 uri_.export(outfile, level, namespace_, name_='uri') 19679 for domain_ in self.domain: 19680 domain_.export(outfile, level, namespace_, name_='domain') 19681 for registry_ in self.registry: 19682 registry_.export(outfile, level, namespace_, name_='registry') 19683 for ip_ in self.ip: 19684 ip_.export(outfile, level, namespace_, name_='ip') 19685 for asn_ in self.asn: 19686 asn_.export(outfile, level, namespace_, name_='asn') 19687 for entity_ in self.entity: 19688 entity_.export(outfile, level, namespace_, name_='entity') 19689 for classification_ in self.classification: 19690 classification_.export(outfile, level, namespace_, name_='classification')
19691 - def hasContent_(self):
19692 if ( 19693 self.file or 19694 self.uri or 19695 self.domain or 19696 self.registry or 19697 self.ip or 19698 self.asn or 19699 self.entity or 19700 self.classification 19701 ): 19702 return True 19703 else: 19704 return False
19705 - def exportLiteral(self, outfile, level, name_='objectsType'):
19706 level += 1 19707 self.exportLiteralAttributes(outfile, level, [], name_) 19708 if self.hasContent_(): 19709 self.exportLiteralChildren(outfile, level, name_)
19710 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19711 pass
19712 - def exportLiteralChildren(self, outfile, level, name_):
19713 showIndent(outfile, level) 19714 outfile.write('file=[\n') 19715 level += 1 19716 for file_ in self.file: 19717 showIndent(outfile, level) 19718 outfile.write('model_.fileObject(\n') 19719 file_.exportLiteral(outfile, level, name_='fileObject') 19720 showIndent(outfile, level) 19721 outfile.write('),\n') 19722 level -= 1 19723 showIndent(outfile, level) 19724 outfile.write('],\n') 19725 showIndent(outfile, level) 19726 outfile.write('uri=[\n') 19727 level += 1 19728 for uri_ in self.uri: 19729 showIndent(outfile, level) 19730 outfile.write('model_.uriObject(\n') 19731 uri_.exportLiteral(outfile, level, name_='uriObject') 19732 showIndent(outfile, level) 19733 outfile.write('),\n') 19734 level -= 1 19735 showIndent(outfile, level) 19736 outfile.write('],\n') 19737 showIndent(outfile, level) 19738 outfile.write('domain=[\n') 19739 level += 1 19740 for domain_ in self.domain: 19741 showIndent(outfile, level) 19742 outfile.write('model_.domainObject(\n') 19743 domain_.exportLiteral(outfile, level, name_='domainObject') 19744 showIndent(outfile, level) 19745 outfile.write('),\n') 19746 level -= 1 19747 showIndent(outfile, level) 19748 outfile.write('],\n') 19749 showIndent(outfile, level) 19750 outfile.write('registry=[\n') 19751 level += 1 19752 for registry_ in self.registry: 19753 showIndent(outfile, level) 19754 outfile.write('model_.registryObject(\n') 19755 registry_.exportLiteral(outfile, level, name_='registryObject') 19756 showIndent(outfile, level) 19757 outfile.write('),\n') 19758 level -= 1 19759 showIndent(outfile, level) 19760 outfile.write('],\n') 19761 showIndent(outfile, level) 19762 outfile.write('ip=[\n') 19763 level += 1 19764 for ip_ in self.ip: 19765 showIndent(outfile, level) 19766 outfile.write('model_.IPObject(\n') 19767 ip_.exportLiteral(outfile, level, name_='IPObject') 19768 showIndent(outfile, level) 19769 outfile.write('),\n') 19770 level -= 1 19771 showIndent(outfile, level) 19772 outfile.write('],\n') 19773 showIndent(outfile, level) 19774 outfile.write('asn=[\n') 19775 level += 1 19776 for asn_ in self.asn: 19777 showIndent(outfile, level) 19778 outfile.write('model_.ASNObject(\n') 19779 asn_.exportLiteral(outfile, level, name_='ASNObject') 19780 showIndent(outfile, level) 19781 outfile.write('),\n') 19782 level -= 1 19783 showIndent(outfile, level) 19784 outfile.write('],\n') 19785 showIndent(outfile, level) 19786 outfile.write('entity=[\n') 19787 level += 1 19788 for entity_ in self.entity: 19789 showIndent(outfile, level) 19790 outfile.write('model_.entityObject(\n') 19791 entity_.exportLiteral(outfile, level, name_='entityObject') 19792 showIndent(outfile, level) 19793 outfile.write('),\n') 19794 level -= 1 19795 showIndent(outfile, level) 19796 outfile.write('],\n') 19797 showIndent(outfile, level) 19798 outfile.write('classification=[\n') 19799 level += 1 19800 for classification_ in self.classification: 19801 showIndent(outfile, level) 19802 outfile.write('model_.classificationObject(\n') 19803 classification_.exportLiteral(outfile, level, name_='classificationObject') 19804 showIndent(outfile, level) 19805 outfile.write('),\n') 19806 level -= 1 19807 showIndent(outfile, level) 19808 outfile.write('],\n')
19809 - def build(self, node):
19810 self.buildAttributes(node, node.attrib, []) 19811 for child in node: 19812 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19813 self.buildChildren(child, node, nodeName_)
19814 - def buildAttributes(self, node, attrs, already_processed):
19815 pass
19816 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19817 if nodeName_ == 'file': 19818 obj_ = fileObject.factory() 19819 obj_.build(child_) 19820 self.file.append(obj_) 19821 elif nodeName_ == 'uri': 19822 obj_ = uriObject.factory() 19823 obj_.build(child_) 19824 self.uri.append(obj_) 19825 elif nodeName_ == 'domain': 19826 obj_ = domainObject.factory() 19827 obj_.build(child_) 19828 self.domain.append(obj_) 19829 elif nodeName_ == 'registry': 19830 obj_ = registryObject.factory() 19831 obj_.build(child_) 19832 self.registry.append(obj_) 19833 elif nodeName_ == 'ip': 19834 obj_ = IPObject.factory() 19835 obj_.build(child_) 19836 self.ip.append(obj_) 19837 elif nodeName_ == 'asn': 19838 obj_ = ASNObject.factory() 19839 obj_.build(child_) 19840 self.asn.append(obj_) 19841 elif nodeName_ == 'entity': 19842 obj_ = entityObject.factory() 19843 obj_.build(child_) 19844 self.entity.append(obj_) 19845 elif nodeName_ == 'classification': 19846 obj_ = classificationObject.factory() 19847 obj_.build(child_) 19848 self.classification.append(obj_)
19849 # end class objectsType 19850 19851
19852 -class objectPropertiesType(GeneratedsSuper):
19853 subclass = None 19854 superclass = None
19855 - def __init__(self, objectProperty=None):
19856 if objectProperty is None: 19857 self.objectProperty = [] 19858 else: 19859 self.objectProperty = objectProperty
19860 - def factory(*args_, **kwargs_):
19861 if objectPropertiesType.subclass: 19862 return objectPropertiesType.subclass(*args_, **kwargs_) 19863 else: 19864 return objectPropertiesType(*args_, **kwargs_)
19865 factory = staticmethod(factory)
19866 - def get_objectProperty(self): return self.objectProperty
19867 - def set_objectProperty(self, objectProperty): self.objectProperty = objectProperty
19868 - def add_objectProperty(self, value): self.objectProperty.append(value)
19869 - def insert_objectProperty(self, index, value): self.objectProperty[index] = value
19870 - def export(self, outfile, level, namespace_='maec:', name_='objectPropertiesType', namespacedef_=''):
19871 showIndent(outfile, level) 19872 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19873 already_processed = [] 19874 self.exportAttributes(outfile, level, already_processed, namespace_, name_='objectPropertiesType') 19875 if self.hasContent_(): 19876 outfile.write('>\n') 19877 self.exportChildren(outfile, level + 1, namespace_, name_) 19878 showIndent(outfile, level) 19879 outfile.write('</%s%s>\n' % (namespace_, name_)) 19880 else: 19881 outfile.write('/>\n')
19882 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='objectPropertiesType'):
19883 pass
19884 - def exportChildren(self, outfile, level, namespace_='maec:', name_='objectPropertiesType', fromsubclass_=False):
19885 for objectProperty_ in self.objectProperty: 19886 objectProperty_.export(outfile, level, namespace_, name_='objectProperty')
19887 - def hasContent_(self):
19888 if ( 19889 self.objectProperty 19890 ): 19891 return True 19892 else: 19893 return False
19894 - def exportLiteral(self, outfile, level, name_='objectPropertiesType'):
19895 level += 1 19896 self.exportLiteralAttributes(outfile, level, [], name_) 19897 if self.hasContent_(): 19898 self.exportLiteralChildren(outfile, level, name_)
19899 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19900 pass
19901 - def exportLiteralChildren(self, outfile, level, name_):
19902 showIndent(outfile, level) 19903 outfile.write('objectProperty=[\n') 19904 level += 1 19905 for objectProperty_ in self.objectProperty: 19906 showIndent(outfile, level) 19907 outfile.write('model_.objectProperty(\n') 19908 objectProperty_.exportLiteral(outfile, level) 19909 showIndent(outfile, level) 19910 outfile.write('),\n') 19911 level -= 1 19912 showIndent(outfile, level) 19913 outfile.write('],\n')
19914 - def build(self, node):
19915 self.buildAttributes(node, node.attrib, []) 19916 for child in node: 19917 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19918 self.buildChildren(child, node, nodeName_)
19919 - def buildAttributes(self, node, attrs, already_processed):
19920 pass
19921 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19922 if nodeName_ == 'objectProperty': 19923 obj_ = objectProperty.factory() 19924 obj_.build(child_) 19925 self.objectProperty.append(obj_)
19926 # end class objectPropertiesType 19927 19928
19929 -class relationshipsType(GeneratedsSuper):
19930 subclass = None 19931 superclass = None
19932 - def __init__(self, relationship=None):
19933 if relationship is None: 19934 self.relationship = [] 19935 else: 19936 self.relationship = relationship
19937 - def factory(*args_, **kwargs_):
19938 if relationshipsType.subclass: 19939 return relationshipsType.subclass(*args_, **kwargs_) 19940 else: 19941 return relationshipsType(*args_, **kwargs_)
19942 factory = staticmethod(factory)
19943 - def get_relationship(self): return self.relationship
19944 - def set_relationship(self, relationship): self.relationship = relationship
19945 - def add_relationship(self, value): self.relationship.append(value)
19946 - def insert_relationship(self, index, value): self.relationship[index] = value
19947 - def export(self, outfile, level, namespace_='maec:', name_='relationshipsType', namespacedef_=''):
19948 showIndent(outfile, level) 19949 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 19950 already_processed = [] 19951 self.exportAttributes(outfile, level, already_processed, namespace_, name_='relationshipsType') 19952 if self.hasContent_(): 19953 outfile.write('>\n') 19954 self.exportChildren(outfile, level + 1, namespace_, name_) 19955 showIndent(outfile, level) 19956 outfile.write('</%s%s>\n' % (namespace_, name_)) 19957 else: 19958 outfile.write('/>\n')
19959 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='relationshipsType'):
19960 pass
19961 - def exportChildren(self, outfile, level, namespace_='maec:', name_='relationshipsType', fromsubclass_=False):
19962 for relationship_ in self.relationship: 19963 relationship_.export(outfile, level, namespace_, name_='relationship')
19964 - def hasContent_(self):
19965 if ( 19966 self.relationship 19967 ): 19968 return True 19969 else: 19970 return False
19971 - def exportLiteral(self, outfile, level, name_='relationshipsType'):
19972 level += 1 19973 self.exportLiteralAttributes(outfile, level, [], name_) 19974 if self.hasContent_(): 19975 self.exportLiteralChildren(outfile, level, name_)
19976 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
19977 pass
19978 - def exportLiteralChildren(self, outfile, level, name_):
19979 showIndent(outfile, level) 19980 outfile.write('relationship=[\n') 19981 level += 1 19982 for relationship_ in self.relationship: 19983 showIndent(outfile, level) 19984 outfile.write('model_.relationship(\n') 19985 relationship_.exportLiteral(outfile, level) 19986 showIndent(outfile, level) 19987 outfile.write('),\n') 19988 level -= 1 19989 showIndent(outfile, level) 19990 outfile.write('],\n')
19991 - def build(self, node):
19992 self.buildAttributes(node, node.attrib, []) 19993 for child in node: 19994 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 19995 self.buildChildren(child, node, nodeName_)
19996 - def buildAttributes(self, node, attrs, already_processed):
19997 pass
19998 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19999 if nodeName_ == 'relationship': 20000 obj_ = relationship.factory() 20001 obj_.build(child_) 20002 self.relationship.append(obj_)
20003 # end class relationshipsType 20004 20005
20006 -class fieldDataType(GeneratedsSuper):
20007 subclass = None 20008 superclass = None
20009 - def __init__(self, fieldDataEntry=None):
20010 if fieldDataEntry is None: 20011 self.fieldDataEntry = [] 20012 else: 20013 self.fieldDataEntry = fieldDataEntry
20014 - def factory(*args_, **kwargs_):
20015 if fieldDataType.subclass: 20016 return fieldDataType.subclass(*args_, **kwargs_) 20017 else: 20018 return fieldDataType(*args_, **kwargs_)
20019 factory = staticmethod(factory)
20020 - def get_fieldDataEntry(self): return self.fieldDataEntry
20021 - def set_fieldDataEntry(self, fieldDataEntry): self.fieldDataEntry = fieldDataEntry
20022 - def add_fieldDataEntry(self, value): self.fieldDataEntry.append(value)
20023 - def insert_fieldDataEntry(self, index, value): self.fieldDataEntry[index] = value
20024 - def export(self, outfile, level, namespace_='maec:', name_='fieldDataType', namespacedef_=''):
20025 showIndent(outfile, level) 20026 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20027 already_processed = [] 20028 self.exportAttributes(outfile, level, already_processed, namespace_, name_='fieldDataType') 20029 if self.hasContent_(): 20030 outfile.write('>\n') 20031 self.exportChildren(outfile, level + 1, namespace_, name_) 20032 showIndent(outfile, level) 20033 outfile.write('</%s%s>\n' % (namespace_, name_)) 20034 else: 20035 outfile.write('/>\n')
20036 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='fieldDataType'):
20037 pass
20038 - def exportChildren(self, outfile, level, namespace_='maec:', name_='fieldDataType', fromsubclass_=False):
20039 for fieldDataEntry_ in self.fieldDataEntry: 20040 fieldDataEntry_.export(outfile, level, namespace_, name_='fieldDataEntry')
20041 - def hasContent_(self):
20042 if ( 20043 self.fieldDataEntry 20044 ): 20045 return True 20046 else: 20047 return False
20048 - def exportLiteral(self, outfile, level, name_='fieldDataType'):
20049 level += 1 20050 self.exportLiteralAttributes(outfile, level, [], name_) 20051 if self.hasContent_(): 20052 self.exportLiteralChildren(outfile, level, name_)
20053 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20054 pass
20055 - def exportLiteralChildren(self, outfile, level, name_):
20056 showIndent(outfile, level) 20057 outfile.write('fieldDataEntry=[\n') 20058 level += 1 20059 for fieldDataEntry_ in self.fieldDataEntry: 20060 showIndent(outfile, level) 20061 outfile.write('model_.fieldDataEntry(\n') 20062 fieldDataEntry_.exportLiteral(outfile, level) 20063 showIndent(outfile, level) 20064 outfile.write('),\n') 20065 level -= 1 20066 showIndent(outfile, level) 20067 outfile.write('],\n')
20068 - def build(self, node):
20069 self.buildAttributes(node, node.attrib, []) 20070 for child in node: 20071 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20072 self.buildChildren(child, node, nodeName_)
20073 - def buildAttributes(self, node, attrs, already_processed):
20074 pass
20075 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20076 if nodeName_ == 'fieldDataEntry': 20077 obj_ = fieldDataEntry.factory() 20078 obj_.build(child_) 20079 self.fieldDataEntry.append(obj_)
20080 # end class fieldDataType 20081 20082
20083 -class extraHashType(GeneratedsSuper):
20084 subclass = None 20085 superclass = None
20086 - def __init__(self, type_=None, valueOf_=None):
20087 self.type_ = _cast(None, type_) 20088 self.valueOf_ = valueOf_
20089 - def factory(*args_, **kwargs_):
20090 if extraHashType.subclass: 20091 return extraHashType.subclass(*args_, **kwargs_) 20092 else: 20093 return extraHashType(*args_, **kwargs_)
20094 factory = staticmethod(factory)
20095 - def get_type(self): return self.type_
20096 - def set_type(self, type_): self.type_ = type_
20097 - def get_valueOf_(self): return self.valueOf_
20098 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
20099 - def export(self, outfile, level, namespace_='maec:', name_='extraHashType', namespacedef_=''):
20100 showIndent(outfile, level) 20101 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20102 already_processed = [] 20103 self.exportAttributes(outfile, level, already_processed, namespace_, name_='extraHashType') 20104 if self.hasContent_(): 20105 outfile.write('>') 20106 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 20107 self.exportChildren(outfile, level + 1, namespace_, name_) 20108 outfile.write('</%s%s>\n' % (namespace_, name_)) 20109 else: 20110 outfile.write('/>\n')
20111 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='extraHashType'):
20112 if self.type_ is not None and 'type_' not in already_processed: 20113 already_processed.append('type_') 20114 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
20115 - def exportChildren(self, outfile, level, namespace_='maec:', name_='extraHashType', fromsubclass_=False):
20116 pass
20117 - def hasContent_(self):
20118 if ( 20119 self.valueOf_ 20120 ): 20121 return True 20122 else: 20123 return False
20124 - def exportLiteral(self, outfile, level, name_='extraHashType'):
20125 level += 1 20126 self.exportLiteralAttributes(outfile, level, [], name_) 20127 if self.hasContent_(): 20128 self.exportLiteralChildren(outfile, level, name_) 20129 showIndent(outfile, level) 20130 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
20131 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20132 if self.type_ is not None and 'type_' not in already_processed: 20133 already_processed.append('type_') 20134 showIndent(outfile, level) 20135 outfile.write('type_ = "%s",\n' % (self.type_,))
20136 - def exportLiteralChildren(self, outfile, level, name_):
20137 pass
20138 - def build(self, node):
20139 self.buildAttributes(node, node.attrib, []) 20140 self.valueOf_ = get_all_text_(node) 20141 for child in node: 20142 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20143 self.buildChildren(child, node, nodeName_)
20144 - def buildAttributes(self, node, attrs, already_processed):
20145 value = find_attr_value_('type', node) 20146 if value is not None and 'type' not in already_processed: 20147 already_processed.append('type') 20148 self.type_ = value
20149 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20150 pass
20151 # end class extraHashType 20152 20153
20154 -class classificationDetailsType(GeneratedsSuper):
20155 subclass = None 20156 superclass = None
20157 - def __init__(self, definitionVersion=None, detectionAddedTimeStamp=None, detectionShippedTimeStamp=None, product=None, productVersion=None):
20158 self.definitionVersion = definitionVersion 20159 self.detectionAddedTimeStamp = detectionAddedTimeStamp 20160 self.detectionShippedTimeStamp = detectionShippedTimeStamp 20161 self.product = product 20162 self.productVersion = productVersion
20163 - def factory(*args_, **kwargs_):
20164 if classificationDetailsType.subclass: 20165 return classificationDetailsType.subclass(*args_, **kwargs_) 20166 else: 20167 return classificationDetailsType(*args_, **kwargs_)
20168 factory = staticmethod(factory)
20169 - def get_definitionVersion(self): return self.definitionVersion
20170 - def set_definitionVersion(self, definitionVersion): self.definitionVersion = definitionVersion
20171 - def get_detectionAddedTimeStamp(self): return self.detectionAddedTimeStamp
20172 - def set_detectionAddedTimeStamp(self, detectionAddedTimeStamp): self.detectionAddedTimeStamp = detectionAddedTimeStamp
20173 - def get_detectionShippedTimeStamp(self): return self.detectionShippedTimeStamp
20174 - def set_detectionShippedTimeStamp(self, detectionShippedTimeStamp): self.detectionShippedTimeStamp = detectionShippedTimeStamp
20175 - def get_product(self): return self.product
20176 - def set_product(self, product): self.product = product
20177 - def get_productVersion(self): return self.productVersion
20178 - def set_productVersion(self, productVersion): self.productVersion = productVersion
20179 - def export(self, outfile, level, namespace_='maec:', name_='classificationDetailsType', namespacedef_=''):
20180 showIndent(outfile, level) 20181 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20182 already_processed = [] 20183 self.exportAttributes(outfile, level, already_processed, namespace_, name_='classificationDetailsType') 20184 if self.hasContent_(): 20185 outfile.write('>\n') 20186 self.exportChildren(outfile, level + 1, namespace_, name_) 20187 showIndent(outfile, level) 20188 outfile.write('</%s%s>\n' % (namespace_, name_)) 20189 else: 20190 outfile.write('/>\n')
20191 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='classificationDetailsType'):
20192 pass
20193 - def exportChildren(self, outfile, level, namespace_='maec:', name_='classificationDetailsType', fromsubclass_=False):
20194 if self.definitionVersion is not None: 20195 showIndent(outfile, level) 20196 outfile.write('<%sdefinitionVersion>%s</%sdefinitionVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.definitionVersion).encode(ExternalEncoding), input_name='definitionVersion'), namespace_)) 20197 if self.detectionAddedTimeStamp is not None: 20198 showIndent(outfile, level) 20199 outfile.write('<%sdetectionAddedTimeStamp>%s</%sdetectionAddedTimeStamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.detectionAddedTimeStamp).encode(ExternalEncoding), input_name='detectionAddedTimeStamp'), namespace_)) 20200 if self.detectionShippedTimeStamp is not None: 20201 showIndent(outfile, level) 20202 outfile.write('<%sdetectionShippedTimeStamp>%s</%sdetectionShippedTimeStamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.detectionShippedTimeStamp).encode(ExternalEncoding), input_name='detectionShippedTimeStamp'), namespace_)) 20203 if self.product is not None: 20204 showIndent(outfile, level) 20205 outfile.write('<%sproduct>%s</%sproduct>\n' % (namespace_, self.gds_format_string(quote_xml(self.product).encode(ExternalEncoding), input_name='product'), namespace_)) 20206 if self.productVersion is not None: 20207 showIndent(outfile, level) 20208 outfile.write('<%sproductVersion>%s</%sproductVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.productVersion).encode(ExternalEncoding), input_name='productVersion'), namespace_))
20209 - def hasContent_(self):
20210 if ( 20211 self.definitionVersion is not None or 20212 self.detectionAddedTimeStamp is not None or 20213 self.detectionShippedTimeStamp is not None or 20214 self.product is not None or 20215 self.productVersion is not None 20216 ): 20217 return True 20218 else: 20219 return False
20220 - def exportLiteral(self, outfile, level, name_='classificationDetailsType'):
20221 level += 1 20222 self.exportLiteralAttributes(outfile, level, [], name_) 20223 if self.hasContent_(): 20224 self.exportLiteralChildren(outfile, level, name_)
20225 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20226 pass
20227 - def exportLiteralChildren(self, outfile, level, name_):
20228 if self.definitionVersion is not None: 20229 showIndent(outfile, level) 20230 outfile.write('definitionVersion=%s,\n' % quote_python(self.definitionVersion).encode(ExternalEncoding)) 20231 if self.detectionAddedTimeStamp is not None: 20232 showIndent(outfile, level) 20233 outfile.write('detectionAddedTimeStamp=%s,\n' % quote_python(self.detectionAddedTimeStamp).encode(ExternalEncoding)) 20234 if self.detectionShippedTimeStamp is not None: 20235 showIndent(outfile, level) 20236 outfile.write('detectionShippedTimeStamp=%s,\n' % quote_python(self.detectionShippedTimeStamp).encode(ExternalEncoding)) 20237 if self.product is not None: 20238 showIndent(outfile, level) 20239 outfile.write('product=%s,\n' % quote_python(self.product).encode(ExternalEncoding)) 20240 if self.productVersion is not None: 20241 showIndent(outfile, level) 20242 outfile.write('productVersion=%s,\n' % quote_python(self.productVersion).encode(ExternalEncoding))
20243 - def build(self, node):
20244 self.buildAttributes(node, node.attrib, []) 20245 for child in node: 20246 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20247 self.buildChildren(child, node, nodeName_)
20248 - def buildAttributes(self, node, attrs, already_processed):
20249 pass
20250 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20251 if nodeName_ == 'definitionVersion': 20252 definitionVersion_ = child_.text 20253 definitionVersion_ = self.gds_validate_string(definitionVersion_, node, 'definitionVersion') 20254 self.definitionVersion = definitionVersion_ 20255 elif nodeName_ == 'detectionAddedTimeStamp': 20256 detectionAddedTimeStamp_ = child_.text 20257 detectionAddedTimeStamp_ = self.gds_validate_string(detectionAddedTimeStamp_, node, 'detectionAddedTimeStamp') 20258 self.detectionAddedTimeStamp = detectionAddedTimeStamp_ 20259 elif nodeName_ == 'detectionShippedTimeStamp': 20260 detectionShippedTimeStamp_ = child_.text 20261 detectionShippedTimeStamp_ = self.gds_validate_string(detectionShippedTimeStamp_, node, 'detectionShippedTimeStamp') 20262 self.detectionShippedTimeStamp = detectionShippedTimeStamp_ 20263 elif nodeName_ == 'product': 20264 product_ = child_.text 20265 product_ = self.gds_validate_string(product_, node, 'product') 20266 self.product = product_ 20267 elif nodeName_ == 'productVersion': 20268 productVersion_ = child_.text 20269 productVersion_ = self.gds_validate_string(productVersion_, node, 'productVersion') 20270 self.productVersion = productVersion_
20271 # end class classificationDetailsType 20272 20273
20274 -class referencesType(GeneratedsSuper):
20275 subclass = None 20276 superclass = None
20277 - def __init__(self, ref=None):
20278 if ref is None: 20279 self.ref = [] 20280 else: 20281 self.ref = ref
20282 - def factory(*args_, **kwargs_):
20283 if referencesType.subclass: 20284 return referencesType.subclass(*args_, **kwargs_) 20285 else: 20286 return referencesType(*args_, **kwargs_)
20287 factory = staticmethod(factory)
20288 - def get_ref(self): return self.ref
20289 - def set_ref(self, ref): self.ref = ref
20290 - def add_ref(self, value): self.ref.append(value)
20291 - def insert_ref(self, index, value): self.ref[index] = value
20292 - def export(self, outfile, level, namespace_='maec:', name_='referencesType', namespacedef_=''):
20293 showIndent(outfile, level) 20294 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20295 already_processed = [] 20296 self.exportAttributes(outfile, level, already_processed, namespace_, name_='referencesType') 20297 if self.hasContent_(): 20298 outfile.write('>\n') 20299 self.exportChildren(outfile, level + 1, namespace_, name_) 20300 showIndent(outfile, level) 20301 outfile.write('</%s%s>\n' % (namespace_, name_)) 20302 else: 20303 outfile.write('/>\n')
20304 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='referencesType'):
20305 pass
20306 - def exportChildren(self, outfile, level, namespace_='maec:', name_='referencesType', fromsubclass_=False):
20307 for ref_ in self.ref: 20308 ref_.export(outfile, level, namespace_, name_='ref')
20309 - def hasContent_(self):
20310 if ( 20311 self.ref 20312 ): 20313 return True 20314 else: 20315 return False
20316 - def exportLiteral(self, outfile, level, name_='referencesType'):
20317 level += 1 20318 self.exportLiteralAttributes(outfile, level, [], name_) 20319 if self.hasContent_(): 20320 self.exportLiteralChildren(outfile, level, name_)
20321 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20322 pass
20323 - def exportLiteralChildren(self, outfile, level, name_):
20324 showIndent(outfile, level) 20325 outfile.write('ref=[\n') 20326 level += 1 20327 for ref_ in self.ref: 20328 showIndent(outfile, level) 20329 outfile.write('model_.reference(\n') 20330 ref_.exportLiteral(outfile, level, name_='reference') 20331 showIndent(outfile, level) 20332 outfile.write('),\n') 20333 level -= 1 20334 showIndent(outfile, level) 20335 outfile.write('],\n')
20336 - def build(self, node):
20337 self.buildAttributes(node, node.attrib, []) 20338 for child in node: 20339 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20340 self.buildChildren(child, node, nodeName_)
20341 - def buildAttributes(self, node, attrs, already_processed):
20342 pass
20343 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20344 if nodeName_ == 'ref': 20345 obj_ = reference.factory() 20346 obj_.build(child_) 20347 self.ref.append(obj_)
20348 # end class referencesType 20349 20350
20351 -class volumeType(GeneratedsSuper):
20352 subclass = None 20353 superclass = None
20354 - def __init__(self, units=None, valueOf_=None):
20355 self.units = _cast(None, units) 20356 self.valueOf_ = valueOf_
20357 - def factory(*args_, **kwargs_):
20358 if volumeType.subclass: 20359 return volumeType.subclass(*args_, **kwargs_) 20360 else: 20361 return volumeType(*args_, **kwargs_)
20362 factory = staticmethod(factory)
20363 - def get_units(self): return self.units
20364 - def set_units(self, units): self.units = units
20365 - def validate_VolumeUnitsEnum(self, value):
20366 # Validate type VolumeUnitsEnum, a restriction on xs:string. 20367 pass
20368 - def get_valueOf_(self): return self.valueOf_
20369 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
20370 - def export(self, outfile, level, namespace_='maec:', name_='volumeType', namespacedef_=''):
20371 showIndent(outfile, level) 20372 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20373 already_processed = [] 20374 self.exportAttributes(outfile, level, already_processed, namespace_, name_='volumeType') 20375 if self.hasContent_(): 20376 outfile.write('>') 20377 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 20378 self.exportChildren(outfile, level + 1, namespace_, name_) 20379 outfile.write('</%s%s>\n' % (namespace_, name_)) 20380 else: 20381 outfile.write('/>\n')
20382 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='volumeType'):
20383 if self.units is not None and 'units' not in already_processed: 20384 already_processed.append('units') 20385 outfile.write(' units=%s' % (quote_attrib(self.units), ))
20386 - def exportChildren(self, outfile, level, namespace_='maec:', name_='volumeType', fromsubclass_=False):
20387 pass
20388 - def hasContent_(self):
20389 if ( 20390 self.valueOf_ 20391 ): 20392 return True 20393 else: 20394 return False
20395 - def exportLiteral(self, outfile, level, name_='volumeType'):
20396 level += 1 20397 self.exportLiteralAttributes(outfile, level, [], name_) 20398 if self.hasContent_(): 20399 self.exportLiteralChildren(outfile, level, name_) 20400 showIndent(outfile, level) 20401 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
20402 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20403 if self.units is not None and 'units' not in already_processed: 20404 already_processed.append('units') 20405 showIndent(outfile, level) 20406 outfile.write('units = "%s",\n' % (self.units,))
20407 - def exportLiteralChildren(self, outfile, level, name_):
20408 pass
20409 - def build(self, node):
20410 self.buildAttributes(node, node.attrib, []) 20411 self.valueOf_ = get_all_text_(node) 20412 for child in node: 20413 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20414 self.buildChildren(child, node, nodeName_)
20415 - def buildAttributes(self, node, attrs, already_processed):
20416 value = find_attr_value_('units', node) 20417 if value is not None and 'units' not in already_processed: 20418 already_processed.append('units') 20419 self.units = value 20420 self.validate_VolumeUnitsEnum(self.units) # validate type VolumeUnitsEnum
20421 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20422 pass
20423 # end class volumeType 20424 20425
20426 -class locationType(GeneratedsSuper):
20427 subclass = None 20428 superclass = None
20429 - def __init__(self, type_=None, valueOf_=None):
20430 self.type_ = _cast(None, type_) 20431 self.valueOf_ = valueOf_
20432 - def factory(*args_, **kwargs_):
20433 if locationType.subclass: 20434 return locationType.subclass(*args_, **kwargs_) 20435 else: 20436 return locationType(*args_, **kwargs_)
20437 factory = staticmethod(factory)
20438 - def get_type(self): return self.type_
20439 - def set_type(self, type_): self.type_ = type_
20440 - def validate_LocationTypeEnum(self, value):
20441 # Validate type LocationTypeEnum, a restriction on xs:string. 20442 pass
20443 - def get_valueOf_(self): return self.valueOf_
20444 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
20445 - def export(self, outfile, level, namespace_='maec:', name_='locationType', namespacedef_=''):
20446 showIndent(outfile, level) 20447 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20448 already_processed = [] 20449 self.exportAttributes(outfile, level, already_processed, namespace_, name_='locationType') 20450 if self.hasContent_(): 20451 outfile.write('>') 20452 outfile.write(str(self.valueOf_).encode(ExternalEncoding)) 20453 self.exportChildren(outfile, level + 1, namespace_, name_) 20454 outfile.write('</%s%s>\n' % (namespace_, name_)) 20455 else: 20456 outfile.write('/>\n')
20457 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='locationType'):
20458 if self.type_ is not None and 'type_' not in already_processed: 20459 already_processed.append('type_') 20460 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
20461 - def exportChildren(self, outfile, level, namespace_='maec:', name_='locationType', fromsubclass_=False):
20462 pass
20463 - def hasContent_(self):
20464 if ( 20465 self.valueOf_ 20466 ): 20467 return True 20468 else: 20469 return False
20470 - def exportLiteral(self, outfile, level, name_='locationType'):
20471 level += 1 20472 self.exportLiteralAttributes(outfile, level, [], name_) 20473 if self.hasContent_(): 20474 self.exportLiteralChildren(outfile, level, name_) 20475 showIndent(outfile, level) 20476 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
20477 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20478 if self.type_ is not None and 'type_' not in already_processed: 20479 already_processed.append('type_') 20480 showIndent(outfile, level) 20481 outfile.write('type_ = "%s",\n' % (self.type_,))
20482 - def exportLiteralChildren(self, outfile, level, name_):
20483 pass
20484 - def build(self, node):
20485 self.buildAttributes(node, node.attrib, []) 20486 self.valueOf_ = get_all_text_(node) 20487 for child in node: 20488 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20489 self.buildChildren(child, node, nodeName_)
20490 - def buildAttributes(self, node, attrs, already_processed):
20491 value = find_attr_value_('type', node) 20492 if value is not None and 'type' not in already_processed: 20493 already_processed.append('type') 20494 self.type_ = value 20495 self.validate_LocationTypeEnum(self.type_) # validate type LocationTypeEnum
20496 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20497 pass
20498 # end class locationType 20499 20500
20501 -class referencesType1(GeneratedsSuper):
20502 subclass = None 20503 superclass = None
20504 - def __init__(self, ref=None):
20505 if ref is None: 20506 self.ref = [] 20507 else: 20508 self.ref = ref
20509 - def factory(*args_, **kwargs_):
20510 if referencesType1.subclass: 20511 return referencesType1.subclass(*args_, **kwargs_) 20512 else: 20513 return referencesType1(*args_, **kwargs_)
20514 factory = staticmethod(factory)
20515 - def get_ref(self): return self.ref
20516 - def set_ref(self, ref): self.ref = ref
20517 - def add_ref(self, value): self.ref.append(value)
20518 - def insert_ref(self, index, value): self.ref[index] = value
20519 - def export(self, outfile, level, namespace_='maec:', name_='referencesType1', namespacedef_=''):
20520 showIndent(outfile, level) 20521 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20522 already_processed = [] 20523 self.exportAttributes(outfile, level, already_processed, namespace_, name_='referencesType1') 20524 if self.hasContent_(): 20525 outfile.write('>\n') 20526 self.exportChildren(outfile, level + 1, namespace_, name_) 20527 showIndent(outfile, level) 20528 outfile.write('</%s%s>\n' % (namespace_, name_)) 20529 else: 20530 outfile.write('/>\n')
20531 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='referencesType1'):
20532 pass
20533 - def exportChildren(self, outfile, level, namespace_='maec:', name_='referencesType1', fromsubclass_=False):
20534 for ref_ in self.ref: 20535 ref_.export(outfile, level, namespace_, name_='ref')
20536 - def hasContent_(self):
20537 if ( 20538 self.ref 20539 ): 20540 return True 20541 else: 20542 return False
20543 - def exportLiteral(self, outfile, level, name_='referencesType1'):
20544 level += 1 20545 self.exportLiteralAttributes(outfile, level, [], name_) 20546 if self.hasContent_(): 20547 self.exportLiteralChildren(outfile, level, name_)
20548 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20549 pass
20550 - def exportLiteralChildren(self, outfile, level, name_):
20551 showIndent(outfile, level) 20552 outfile.write('ref=[\n') 20553 level += 1 20554 for ref_ in self.ref: 20555 showIndent(outfile, level) 20556 outfile.write('model_.reference(\n') 20557 ref_.exportLiteral(outfile, level, name_='reference') 20558 showIndent(outfile, level) 20559 outfile.write('),\n') 20560 level -= 1 20561 showIndent(outfile, level) 20562 outfile.write('],\n')
20563 - def build(self, node):
20564 self.buildAttributes(node, node.attrib, []) 20565 for child in node: 20566 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20567 self.buildChildren(child, node, nodeName_)
20568 - def buildAttributes(self, node, attrs, already_processed):
20569 pass
20570 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20571 if nodeName_ == 'ref': 20572 obj_ = reference.factory() 20573 obj_.build(child_) 20574 self.ref.append(obj_)
20575 # end class referencesType1 20576 20577
20578 -class sourceType(GeneratedsSuper):
20579 subclass = None 20580 superclass = None
20581 - def __init__(self, ref=None):
20582 if ref is None: 20583 self.ref = [] 20584 else: 20585 self.ref = ref
20586 - def factory(*args_, **kwargs_):
20587 if sourceType.subclass: 20588 return sourceType.subclass(*args_, **kwargs_) 20589 else: 20590 return sourceType(*args_, **kwargs_)
20591 factory = staticmethod(factory)
20592 - def get_ref(self): return self.ref
20593 - def set_ref(self, ref): self.ref = ref
20594 - def add_ref(self, value): self.ref.append(value)
20595 - def insert_ref(self, index, value): self.ref[index] = value
20596 - def export(self, outfile, level, namespace_='maec:', name_='sourceType', namespacedef_=''):
20597 showIndent(outfile, level) 20598 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20599 already_processed = [] 20600 self.exportAttributes(outfile, level, already_processed, namespace_, name_='sourceType') 20601 if self.hasContent_(): 20602 outfile.write('>\n') 20603 self.exportChildren(outfile, level + 1, namespace_, name_) 20604 showIndent(outfile, level) 20605 outfile.write('</%s%s>\n' % (namespace_, name_)) 20606 else: 20607 outfile.write('/>\n')
20608 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='sourceType'):
20609 pass
20610 - def exportChildren(self, outfile, level, namespace_='maec:', name_='sourceType', fromsubclass_=False):
20611 for ref_ in self.ref: 20612 ref_.export(outfile, level, namespace_, name_='ref')
20613 - def hasContent_(self):
20614 if ( 20615 self.ref 20616 ): 20617 return True 20618 else: 20619 return False
20620 - def exportLiteral(self, outfile, level, name_='sourceType'):
20621 level += 1 20622 self.exportLiteralAttributes(outfile, level, [], name_) 20623 if self.hasContent_(): 20624 self.exportLiteralChildren(outfile, level, name_)
20625 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20626 pass
20627 - def exportLiteralChildren(self, outfile, level, name_):
20628 showIndent(outfile, level) 20629 outfile.write('ref=[\n') 20630 level += 1 20631 for ref_ in self.ref: 20632 showIndent(outfile, level) 20633 outfile.write('model_.reference(\n') 20634 ref_.exportLiteral(outfile, level, name_='reference') 20635 showIndent(outfile, level) 20636 outfile.write('),\n') 20637 level -= 1 20638 showIndent(outfile, level) 20639 outfile.write('],\n')
20640 - def build(self, node):
20641 self.buildAttributes(node, node.attrib, []) 20642 for child in node: 20643 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20644 self.buildChildren(child, node, nodeName_)
20645 - def buildAttributes(self, node, attrs, already_processed):
20646 pass
20647 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20648 if nodeName_ == 'ref': 20649 obj_ = reference.factory() 20650 obj_.build(child_) 20651 self.ref.append(obj_)
20652 # end class sourceType 20653 20654
20655 -class targetType(GeneratedsSuper):
20656 subclass = None 20657 superclass = None
20658 - def __init__(self, ref=None):
20659 if ref is None: 20660 self.ref = [] 20661 else: 20662 self.ref = ref
20663 - def factory(*args_, **kwargs_):
20664 if targetType.subclass: 20665 return targetType.subclass(*args_, **kwargs_) 20666 else: 20667 return targetType(*args_, **kwargs_)
20668 factory = staticmethod(factory)
20669 - def get_ref(self): return self.ref
20670 - def set_ref(self, ref): self.ref = ref
20671 - def add_ref(self, value): self.ref.append(value)
20672 - def insert_ref(self, index, value): self.ref[index] = value
20673 - def export(self, outfile, level, namespace_='maec:', name_='targetType', namespacedef_=''):
20674 showIndent(outfile, level) 20675 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) 20676 already_processed = [] 20677 self.exportAttributes(outfile, level, already_processed, namespace_, name_='targetType') 20678 if self.hasContent_(): 20679 outfile.write('>\n') 20680 self.exportChildren(outfile, level + 1, namespace_, name_) 20681 showIndent(outfile, level) 20682 outfile.write('</%s%s>\n' % (namespace_, name_)) 20683 else: 20684 outfile.write('/>\n')
20685 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='targetType'):
20686 pass
20687 - def exportChildren(self, outfile, level, namespace_='maec:', name_='targetType', fromsubclass_=False):
20688 for ref_ in self.ref: 20689 ref_.export(outfile, level, namespace_, name_='ref')
20690 - def hasContent_(self):
20691 if ( 20692 self.ref 20693 ): 20694 return True 20695 else: 20696 return False
20697 - def exportLiteral(self, outfile, level, name_='targetType'):
20698 level += 1 20699 self.exportLiteralAttributes(outfile, level, [], name_) 20700 if self.hasContent_(): 20701 self.exportLiteralChildren(outfile, level, name_)
20702 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
20703 pass
20704 - def exportLiteralChildren(self, outfile, level, name_):
20705 showIndent(outfile, level) 20706 outfile.write('ref=[\n') 20707 level += 1 20708 for ref_ in self.ref: 20709 showIndent(outfile, level) 20710 outfile.write('model_.reference(\n') 20711 ref_.exportLiteral(outfile, level, name_='reference') 20712 showIndent(outfile, level) 20713 outfile.write('),\n') 20714 level -= 1 20715 showIndent(outfile, level) 20716 outfile.write('],\n')
20717 - def build(self, node):
20718 self.buildAttributes(node, node.attrib, []) 20719 for child in node: 20720 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] 20721 self.buildChildren(child, node, nodeName_)
20722 - def buildAttributes(self, node, attrs, already_processed):
20723 pass
20724 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20725 if nodeName_ == 'ref': 20726 obj_ = reference.factory() 20727 obj_.build(child_) 20728 self.ref.append(obj_)
20729 # end class targetType 20730 20731 20732 USAGE_TEXT = """ 20733 Usage: python <Parser>.py [ -s ] <in_xml_file> 20734 """ 20735
20736 -def usage():
20737 print USAGE_TEXT 20738 sys.exit(1)
20739 20740
20741 -def get_root_tag(node):
20742 tag = Tag_pattern_.match(node.tag).groups()[-1] 20743 rootClass = globals().get(tag) 20744 return tag, rootClass
20745 20746
20747 -def parse(inFileName):
20748 doc = parsexml_(inFileName) 20749 rootNode = doc.getroot() 20750 rootTag, rootClass = get_root_tag(rootNode) 20751 if rootClass is None: 20752 rootTag = 'MAEC_Bundle' 20753 rootClass = BundleType 20754 rootObj = rootClass.factory() 20755 rootObj.build(rootNode) 20756 # Enable Python to collect the space used by the DOM. 20757 doc = None 20758 sys.stdout.write('<?xml version="1.0" ?>\n') 20759 rootObj.export(sys.stdout, 0, name_=rootTag, 20760 namespacedef_='') 20761 return rootObj
20762 20763
20764 -def parseString(inString):
20765 from StringIO import StringIO 20766 doc = parsexml_(StringIO(inString)) 20767 rootNode = doc.getroot() 20768 rootTag, rootClass = get_root_tag(rootNode) 20769 if rootClass is None: 20770 rootTag = 'MAEC_Bundle' 20771 rootClass = BundleType 20772 rootObj = rootClass.factory() 20773 rootObj.build(rootNode) 20774 # Enable Python to collect the space used by the DOM. 20775 doc = None 20776 sys.stdout.write('<?xml version="1.0" ?>\n') 20777 rootObj.export(sys.stdout, 0, name_="MAEC_Bundle", 20778 namespacedef_='') 20779 return rootObj
20780 20781
20782 -def parseLiteral(inFileName):
20783 doc = parsexml_(inFileName) 20784 rootNode = doc.getroot() 20785 rootTag, rootClass = get_root_tag(rootNode) 20786 if rootClass is None: 20787 rootTag = 'MAEC_Bundle' 20788 rootClass = BundleType 20789 rootObj = rootClass.factory() 20790 rootObj.build(rootNode) 20791 # Enable Python to collect the space used by the DOM. 20792 doc = None 20793 sys.stdout.write('#from maec import *\n\n') 20794 sys.stdout.write('import maec as model_\n\n') 20795 sys.stdout.write('rootObj = model_.rootTag(\n') 20796 rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) 20797 sys.stdout.write(')\n') 20798 return rootObj
20799 20800
20801 -def main():
20802 args = sys.argv[1:] 20803 if len(args) == 1: 20804 parse(args[0]) 20805 else: 20806 usage()
20807 20808 20809 if __name__ == '__main__': 20810 #import pdb; pdb.set_trace() 20811 main() 20812 20813 20814 __all__ = [ 20815 "APICallType", 20816 "APICall_ParameterType", 20817 "ASNObject", 20818 "ActionCollectionType", 20819 "ActionImplementationType", 20820 "ActionReferenceType", 20821 "ActionType", 20822 "Action_Collection_PoolType", 20823 "Action_InitiatorType", 20824 "Action_PoolType", 20825 "ActionsType", 20826 "ActionsType1", 20827 "Affected_ObjectType", 20828 "Affected_ObjectsType", 20829 "AnalysesType", 20830 "AnalysisType", 20831 "Analysis_EnvironmentType", 20832 "AnalystsType", 20833 "Associated_CodeType", 20834 "Associated_Code_SnippetType", 20835 "Attempted_Vulnerability_ExploitType", 20836 "BehaviorCollectionType", 20837 "BehaviorReferenceType", 20838 "BehaviorType", 20839 "Behavior_Collection_PoolType", 20840 "Behavior_PoolType", 20841 "BehaviorsType", 20842 "Block", 20843 "BundleType", 20844 "CPESpecificationType", 20845 "CVEVulnerabilityType", 20846 "CertificateType", 20847 "Child_ProcessesType", 20848 "ClassificationsType", 20849 "CodeType", 20850 "Constituent_EffectsType", 20851 "Custom_AttributeType", 20852 "Custom_Object_AttributesType", 20853 "DOS_HeaderType", 20854 "Daemon_Action_AttributesType", 20855 "Daemon_Object_AttributesType", 20856 "DataType", 20857 "Data_DirectoryType", 20858 "Data_HashesType", 20859 "Data_SizeType", 20860 "Digital_CertificatesType", 20861 "DiscoveryMethod", 20862 "EffectCollectionType", 20863 "EffectReferenceType", 20864 "EffectType", 20865 "Effect_PoolType", 20866 "EffectsType", 20867 "EffectsType1", 20868 "EffectsType2", 20869 "EffectsType3", 20870 "Enivironment_VariablesType", 20871 "Enumerated_DaemonsType", 20872 "Environment_VariableType", 20873 "Event_Type", 20874 "ExportsType", 20875 "File_HeaderType", 20876 "File_System_Action_AttributesType", 20877 "File_System_Object_AttributesType", 20878 "File_TypeType", 20879 "File_Type_AttributesType", 20880 "GUI_Object_AttributesType", 20881 "HandleType", 20882 "HandlesType", 20883 "HashType", 20884 "HashesType", 20885 "HashesType1", 20886 "HashesType2", 20887 "HashesType3", 20888 "HashesType4", 20889 "HashesType5", 20890 "HashesType6", 20891 "HashesType7", 20892 "Header_HashesType", 20893 "HeadersType", 20894 "IPAddress", 20895 "IPC_Action_AttributesType", 20896 "IPC_Object_AttributesType", 20897 "IPObject", 20898 "ImageType", 20899 "ImageType1", 20900 "ImageType2", 20901 "ImagesType", 20902 "ImagesType1", 20903 "ImagesType2", 20904 "Imported_FunctionType", 20905 "Imported_FunctionsType", 20906 "ImportsType", 20907 "Internet_Action_AttributesType", 20908 "Internet_Object_AttributesType", 20909 "Library_Type", 20910 "Memory_Action_AttributesType", 20911 "Memory_Object_AttributesType", 20912 "Module_Action_AttributesType", 20913 "Module_Object_AttributesType", 20914 "Nature_Of_Relationship", 20915 "Nature_of_Relationship", 20916 "Network_Action_AttributesType", 20917 "Network_Object_AttributesType", 20918 "NotesType", 20919 "ObjectCollectionType", 20920 "ObjectReferenceType", 20921 "ObjectType", 20922 "Object_Collection_PoolType", 20923 "Object_PoolType", 20924 "Object_SizeType", 20925 "ObjectsType", 20926 "ObjectsType1", 20927 "Optional_HeaderType", 20928 "PEDataDirectoryStruct", 20929 "PEExportType", 20930 "PEImportType", 20931 "PEResourceType", 20932 "PESectionHeaderStruct", 20933 "PESectionType", 20934 "PEStringType", 20935 "PE_Binary_AttributesType", 20936 "PE_HeaderType", 20937 "Packer_TypeType", 20938 "PackingType", 20939 "PathType", 20940 "PoolsType", 20941 "Process_Action_AttributesType", 20942 "Process_Object_AttributesType", 20943 "PurposeType", 20944 "Registry_Action_AttributesType", 20945 "Registry_Object_AttributesType", 20946 "Related_ActionType", 20947 "Related_ActionsType", 20948 "Related_BehaviorType", 20949 "Related_BehaviorsType", 20950 "Related_ObjectType", 20951 "Related_ObjectsType", 20952 "ResourcesType", 20953 "Section_TableType", 20954 "SectionsType", 20955 "Service_Type", 20956 "Socket_Type", 20957 "SourceType", 20958 "StringsType", 20959 "StructuredTextType", 20960 "SubjectType", 20961 "System_Action_AttributesType", 20962 "TitleType", 20963 "ToolType", 20964 "Tools_UsedType", 20965 "TrID_TypeType", 20966 "ValueType", 20967 "Version_BlockType", 20968 "Vulnerability_ExploitType", 20969 "classificationDetailsType", 20970 "classificationObject", 20971 "domainObject", 20972 "entityObject", 20973 "extraHashType", 20974 "fieldDataEntry", 20975 "fieldDataType", 20976 "fileObject", 20977 "locationType", 20978 "malwareMetaData", 20979 "meta_item_metadataType", 20980 "objectPropertiesType", 20981 "objectProperty", 20982 "objectsType", 20983 "property", 20984 "reference", 20985 "referencesType", 20986 "referencesType1", 20987 "registryObject", 20988 "relationship", 20989 "relationshipsType", 20990 "sourceType", 20991 "targetType", 20992 "uriObject", 20993 "volumeType" 20994 ] 20995