当前位置: 首页>>代码示例>>Python>>正文


Python PatternFieldGroup.to_obj方法代码示例

本文整理汇总了Python中cybox.common.PatternFieldGroup.to_obj方法的典型用法代码示例。如果您正苦于以下问题:Python PatternFieldGroup.to_obj方法的具体用法?Python PatternFieldGroup.to_obj怎么用?Python PatternFieldGroup.to_obj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cybox.common.PatternFieldGroup的用法示例。


在下文中一共展示了PatternFieldGroup.to_obj方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: to_obj

# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import to_obj [as 别名]
    def to_obj(self):
        attr_obj = self._binding_class()

        attr_obj.set_valueOf_(normalize_to_xml(self.serialized_value))
        # For now, don't output the datatype, as it is not required and is
        # usually not needed, as it can be inferred from the context.
        #attr_obj.set_datatype(self.datatype)

        if self.id_ is not None:
            attr_obj.set_id(self.id_)
        if self.idref is not None:
            attr_obj.set_idref(self.idref)
        if self.appears_random is not None:
            attr_obj.set_appears_random(self.appears_random)
        if self.is_obfuscated is not None:
            attr_obj.set_is_obfuscated(self.is_obfuscated)
        if self.obfuscation_algorithm_ref is not None:
            attr_obj.set_obfuscation_algorithm_ref(self.obfuscation_algorithm_ref)
        if self.is_defanged is not None:
            attr_obj.set_is_defanged(self.is_defanged)
        if self.defanging_algorithm_ref is not None:
            attr_obj.set_defanging_algorithm_ref(self.defanging_algorithm_ref)
        if self.refanging_transform_type is not None:
            attr_obj.set_refanging_transform_type(self.refanging_transform_type)
        if self.refanging_transform is not None:
            attr_obj.set_refanging_transform(self.refanging_transform)
        #Datatype output logic
        if self._force_datatype:
            attr_obj.set_datatype(self.datatype)
        else:
            attr_obj.set_datatype(None)

        PatternFieldGroup.to_obj(self, attr_obj)

        return attr_obj
开发者ID:bauer1j,项目名称:python-cybox,代码行数:37,代码来源:properties.py

示例2: to_obj

# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import to_obj [as 别名]
    def to_obj(self):
        vocab_obj = common_binding.ControlledVocabularyStringType()

        vocab_obj.set_valueOf_(normalize_to_xml(self.value, self.delimiter))
        vocab_obj.set_xsi_type(self.xsi_type)

        if self.vocab_name is not None:
            vocab_obj.set_vocab_name(self.vocab_name)
        if self.vocab_reference is not None:
            vocab_obj.set_vocab_reference(self.vocab_reference)

        PatternFieldGroup.to_obj(self, vocab_obj)

        return vocab_obj
开发者ID:treyka,项目名称:python-cybox,代码行数:16,代码来源:vocabs.py

示例3: to_obj

# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import to_obj [as 别名]
    def to_obj(self, return_obj=None, ns_info=None):
        self._collect_ns_info(ns_info)

        if not return_obj:
            return_obj = self._binding_class()
            
        return_obj.valueOf_ = normalize_to_xml(self.value, self.delimiter)
        return_obj.xsi_type = self.xsi_type

        if self.vocab_name is not None:
            return_obj.vocab_name = self.vocab_name
        if self.vocab_reference is not None:
            return_obj.vocab_reference = self.vocab_reference

        PatternFieldGroup.to_obj(self, return_obj=return_obj, ns_info=ns_info)

        return return_obj
开发者ID:aravindpfpt,项目名称:python-cybox,代码行数:19,代码来源:vocabs.py

示例4: to_obj

# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import to_obj [as 别名]
    def to_obj(self):
        if not self.is_valid():
            raise ValueError("Vocab being used has not been specified")

        vocab_obj = common_binding.ControlledVocabularyStringType()

        vocab_obj.set_valueOf_(normalize_to_xml(self.value, self.delimiter))
        vocab_obj.set_xsi_type(self.xsi_type)

        if self.vocab_name is not None:
            vocab_obj.set_vocab_name(self.vocab_name)
        if self.vocab_reference is not None:
            vocab_obj.set_vocab_reference(self.vocab_reference)

        PatternFieldGroup.to_obj(self, vocab_obj)

        return vocab_obj
开发者ID:ChrisNolan1992,项目名称:python-cybox,代码行数:19,代码来源:vocabs.py

示例5: to_obj

# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import to_obj [as 别名]
    def to_obj(self, return_obj=None, ns_info=None):
        if not self.is_valid():
            raise ValueError("Vocab being used has not been specified")

        self._collect_ns_info(ns_info)
        vocab_obj = common_binding.ControlledVocabularyStringType()

        vocab_obj.valueOf_ = normalize_to_xml(self.value, self.delimiter)
        vocab_obj.xsi_type = self.xsi_type

        if self.vocab_name is not None:
            vocab_obj.vocab_name = self.vocab_name
        if self.vocab_reference is not None:
            vocab_obj.vocab_reference = self.vocab_reference

        PatternFieldGroup.to_obj(self, return_obj=vocab_obj, ns_info=ns_info)

        return vocab_obj
开发者ID:luisgf,项目名称:watsondt,代码行数:20,代码来源:vocabs.py

示例6: to_obj

# 需要导入模块: from cybox.common import PatternFieldGroup [as 别名]
# 或者: from cybox.common.PatternFieldGroup import to_obj [as 别名]
    def to_obj(self, return_obj=None, ns_info=None):
        self._collect_ns_info(ns_info)

        attr_obj = self._binding_class()
        attr_obj.set_valueOf_(normalize_to_xml(self.serialized_value,
                                               self.delimiter))
        # For now, don't output the datatype, as it is not required and is
        # usually not needed, as it can be inferred from the context.
        #attr_obj.datatype = self.datatype

        if self.id_ is not None:
            attr_obj.id = self.id_
        if self.idref is not None:
            attr_obj.idref = self.idref
        if self.appears_random is not None:
            attr_obj.appears_random = self.appears_random
        if self.is_obfuscated is not None:
            attr_obj.is_obfuscated = self.is_obfuscated
        if self.obfuscation_algorithm_ref is not None:
            attr_obj.obfuscation_algorithm_ref = self.obfuscation_algorithm_ref
        if self.is_defanged is not None:
            attr_obj.is_defanged = self.is_defanged
        if self.defanging_algorithm_ref is not None:
            attr_obj.defanging_algorithm_ref = self.defanging_algorithm_ref
        if self.refanging_transform_type is not None:
            attr_obj.refanging_transform_type = self.refanging_transform_type
        if self.refanging_transform is not None:
            attr_obj.refanging_transform = self.refanging_transform
        if self.observed_encoding is not None:
            attr_obj.observed_encoding = self.observed_encoding
        #Datatype output logic
        if self._force_datatype or (self.datatype != self.default_datatype):
            attr_obj.datatype = self.datatype
        else:
            attr_obj.datatype = None

        PatternFieldGroup.to_obj(self, return_obj=attr_obj, ns_info=ns_info)

        return attr_obj
开发者ID:luisgf,项目名称:watsondt,代码行数:41,代码来源:properties.py


注:本文中的cybox.common.PatternFieldGroup.to_obj方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。