Package uicc.system
Class HandlerBuilder
java.lang.Object
uicc.system.HandlerBuilder
The
HandlerBuilder class is a class to create objects that are implementing TLV handler interfaces.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final byte -
Method Summary
Modifier and TypeMethodDescriptionstatic ViewHandlerbuildTLVHandler(byte type, short capacity) Allocates a TLVHandler with an internal buffer of length capacitystatic ViewHandlerbuildTLVHandler(byte type, short capacity, byte[] buffer, short offset, short length) Allocates a TLVHandler with an internal buffer of length capacity.
-
Field Details
-
EDIT_HANDLER
public static final byte EDIT_HANDLER- See Also:
-
BER_EDIT_HANDLER
public static final byte BER_EDIT_HANDLER- See Also:
-
-
Method Details
-
buildTLVHandler
public static ViewHandler buildTLVHandler(byte type, short capacity) throws javacard.framework.SystemException Allocates a TLVHandler with an internal buffer of length capacity- Parameters:
type- indicating the type of the Handlercapacity- the length of the internal buffer of the Handler.It corresponds to the maximum size of the TLV list managed by the handler.- Returns:
- a
ViewHandlerobject - Throws:
javacard.framework.SystemException- with the following reason code:ILLEGAL_VALUE- if the type does not match with the predefined values
- if
capacityis negative
NO_RESOURCEif there are not enough resources in the card to allocate the handler
-
buildTLVHandler
public static ViewHandler buildTLVHandler(byte type, short capacity, byte[] buffer, short offset, short length) throws ArrayIndexOutOfBoundsException, javacard.framework.SystemException, NullPointerException, ToolkitException Allocates a TLVHandler with an internal buffer of length capacity. Copies the buffer content to an internal buffer of the TLVHandler starting atoffset. The internal buffer shall be at leastlengthlong.- Parameters:
type- indicating the type of the Handlercapacity- the length of the internal buffer of the Handler. It corresponds to the maximum size of the TLV list managed by the handler.buffer- holding initialization data for the TLV Handler the content of this buffer will be copied into the internal buffer of the handler and will be unchanged.offset- offset into the buffer indicating the start of the content that has to be copied into the internal buffer of the handlerlength- length of the content that has to be copied from the buffer- Returns:
- a
ViewHandlerobject - Throws:
javacard.framework.SystemException- with the following reason code:ILLEGAL_VALUE- if the type does not match with the predefined values
- if
capacityis negative
NO_RESOURCEif there are not enough resources in the card to allocate the handler
NullPointerException- ifbufferisnullArrayIndexOutOfBoundsException-- if
offsetwould cause access outside array bounds, or iflengthis negative. - if
offset+lengthis greater than the length of the buffer
- if
ToolkitException- with the following reason code:BAD_INPUT_PARAMETERiflengthis greater thancapacity
-