|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sim.toolkit.ViewHandler
The ViewHandler class offers basic services and contains basic methods to handle a Simple TLV List, such as in a Terminal Response data field or in a BER-TLV element (Envelope data field or Proactive command). The byte at offset 0 of a handler is the tag of the first Simple TLV.
ToolkitException
Method Summary | |
byte |
compareValue(short valueOffset,
byte[] compareBuffer,
short compareOffset,
short compareLength)
Compares the last found TLV element with a buffer. |
short |
copy(byte[] dstBuffer,
short dstOffset,
short dstLength)
Copies the simple TLV list contained in the handler to the destination byte array. |
short |
copyValue(short valueOffset,
byte[] dstBuffer,
short dstOffset,
short dstLength)
Copies a part of the last TLV element which has been found, into a destination buffer. |
byte |
findAndCompareValue(byte tag,
byte[] compareBuffer,
short compareOffset)
Looks for the first occurence of a TLV element from beginning of a TLV list and compare its value with a buffer. |
byte |
findAndCompareValue(byte tag,
byte occurence,
short valueOffset,
byte[] compareBuffer,
short compareOffset,
short compareLength)
Looks for the indicated occurence of a TLV element from the beginning of a TLV list and compare its value with a buffer. |
short |
findAndCopyValue(byte tag,
byte[] dstBuffer,
short dstOffset)
Looks for the first occurence of a TLV element from the beginning of a TLV list and copy its value into a destination buffer. |
short |
findAndCopyValue(byte tag,
byte occurence,
short valueOffset,
byte[] dstBuffer,
short dstOffset,
short dstLength)
Looks for the indicated occurence of a TLV element from the beginning of a TLV list and copy its value into a destination buffer. |
byte |
findTLV(byte tag,
byte occurrence)
Looks for the indicated occurence of a TLV element from the beginning of the TLV list (handler buffer). |
short |
getLength()
Returns the length of the TLV list. |
byte |
getValueByte(short valueOffset)
Gets a byte from the last TLV element which has been found in the handler. |
short |
getValueLength()
Gets the binary length of the value field for the last TLV element which has been found in the handler. |
Methods inherited from class java.lang.Object |
equals |
Method Detail |
public short getLength() throws ToolkitException
ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busypublic short copy(byte[] dstBuffer, short dstOffset, short dstLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
Notes:
dstOffset
or dstLength
parameter is negative an ArrayIndexOutOfBoundsException
exception is thrown and no copy is performed.
dstOffset+dstLength
is greater than dstBuffer.length
, the length
of the dstBuffer
array an ArrayIndexOutOfBoundsException
exception is thrown
and no copy is performed.
dstBuffer
- a reference to the destination bufferdstOffset
- the position in the destination bufferdstLength
- the data length to be copieddstOffset+dstLength
java.lang.NullPointerException
- if dstBuffer
is null
java.lang.ArrayIndexOutOfBoundsException
- if copy would cause access of data outside array bounds.ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
OUT_OF_TLV_BOUNDARIES
if dstLength
is grater than the length of the simple TLV List.public byte findTLV(byte tag, byte occurrence) throws ToolkitException
tag
- the tag of the TLV element to searchoccurrence
- the occurrence number of the TLV element (1 for the first, 2 for the second...)TLV_NOT_FOUND
if the required occurrence of the TLV element does not exist
TLV_FOUND_CR_SET
if the required occurence exists and Comprehension Required flag is set
TLV_FOUND_CR_NOT_SET
if the required occurence exists and Comprehension Required flag is not setToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
BAD_INPUT_PARAMETER
if an input parameter is not valid (e.g. occurence = 0)public short getValueLength() throws ToolkitException
ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV elementpublic byte getValueByte(short valueOffset) throws ToolkitException
valueOffset
- the offset of the byte to return in the TLV elementToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if valueOffset
is out of the current TLV public short copyValue(short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
Notes:
dstOffset
or dstLength
parameter is negative an ArrayIndexOutOfBoundsException
exception is thrown and no copy is performed.
dstOffset+dstLength
is greater than dstBuffer.length
, the length
of the dstBuffer
array an ArrayIndexOutOfBoundsException
exception is thrown
and no copy is performed.
valueOffset
- the offset of the first byte in the source TLV elementdstBuffer
- a reference to the destination bufferdstOffset
- the position in the destination bufferdstLength
- the data length to be copieddstOffset+dstLength
java.lang.NullPointerException
- if dstBuffer
is null
java.lang.ArrayIndexOutOfBoundsException
- if copyValue would cause access of data outside array bounds.ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if:
valueOffset
parameter is negative or
valueOffset + dstLength
is greater than the length of the current TLV
public byte compareValue(short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
Notes:
compareOffset
or compareLength
parameter is negative an ArrayIndexOutOfBoundsException
exception is thrown and no compare is performed.
compareOffset+compareLength
is greater than compareBuffer.length
, the length
of the compareBuffer
array an ArrayIndexOutOfBoundsException
exception is thrown
and no compare is performed.
valueOffset
- the offset of the first byte to compare in the TLV elementcompareBuffer
- a reference to the comparison buffercompareOffset
- the position in the comparison buffercompareLength
- the length to be compared0
if identical
-1
if the first miscomparing byte in simple TLV List is less than that in compareBuffer
,
1
if the first miscomparing byte in simple TLV List is greater than that in compareBuffer
.java.lang.NullPointerException
- if compareBuffer
is null
java.lang.ArrayIndexOutOfBoundsException
- if compareValue would cause access of data outside array bounds.ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if:
valueOffset
parameter is negative or
valueOffset + compareLength
is greater than the length of the current TLV
public short findAndCopyValue(byte tag, byte[] dstBuffer, short dstOffset) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
UNAVAILABLE_ELEMENT
exception is thrown.
If the method is successful then the corresponding TLV becomes current,
else no TLV is selected.
This search method is Comprehension Required flag independent.
Notes:
dstOffset
parameter is negative or dstOffset
is greater than dstBuffer.length
, the length of the dstBuffer
array an ArrayIndexOutOfBoundsException
exception is thrown and no find is performed.
tag
- the tag of the TLV element to searchdstBuffer
- a reference to the destination bufferdstOffset
- the position in the destination bufferdstOffset
+ length of the copied valuejava.lang.NullPointerException
- if dstBuffer
is null
java.lang.ArrayIndexOutOfBoundsException
- if findAndCopyValue would cause access of data outside array bounds.ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV elementpublic short findAndCopyValue(byte tag, byte occurence, short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
UNAVAILABLE_ELEMENT
exception is thrown.
If the method is successful then the corresponding TLV becomes current,
else no TLV is selected.
This search method is Comprehension Required flag independent.
Notes:
dstOffset
or dstLength
parameter is negative an ArrayIndexOutOfBoundsException
exception is thrown and no copy is performed.
dstOffset+dstLength
is greater than dstBuffer.length
, the length
of the dstBuffer
array an ArrayIndexOutOfBoundsException
exception is thrown
and no copy is performed.
tag
- the tag of the TLV element to searchoccurrence
- the occurrence number of the TLV element (1 for the first, 2 for the second...)valueOffset
- the offset of the first byte in the source TLV elementdstBuffer
- a reference to the destination bufferdstOffset
- the position in the destination bufferdstLength
- the data length to be copieddstOffset + dstLength
java.lang.NullPointerException
- if dstBuffer
is null
java.lang.ArrayIndexOutOfBoundsException
- if findAndCopyValue would cause access of data outside array bounds.ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if:
valueOffset
parameter is negative or
valueOffset + dstLength
is greater than the length of the current TLV
BAD_INPUT_PARAMETER
if an input parameter is not valid (e.g. occurence = 0)public byte findAndCompareValue(byte tag, byte[] compareBuffer, short compareOffset) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
UNAVAILABLE_ELEMENT
exception is thrown.
If the method is successful then the corresponding TLV becomes current,
else no TLV is selected.
This search method is Comprehension Required flag independent.
Notes:
compareOffset
parameter is negative or compareOffset
is greater than compareBuffer.length
, the length of the compareBuffer
array an ArrayIndexOutOfBoundsException
exception is thrown and no find is performed.
tag
- the tag of the TLV element to searchcompareBuffer
- a reference to the comparison buffercompareOffset
- the position in the comparison buffer0
if identical
-1
if the first miscomparing byte in simple TLV is less than that in compareBuffer
,
1
if the first miscomparing byte in simple TLV is greater than that in compareBuffer
.java.lang.NullPointerException
- if compareBuffer
is null
java.lang.ArrayIndexOutOfBoundsException
- if findAndCompareValue would cause access of data outside array bounds.ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV elementpublic byte findAndCompareValue(byte tag, byte occurence, short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
UNAVAILABLE_ELEMENT
exception is thrown.
If the method is successful then the corresponding TLV becomes current,
else no TLV is selected.
This search method is Comprehension Required flag independent.
Notes:
compareOffset
or compareLength
parameter is negative an ArrayIndexOutOfBoundsException
exception is thrown and no find and compare is performed.
compareOffset+compareLength
is greater than compareBuffer.length
, the length
of the compareBuffer
array an ArrayIndexOutOfBoundsException
exception is thrown
and no find and compare is performed.
tag
- the tag of the TLV element to searchoccurrence
- the occurrence number of the TLV element (1 for the first, 2 for the second...)valueOffset
- the offset of the first byte in the source TLV elementcompareBuffer
- a reference to the comparison buffercompareOffset
- the position in the comparison buffercompareLength
- the length to be compared0
if identical
-1
if the first miscomparing byte in simple TLV is less than that in compareBuffer
,
1
if the first miscomparing byte in simple TLV is greater than that in compareBuffer
.java.lang.NullPointerException
- if compareBuffer
is null
java.lang.ArrayIndexOutOfBoundsException
- if findAndCompareValue would cause access of data outside array bounds.ToolkitException
- with the following reason codes: HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if:
valueOffset
parameter is negative or
valueOffset + compareLength
is greater than the length of the current TLV
BAD_INPUT_PARAMETER
if an input parameter is not valid (e.g. occurence = 0)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |