Class CPDefault

java.lang.Object
com.authlete.cbor.tag.CPDefault
All Implemented Interfaces:
CBORTagProcessor

public class CPDefault extends Object implements CBORTagProcessor
A tag processor that returns a CBORTaggedItem instance that has the tag number and the tag content passed as arguments of the process method.
  • Field Details

    • INSTANCE

      public static final CPDefault INSTANCE
  • Constructor Details

    • CPDefault

      public CPDefault()
  • Method Details

    • process

      public CBORItem process(Number tagNumber, CBORItem tagContent) throws CBORDecoderException
      Description copied from interface: CBORTagProcessor
      Process a tag.

      The CBOR data item returned by this method replaces the current tagged item (CBORTaggedItem).

      The simplest implementation is to return tagContent as is. It means that the tag is just removed. (cf. CPUntag)

      The second simplest implementation is to create a CBORTaggedItem instance with the tag number and the tag content passed as arguments and return it. (cf. CPDefault)

      Specified by:
      process in interface CBORTagProcessor
      Parameters:
      tagNumber - The tag number.
      tagContent - The tag content.
      Returns:
      A CBOR data item which replaces the current tagged item (CBORTaggedItem).
      Throws:
      CBORDecoderException