CycloneDX Library

BaseSerializer
in package
implements Serializer

AbstractYes
Tags
template

TNormalizedBom

author

jkowalleck

Table of Contents

Interfaces

Serializer

Methods

serialize()  : string
Serialize a {@see Bom} to string.
realNormalize()  : TNormalizedBom
Normalize a {@see Bom} to the data structure that {@see realSerialize()} can handle.
realSerialize()  : string
Serialize a {@see realNormalize() normalized} version of a {@see Bom}.
getAllBomRefs()  : array<string|int, BomRef>
Get a list of all {@see BomRef} in {@see Bom}.
normalize()  : TNormalizedBom
Normalize for serialization.

Methods

serialize()

Serialize a {@see Bom} to string.

public final serialize(Bom $bom[, bool|null $prettyPrint = null ]) : string
Parameters
$bom : Bom

the BOM to serialize

$prettyPrint : bool|null = null

whether to beatify the resulting string. A null value means no preference.

Return values
string

realNormalize()

Normalize a {@see Bom} to the data structure that {@see realSerialize()} can handle.

protected abstract realNormalize(Bom $bom) : TNormalizedBom
Parameters
$bom : Bom
Tags
throws
Exception
Return values
TNormalizedBom

a version of the Bom that was normalized for serialization

realSerialize()

Serialize a {@see realNormalize() normalized} version of a {@see Bom}.

protected abstract realSerialize(TNormalizedBom $normalizedBom, bool|null $prettyPrint) : string
Parameters
$normalizedBom : TNormalizedBom

a version of the Bom that was normalized for serialization

$prettyPrint : bool|null
Tags
throws
Exception
Return values
string

getAllBomRefs()

Get a list of all {@see BomRef} in {@see Bom}.

private getAllBomRefs(Bom $bom) : array<string|int, BomRef>

The list might contain duplicates.

Parameters
$bom : Bom
Tags
psalm-return

list<BomRef>

Return values
array<string|int, BomRef>

normalize()

Normalize for serialization.

private normalize(Bom $bom) : TNormalizedBom

Also utilizes BomRefDiscriminator to guarantee that each BomRef has a unique value.

Parameters
$bom : Bom
Tags
throws
Exception
Return values
TNormalizedBom

a version of the Bom that was normalized for serialization


        
On this page

Search results