NAME

Data::Identifier::Wellknown - format independent identifier object

VERSION

version v0.26

SYNOPSIS

use Data::Identifier::Wellknown qw(classes...);
e.g.:
use Data::Identifier::Wellknown ':all';

(experimental since v0.07)

This package provides a simple list of well known identifiers. Classes are loaded on demand. However for speedy lookup classes can be imported (given via use arguments).

If a class is already loaded, it is not reloaded. If a program knows the classes it will use early it makes sense to include this module in the main program (or root module) before other modules that make use of this module are used with all the used classes listed. This improves speed as it will reduce the read of the full list to a single pass. In contrast if every use will only list a single class that is not yet loaded loading will be most in-efficient.

Note: This is an experimental package. It's methods and classes are not stable. But the package itself and the class :all is.

This package implements Data::Identifier::Interface::Known.

METHODS

classes_of

my @classes = Data::Identifier::Wellknown->classes_of($identifier);

(experimental since v0.07)

Returns the classes the identifier is known for. $identifier is parsed as per from of "new" in Data::Identifier.

Note: This module does not guarantee any specific order of the returned list.

Note: Classes may not be included in returned list unless they (or :all) have been imported before.

Note: This is an experimental method. It may be changed, renamed, or removed without notice.

announce

Data::Identifier::Wellknown->announce($type => $data);

(experimental since v0.26)

This method can be used to announce additional well known identifiers. It is mostly used by other modules to register identifiers for a given type related to those modules and alias them to UUIDs. This is mostly useful if those identifiers are mapped to UUIDs via a register (in contrast to a generator).

The type is passed as $type which is parsed as per from of "new" in Data::Identifier. It must resolve to an identifier with a defined UUID. This module might make restrictions on the type identifiers can be registered for.

If $data is a hashref the keys are understood as the identifiers of the type given via $type and the values are the corresponding identifiers (parsed as per from of "new" in Data::Identifier) to map to.

If $data is an arrayref the values are understood as the identifiers. Data::Identifier objects are created as needed and registered.

$type and all identifiers updated by this method will be registered as per "register" in Data::Identifier.

AUTHOR

Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023-2025 by Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)