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
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
decode
(CBORObject cborBody) IMPLEMENTER USE ONLY.protected boolean
IMPLEMENTER USE ONLY.abstract String
Get 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 ofCBORTypedObjectDecoder
instance
-
enableCheckForUnread
protected boolean enableCheckForUnread()IMPLEMENTER USE ONLY.After
decode(CBORObject)
has been called, theCBORTypedObjectDecoderCache
will 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
-