Constructor.
Type name, used in error messages.
Optional
topTT: numberIf specified, encode as complete TLV; otherwise, encode as TLV-VALUE only.
Optional
subclassSubclass constructor. This must be assigned, otherwise decoding function will not work.
Optional
Readonly
topTTIf specified, encode as complete TLV; otherwise, encode as TLV-VALUE only.
Readonly
typeType name, used in error messages.
Add a field.
TLV-TYPE number.
Field name on the base class.
Field type.
Field options.
StructBuilder annotated with field typing.
Obtain a base class for the TLV structure class.
Change IsCritical on the EvDecoder.
Static
evdAccess EvDecoder for certain customizations.
Readonly
afterObservers: TlvObserver<U>[]Callbacks after decoding TLV-VALUE.
Readonly
beforeObservers: TlvObserver<U>[]Callbacks before decoding TLV-VALUE.
Set callback to determine whether TLV-TYPE is critical.
Set callback to handle unknown elements.
Static
keysRetrieve field names.
Helper to build a base class that represents a TLV structure.
Remarks
StructBuilder allows you to define the typing, constructor, encoder, and decoder, while writing each field only once. To be compatible with StructBuilder, the TLV structure being described shall contain a sequence of sub-TLV elements with distinct TLV-TYPE numbers, where each sub-TLV-TYPE appears zero, one, or multiple times.
To use StructBuilder, calling code should follow these steps:
.add()
method successively to define sub-TLV elements..baseClass()
method, which contains one field for each sub-TLV-TYPE as defined, along with constructor, encoding, and decoding functions..subclass
property of the builder.