本文整理汇总了Python中cybox.common.PatternFieldGroup.from_obj方法的典型用法代码示例。如果您正苦于以下问题:Python PatternFieldGroup.from_obj方法的具体用法?Python PatternFieldGroup.from_obj怎么用?Python PatternFieldGroup.from_obj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cybox.common.PatternFieldGroup
的用法示例。
在下文中一共展示了PatternFieldGroup.from_obj方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _populate_from_obj
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import from_obj [as 别名]
def _populate_from_obj(self, attr_obj):
self.value = denormalize_from_xml(attr_obj.get_valueOf_())
self.id_ = attr_obj.get_id()
self.idref = attr_obj.get_idref()
self.datatype = attr_obj.get_datatype()
self.appears_random = attr_obj.get_appears_random()
self.is_obfuscated = attr_obj.get_is_obfuscated()
self.obfuscation_algorithm_ref = attr_obj.get_obfuscation_algorithm_ref()
self.is_defanged = attr_obj.get_is_defanged()
self.defanging_algorithm_ref = attr_obj.get_defanging_algorithm_ref()
self.refanging_transform_type = attr_obj.get_refanging_transform_type()
self.refanging_transform = attr_obj.get_refanging_transform()
PatternFieldGroup.from_obj(attr_obj, self)
示例2: from_obj
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import from_obj [as 别名]
def from_obj(cls, vocab_obj):
if not vocab_obj:
return None
vocab_str = cls()
# xsi_type should be set automatically by the class's constructor.
vocab_str.value = denormalize_from_xml(vocab_obj.get_valueOf_())
vocab_str.vocab_name = vocab_obj.get_vocab_name()
vocab_str.vocab_reference = vocab_obj.get_vocab_reference()
vocab_str.xsi_type = vocab_obj.get_xsi_type()
PatternFieldGroup.from_obj(vocab_obj, vocab_str)
return vocab_str
示例3: from_obj
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import from_obj [as 别名]
def from_obj(cls, vocab_obj):
if not vocab_obj:
return None
vocab_str = cls()
# xsi_type should be set automatically by the class's constructor.
vocab_str.vocab_name = vocab_obj.vocab_name
vocab_str.vocab_reference = vocab_obj.vocab_reference
vocab_str.xsi_type = vocab_obj.xsi_type
PatternFieldGroup.from_obj(vocab_obj, vocab_str)
# We need to check for a non-default delimiter before trying to parse
# the value.
vocab_str.value = denormalize_from_xml(vocab_obj.valueOf_,
vocab_str.delimiter)
return vocab_str
示例4: _populate_from_obj
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import from_obj [as 别名]
def _populate_from_obj(self, attr_obj):
self.id_ = attr_obj.id
self.idref = attr_obj.idref
self.datatype = attr_obj.datatype
self.appears_random = attr_obj.appears_random
self.is_obfuscated = attr_obj.is_obfuscated
self.obfuscation_algorithm_ref = attr_obj.obfuscation_algorithm_ref
self.is_defanged = attr_obj.is_defanged
self.defanging_algorithm_ref = attr_obj.defanging_algorithm_ref
self.refanging_transform_type = attr_obj.refanging_transform_type
self.refanging_transform = attr_obj.refanging_transform
self.observed_encoding = attr_obj.observed_encoding
PatternFieldGroup.from_obj(attr_obj, self)
# We need to check for a non-default delimiter before trying to parse
# the value.
self.value = denormalize_from_xml(attr_obj.valueOf_,
self.delimiter)
示例5: from_obj
# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import from_obj [as 别名]
def from_obj(cls, vocab_obj, return_obj=None):
if not vocab_obj:
return None
if not return_obj:
klass = VocabString.lookup_class(vocab_obj.xsi_type)
return_obj = klass()
# xsi_type should be set automatically by the class's constructor.
return_obj.vocab_name = vocab_obj.vocab_name
return_obj.vocab_reference = vocab_obj.vocab_reference
return_obj.xsi_type = vocab_obj.xsi_type
PatternFieldGroup.from_obj(vocab_obj, return_obj)
# We need to check for a non-default delimiter before trying to parse
# the value.
return_obj.value = denormalize_from_xml(
value=vocab_obj.valueOf_,
delimiter=return_obj.delimiter
)
return return_obj