| 1 | package SBOM::CycloneDX::License::ExpressionDetail; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use SBOM::CycloneDX::BomRef; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use Types::Standard qw(Str Enum InstanceOf); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | extends 'SBOM::CycloneDX::Base'; | |||||||||
| 16 | |||||||||||
| 17 | 1 | has license_identifier => (is => 'rw', required => 1, isa => Str); | |||||||||
| 18 | |||||||||||
| 19 | has bom_ref => ( | ||||||||||
| 20 | is => 'rw', | ||||||||||
| 21 | isa => InstanceOf ['SBOM::CycloneDX::BomRef'], | ||||||||||
| 22 | 0 | ▶ | coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::BomRef->new($_[0]) } | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 23 | 1 | ); | |||||||||
| 24 | |||||||||||
| 25 | 1 | has text => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Attachment']); | |||||||||
| 26 | |||||||||||
| 27 | 1 | has url => (is => 'rw', isa => Str); | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub TO_JSON { | ||||||||
|
Subroutine
TO_JSON: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 30 | |||||||||||
| 31 | 0 | my $self = shift; | |||||||||
| 32 | |||||||||||
| 33 | 0 | my $json = {licenseIdentifier => $self->license_identifier}; | |||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | $json->{'bom-ref'} = $self->bom_ref if $self->bom_ref; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 0 | ▶ | $json->{text} = $self->text if $self->text; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | ▶ | $json->{url} = $self->url if $self->url; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | |||||||||||
| 39 | 0 | return $json; | |||||||||
| 40 | |||||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 1 | 1; | |||||||||
| 44 | |||||||||||
| 45 | =encoding utf-8 | ||||||||||
| 46 | |||||||||||
| 47 | =head1 NAME | ||||||||||
| 48 | |||||||||||
| 49 | SBOM::CycloneDX::License::ExpressionDetail - Expression Details | ||||||||||
| 50 | |||||||||||
| 51 | =head1 SYNOPSIS | ||||||||||
| 52 | |||||||||||
| 53 | SBOM::CycloneDX::License::ExpressionDetail->new(); | ||||||||||
| 54 | |||||||||||
| 55 | |||||||||||
| 56 | =head1 DESCRIPTION | ||||||||||
| 57 | |||||||||||
| 58 | L<SBOM::CycloneDX::License::ExpressionDetail> Details for parts of the | ||||||||||
| 59 | `expression`. | ||||||||||
| 60 | |||||||||||
| 61 | =head2 METHODS | ||||||||||
| 62 | |||||||||||
| 63 | L<SBOM::CycloneDX::License::ExpressionDetail> inherits all methods from L<SBOM::CycloneDX::Base> | ||||||||||
| 64 | and implements the following new ones. | ||||||||||
| 65 | |||||||||||
| 66 | =over | ||||||||||
| 67 | |||||||||||
| 68 | =item SBOM::CycloneDX::License::ExpressionDetail->new( %PARAMS ) | ||||||||||
| 69 | |||||||||||
| 70 | Properties: | ||||||||||
| 71 | |||||||||||
| 72 | =over | ||||||||||
| 73 | |||||||||||
| 74 | =item * C<bom_ref>, An identifier which can be used to reference the license | ||||||||||
| 75 | elsewhere in the BOM. Every C<bom-ref> must be unique within the BOM. | ||||||||||
| 76 | Value SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid | ||||||||||
| 77 | conflicts with BOM-Links. | ||||||||||
| 78 | |||||||||||
| 79 | =item * C<license_identifier>, The valid SPDX license identifier. Refer to | ||||||||||
| 80 | L<https://spdx.org/specifications> for syntax requirements. | ||||||||||
| 81 | This property serves as the primary key, which uniquely identifies each | ||||||||||
| 82 | record. | ||||||||||
| 83 | |||||||||||
| 84 | =item * C<text>, A way to include the textual content of the license. | ||||||||||
| 85 | |||||||||||
| 86 | =item * C<url>, The URL to the license file. If specified, a 'license' | ||||||||||
| 87 | externalReference should also be specified for completeness | ||||||||||
| 88 | |||||||||||
| 89 | =back | ||||||||||
| 90 | |||||||||||
| 91 | =item $expression_detail->bom_ref | ||||||||||
| 92 | |||||||||||
| 93 | =item $expression_detail->license_identifier | ||||||||||
| 94 | |||||||||||
| 95 | =item $expression_detail->text | ||||||||||
| 96 | |||||||||||
| 97 | =item $expression_detail->url | ||||||||||
| 98 | |||||||||||
| 99 | =back | ||||||||||
| 100 | |||||||||||
| 101 | |||||||||||
| 102 | =head1 SUPPORT | ||||||||||
| 103 | |||||||||||
| 104 | =head2 Bugs / Feature Requests | ||||||||||
| 105 | |||||||||||
| 106 | Please report any bugs or feature requests through the issue tracker | ||||||||||
| 107 | at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||||||||||
| 108 | You will be notified automatically of any progress on your issue. | ||||||||||
| 109 | |||||||||||
| 110 | =head2 Source Code | ||||||||||
| 111 | |||||||||||
| 112 | This is open source software. The code repository is available for | ||||||||||
| 113 | public review and contribution under the terms of the license. | ||||||||||
| 114 | |||||||||||
| 115 | L<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||||||||||
| 116 | |||||||||||
| 117 | git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git | ||||||||||
| 118 | |||||||||||
| 119 | |||||||||||
| 120 | =head1 AUTHOR | ||||||||||
| 121 | |||||||||||
| 122 | =over 4 | ||||||||||
| 123 | |||||||||||
| 124 | =item * Giuseppe Di Terlizzi <gdt@cpan.org> | ||||||||||
| 125 | |||||||||||
| 126 | =back | ||||||||||
| 127 | |||||||||||
| 128 | |||||||||||
| 129 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 130 | |||||||||||
| 131 | This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi. | ||||||||||
| 132 | |||||||||||
| 133 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 134 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 135 | |||||||||||
| 136 | =cut | ||||||||||