Package uicc.toolkit

Interface EditHandler

All Superinterfaces:
ViewHandler
All Known Subinterfaces:
BERTLVEditHandler, EnvelopeResponseHandler, ProactiveHandler

public interface EditHandler extends ViewHandler
This class is the basic class for the construction of a list of Comprehension TLV elements. This class is able to handle Comprehension TLV with a value field no longer than 255 bytes.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    appendArray(byte[] buffer, short offset, short length)
    Appends a buffer into the EditHandler buffer.
    void
    appendTLV(byte tag, byte value)
    Appends a TLV element to the current TLV list (1-byte element).
    void
    appendTLV(byte tag, byte[] value, short valueOffset, short valueLength)
    Appends a TLV element to the current TLV list (byte array format).
    void
    appendTLV(byte tag, byte[] value1, short value1Offset, short value1Length, byte[] value2, short value2Offset, short value2Length)
    Appends a TLV element to the current TLV list (2 byte arrays format).
    void
    appendTLV(byte tag, byte value1, byte value2)
    Appends a TLV element to the current TLV list (2-byte element) This method is useful to add double byte elements as Device Identities, Duration or Response Length.
    void
    appendTLV(byte tag, byte value1, byte[] value2, short value2Offset, short value2Length)
    Appends a TLV element to the current TLV list (1 byte and a byte array format).
    void
    appendTLV(byte tag, byte value1, short value2)
    Appends a TLV element to the current TLV list (3-byte element(1-byte,1-short)) This method is useful to add three byte elements as Command details or Display parameters A successful append does not modify the TLV selected.
    void
    appendTLV(byte tag, short value)
    Appends a TLV element to the current TLV list (2-byte element).
    void
    appendTLV(byte tag, short value1, short value2)
    Appends a TLV element to the current TLV list (4-byte element(2-short)) This method is useful to add three byte elements as Text Attribute, ESN, or C-APDU.
    void
    Clears the TLV list of an EditHandler and resets the current TLV selected.
  • Method Details

    • clear

      void clear() throws ToolkitException
      Clears the TLV list of an EditHandler and resets the current TLV selected.
      Throws:
      ToolkitException - with the following reason codes:
      • HANDLER_NOT_AVAILABLE if the handler is busy
    • appendArray

      void appendArray(byte[] buffer, short offset, short length) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException
      Appends a buffer into the EditHandler buffer. A successful append does not modify the TLV selected. The TLV list structure of the handler should be maintained by the applet in the appended array (e.g. the length of the TLV element should be coded according to ISO 7816-6), if the TLV manipulation methods are to be used afterwards with the handler.
      Parameters:
      buffer - the buffer containing data for copy
      offset - the offset in the buffer
      length - the value length of the buffer
      Throws:
      NullPointerException - if buffer is null
      ArrayIndexOutOfBoundsException - if offset or length or both would cause access outside array bounds, or if length is negative.
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
    • appendTLV

      void appendTLV(byte tag, byte[] value, short valueOffset, short valueLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException
      Appends a TLV element to the current TLV list (byte array format). A successful append does not modify the TLV selected.
      Parameters:
      tag - the tag of the TLV to append, including the Comprehension Required flag
      value - the buffer containing the TLV value
      valueOffset - the offset of the TLV value in the buffer
      valueLength - the value length of the TLV to append
      Throws:
      NullPointerException - if value is null
      ArrayIndexOutOfBoundsException - if valueOffset or valueLength or both would cause access outside array bounds, or if value2Length is negative.
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
      • BAD_INPUT_PARAMETER if valueLength is greater than 255
    • appendTLV

      void appendTLV(byte tag, byte value) throws ToolkitException
      Appends a TLV element to the current TLV list (1-byte element). This method is useful to add single byte elements as Item Identifier or Tone. A successful append does not modify the TLV selected.
      Parameters:
      tag - the tag of the TLV to append, including the Comprehension Required flag
      value - the TLV value on 1 byte
      Throws:
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
    • appendTLV

      void appendTLV(byte tag, short value) throws ToolkitException
      Appends a TLV element to the current TLV list (2-byte element). This method is useful to add a two bytes element. A successful append does not modify the TLV selected.
      Parameters:
      tag - the tag of the TLV to append, including the Comprehension Required flag
      value - the 2 byte TLV value on 1 short
      Throws:
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
    • appendTLV

      void appendTLV(byte tag, byte value1, byte value2) throws ToolkitException
      Appends a TLV element to the current TLV list (2-byte element) This method is useful to add double byte elements as Device Identities, Duration or Response Length. A successful append does not modify the TLV selected.
      Parameters:
      tag - the tag of the TLV to append, including the Comprehension Required flag
      value1 - the 1st byte (msb) of the TLV value
      value2 - the 2nd byte (lsb) of the TLV value
      Throws:
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
    • appendTLV

      void appendTLV(byte tag, byte value1, short value2) throws ToolkitException
      Appends a TLV element to the current TLV list (3-byte element(1-byte,1-short)) This method is useful to add three byte elements as Command details or Display parameters A successful append does not modify the TLV selected.
      Parameters:
      tag - the tag of the TLV to append, including the Comprehension Required flag
      value1 - the 1st byte (msb) of the TLV value
      value2 - the 2nd and 3rd byte on 1 short of the TLV value
      Throws:
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
    • appendTLV

      void appendTLV(byte tag, short value1, short value2) throws ToolkitException
      Appends a TLV element to the current TLV list (4-byte element(2-short)) This method is useful to add three byte elements as Text Attribute, ESN, or C-APDU. A successful append does not modify the TLV selected.
      Parameters:
      tag - the tag of the TLV to append, including the Comprehension Required flag
      value1 - the 1st short (1st and 2nd byte) of the TLV value
      value2 - the 2nd short (3rd and 4th byte) the TLV value
      Throws:
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
    • appendTLV

      void appendTLV(byte tag, byte value1, byte[] value2, short value2Offset, short value2Length) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException
      Appends a TLV element to the current TLV list (1 byte and a byte array format). A successful append does not modify the TLV selected.
      Parameters:
      tag - the tag of the TLV to append, including the Comprehension Required flag
      value1 - the first byte in the value field
      value2 - the buffer containing the rest of the TLV field
      value2Offset - the offset of the rest of the TLV field in the buffer
      value2Length - the value length of the rest of the TLV field to append
      Throws:
      NullPointerException - if value2 is null
      ArrayIndexOutOfBoundsException - if value2Offset or value2Length or both would cause access outside array bounds, or if value2Length is negative.
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
      • BAD_INPUT_PARAMETER if value2Length is greater than 254
    • appendTLV

      void appendTLV(byte tag, byte[] value1, short value1Offset, short value1Length, byte[] value2, short value2Offset, short value2Length) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException
      Appends a TLV element to the current TLV list (2 byte arrays format). A successful append does not modify the TLV selected.
      Parameters:
      tag - the tag of the TLV to append, including the Comprehension Required flag
      value1 - the buffer containing the first part of the value field
      value1Offset - the offset in value1 of the data to append
      value1Length - the length in value1 of the data to append
      value2 - the buffer containing the second part of the value field
      value2Offset - the offset in value2 of the data to append
      value2Length - the length in value2 of the data to append
      Throws:
      NullPointerException - if value1 or value2 is null
      ArrayIndexOutOfBoundsException - if value1Offset or value1Length or both would cause access outside value1 array bounds, or if value1Length is negative, if value2Offset or value2Length or both would cause access outside value2 array bounds, or if value2Length is negative.
      ToolkitException - with the following reason codes:
      • HANDLER_OVERFLOW if the EditHandler buffer is to small to append the requested data
      • HANDLER_NOT_AVAILABLE if the handler is busy
      • BAD_INPUT_PARAMETER if value1Length or value2Lengthis greater than 255