public interface EnvelopeHandler extends BERTLVViewHandler
EnvelopeHandler interface contains basic methods to handle the Envelope
data field. A class implementing this interface will be used by the Toolkit
applet in order to have access to the current Envelope information. A class
implementing the EnvelopeHandler interface is a Temporary JCRE Entry Point Object
and can be retrieved by invoking the getTheHandler() method of the
EnvelopeHandlerSystem class.
Toolkit Applet Example:
private static final byte MY_TAG = (byte)0x54;
private byte[] data;
data = new byte[32];
void processToolkit(byte event) throws ToolkitException {
// get the EnvelopeHandler system instance
EnvelopeHandler theEnv = EnvelopeHandlerSystem.getTheHandler();
// look for MY_TAG TLV
if (theEnv.findTLV(MY_TAG, (byte)1) != TLV_NOT_FOUND) {
// check first element byte
if (theEnv.getValueByte((short)0) == (byte)1) {
// copy element part into data buffer
theEnv.copyValue((short)1,
data,
(short)0,
(short)(theEnv.getValueLength() - 1));
}
}
}
ViewHandler,
EnvelopeHandlerSystem| Modifier and Type | Method and Description |
|---|---|
byte |
getChannelIdentifier()
Returns the channel identifier value from the first Channel status TLV element
in the current Envelope data field.
|
short |
getChannelStatus(byte channelIdentifier)
Returns the value of the first Channel Status TLV element whose channel identifier is equal
to the
channelIdentifier parameter. |
byte |
getItemIdentifier()
Returns the item identifier byte value from the first Item Identifier TLV
element in the current Envelope data field.
|
getSize, getTagcompareValue, copy, copyValue, findAndCompareValue, findAndCompareValue, findAndCopyValue, findAndCopyValue, findTLV, getCapacity, getLength, getValueByte, getValueLength, getValueShortbyte getItemIdentifier()
throws ToolkitException
ToolkitException - with the following reason codes: UNAVAILABLE_ELEMENT in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES if the item identifier byte is missing in the
Item Identifier Comprehension TLV.byte getChannelIdentifier()
throws ToolkitException
ToolkitException - - with the following reason codes: UNAVAILABLE_ELEMENT in case of unavailable TLV element.
OUT_OF_TLV_BOUNDARIES if the Comprehension TLV Channels Status length is equal to zero.short getChannelStatus(byte channelIdentifier)
throws ToolkitException
channelIdentifier parameter.
If the element is available it becomes the currently selected TLV element.channelIdentifier - the channel numberToolkitException - with the following reason codes: UNAVAILABLE_ELEMENT if no Channel Status TLV element with the right identifier could be found
OUT_OF_TLV_BOUNDARIES if a Channel Status TLV element with the right
identifier could be found but its value is less than 2 bytes long