Class CBORTypedObjectDecoder
Base class for CBOR object decoders that can be instantiated
through a CBORTypedObjectDecoderCache.
The system relies on that CBOR data is prepended by a mandatory COTX tag.
See also Typed Objects for an example.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddecode(CBORObject cborBody) IMPLEMENTER USE ONLY.protected booleanIMPLEMENTER USE ONLY.abstract StringGet typed object identifier.getRoot()Get root of decoded CBOR.
-
Constructor Details
-
CBORTypedObjectDecoder
public CBORTypedObjectDecoder()Constructor.Note: implementations must have a public constructor (which they get by default if no other constructor is defined).
-
-
Method Details
-
decode
IMPLEMENTER USE ONLY.Implementations must decode all elements associated with the specific object decoder.
Note that "checked" exceptions must be wrapped in suitable unchecked exceptions like
RuntimeException,CBORException, orCryptoException.- Parameters:
cborBody- COTX argument ofCBORTypedObjectDecoderinstance
-
enableCheckForUnread
protected boolean enableCheckForUnread()IMPLEMENTER USE ONLY.After
decode(CBORObject)has been called, theCBORTypedObjectDecoderCachewill by default callCBORObject.checkForUnread(). By overridingenableCheckForUnread()and returningfalse, a decoder implementation can disable this check. -
getObjectId
Get typed object identifier.- Returns:
- Object Id (COTX)
-
getRoot
Get root of decoded CBOR.Note: the root points to the entire object, including the COTX tag.
- Returns:
CBORObject
-