spdx_tools.spdx3.model.spdx_collection
1# SPDX-FileCopyrightText: 2023 spdx contributors 2# 3# SPDX-License-Identifier: Apache-2.0 4from abc import abstractmethod 5from dataclasses import field 6 7from beartype.typing import List 8 9from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties 10from spdx_tools.spdx3.model import Element, ExternalMap, NamespaceMap 11 12 13@dataclass_with_properties 14class ElementCollection(Element): 15 # due to the inheritance we need to make all fields non-default in the __annotation__, 16 # the __init__ method still raises an error if required fields are not set 17 element: List[str] = field(default_factory=list) 18 root_element: List[str] = field(default_factory=list) 19 namespaces: List[NamespaceMap] = field(default_factory=list) 20 imports: List[ExternalMap] = field(default_factory=list) 21 22 @abstractmethod 23 def __init__(self): 24 pass
14@dataclass_with_properties 15class ElementCollection(Element): 16 # due to the inheritance we need to make all fields non-default in the __annotation__, 17 # the __init__ method still raises an error if required fields are not set 18 element: List[str] = field(default_factory=list) 19 root_element: List[str] = field(default_factory=list) 20 namespaces: List[NamespaceMap] = field(default_factory=list) 21 imports: List[ExternalMap] = field(default_factory=list) 22 23 @abstractmethod 24 def __init__(self): 25 pass
namespaces: list[spdx_tools.spdx3.model.namespace_map.NamespaceMap]
imports: list[spdx_tools.spdx3.model.external_map.ExternalMap]