Class: QgsAbstractMetadataBaseValidator

class qgis.core.QgsAbstractMetadataBaseValidator

Bases: sip.wrapper

Abstract base class for metadata validators.

Methods

validate

Validates a metadata object, and returns True if the metadata is considered valid.

class ValidationResult

Bases: sip.wrapper

Contains the parameters describing a metadata validation failure.

New in version 3.0.

QgsAbstractMetadataBaseValidator.ValidationResult(section: str, note: str, identifier: Any = None) Constructor for ValidationResult.

QgsAbstractMetadataBaseValidator.ValidationResult(QgsAbstractMetadataBaseValidator.ValidationResult)

property identifier

_identifier(self) -> Any Returns the optional identifier for the failed metadata item. For instance, in list type metadata elements this will be set to the list index of the failed metadata item.

Return type

Any

note
section
validate(self, metadata: QgsAbstractMetadataBase)Tuple[bool, List[QgsAbstractMetadataBaseValidator.ValidationResult]]

Validates a metadata object, and returns True if the metadata is considered valid. If validation fails, the results list will be filled with a list of items describing why the validation failed and what needs to be rectified to fix the metadata.

Parameters

metadata (QgsAbstractMetadataBase) –

Return type

Tuple[bool, List[QgsAbstractMetadataBaseValidator.ValidationResult]]