Package uicc.toolkit
Interface EditHandler
- All Superinterfaces:
ViewHandler
- All Known Subinterfaces:
BERTLVEditHandler,EnvelopeResponseHandler,ProactiveHandler
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendArray(byte[] buffer, short offset, short length) Appends a buffer into the EditHandler buffer.voidappendTLV(byte tag, byte value) Appends a TLV element to the current TLV list (1-byte element).voidappendTLV(byte tag, byte[] value, short valueOffset, short valueLength) Appends a TLV element to the current TLV list (byte array format).voidappendTLV(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).voidappendTLV(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.voidappendTLV(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).voidappendTLV(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.voidappendTLV(byte tag, short value) Appends a TLV element to the current TLV list (2-byte element).voidappendTLV(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.voidclear()Clears the TLV list of an EditHandler and resets the current TLV selected.Methods inherited from interface uicc.toolkit.ViewHandler
compareValue, copy, copyValue, findAndCompareValue, findAndCompareValue, findAndCopyValue, findAndCopyValue, findTLV, getCapacity, getLength, getValueByte, getValueLength, getValueShort
-
Method Details
-
clear
Clears the TLV list of an EditHandler and resets the current TLV selected.- Throws:
ToolkitException- with the following reason codes:HANDLER_NOT_AVAILABLEif 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 copyoffset- the offset in the bufferlength- the value length of the buffer- Throws:
NullPointerException- ifbufferisnullArrayIndexOutOfBoundsException- ifoffsetorlengthor both would cause access outside array bounds, or iflengthis negative.ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif 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 flagvalue- the buffer containing the TLV valuevalueOffset- the offset of the TLV value in the buffervalueLength- the value length of the TLV to append- Throws:
NullPointerException- ifvalueisnullArrayIndexOutOfBoundsException- ifvalueOffsetorvalueLengthor both would cause access outside array bounds, or ifvalue2Lengthis negative.ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif the handler is busyBAD_INPUT_PARAMETERifvalueLengthis greater than 255
-
appendTLV
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 flagvalue- the TLV value on 1 byte- Throws:
ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif the handler is busy
-
appendTLV
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 flagvalue- the 2 byte TLV value on 1 short- Throws:
ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif the handler is busy
-
appendTLV
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 flagvalue1- the 1st byte (msb) of the TLV valuevalue2- the 2nd byte (lsb) of the TLV value- Throws:
ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif the handler is busy
-
appendTLV
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 flagvalue1- the 1st byte (msb) of the TLV valuevalue2- the 2nd and 3rd byte on 1 short of the TLV value- Throws:
ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif the handler is busy
-
appendTLV
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 flagvalue1- the 1st short (1st and 2nd byte) of the TLV valuevalue2- the 2nd short (3rd and 4th byte) the TLV value- Throws:
ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif 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 flagvalue1- the first byte in the value fieldvalue2- the buffer containing the rest of the TLV fieldvalue2Offset- the offset of the rest of the TLV field in the buffervalue2Length- the value length of the rest of the TLV field to append- Throws:
NullPointerException- ifvalue2isnullArrayIndexOutOfBoundsException- ifvalue2Offsetorvalue2Lengthor both would cause access outside array bounds, or ifvalue2Lengthis negative.ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif the handler is busyBAD_INPUT_PARAMETERifvalue2Lengthis 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 flagvalue1- the buffer containing the first part of the value fieldvalue1Offset- the offset in value1 of the data to appendvalue1Length- the length in value1 of the data to appendvalue2- the buffer containing the second part of the value fieldvalue2Offset- the offset in value2 of the data to appendvalue2Length- the length in value2 of the data to append- Throws:
NullPointerException- ifvalue1orvalue2isnullArrayIndexOutOfBoundsException- ifvalue1Offsetorvalue1Lengthor both would cause access outside value1 array bounds, or ifvalue1Lengthis negative, ifvalue2Offsetorvalue2Lengthor both would cause access outside value2 array bounds, or ifvalue2Lengthis negative.ToolkitException- with the following reason codes:HANDLER_OVERFLOWif the EditHandler buffer is to small to append the requested dataHANDLER_NOT_AVAILABLEif the handler is busyBAD_INPUT_PARAMETERifvalue1Lengthorvalue2Lengthis greater than 255
-