|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.io.nfc.ndef.NDEFRecord
public class NDEFRecord
Represents an NDEF record as specified by the NFC Forum. Provides methods to set and retrieve NDEF record properties.
Field Summary | ||
---|---|---|
static int |
TNF_ABSOLUTE_URI
Constant that indicates the record type name format identifier for an absolute URI type. |
|
static int |
TNF_ANY
Constant that indicates the record type name format identifier for any record type. |
|
static int |
TNF_EMPTY
Constant that indicates the record type name format identifier for an empty record. |
|
static int |
TNF_EXTERNAL
Constant that indicates the record type name format identifier for application specific record type names that follow NFC Forum naming conventions. |
|
static int |
TNF_MEDIA
Constant that indicates the record type name format identifier for a MIME type. |
|
static int |
TNF_UNCHANGED
Constant that indicates the record type name format identifier for an unchanged record type. |
|
static int |
TNF_UNKNOWN
Constant that indicates the record type name format identifier for an unknown record type. |
|
static int |
TNF_WELL_KNOWN
Constant that indicates the record type name format identifier for a "well known type" as defined by the NFC Forum. |
Constructor Summary | ||
---|---|---|
NDEFRecord()
Creates an empty NDEF record. |
||
NDEFRecord(int TNF,
String TNFString)
Creates an empty NDEF record, setting the Type Name Format and Type Name Format string. |
Method Summary | ||
---|---|---|
NDEFRecord |
clone()
Clones this NDEF record. |
|
String |
getId()
Returns the ID of the record. |
|
byte[] |
getPayload()
Returns the payload of this NDEF record. |
|
String |
getType()
Returns the type of the record. |
|
int |
getTypeNameFormat()
Returns the Type Name Format of the record. |
|
boolean |
isFirstRecord()
Indicates whether this is the first record. |
|
boolean |
isLastRecord()
Indicates whether this is the last record. |
|
void |
setId(String id)
Sets the ID of the record. |
|
void |
setPayload(byte[] payload)
Sets the payload of this NDEF record. |
|
void |
setType(int typeNameFormat,
String type)
Sets the Type Name Format and optional Type Name Format string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TNF_EMPTY
public static final int TNF_WELL_KNOWN
public static final int TNF_MEDIA
public static final int TNF_ABSOLUTE_URI
public static final int TNF_EXTERNAL
public static final int TNF_UNKNOWN
public static final int TNF_UNCHANGED
public static final int TNF_ANY
Constructor Detail |
---|
public NDEFRecord()
public NDEFRecord(int TNF, String TNFString) throws NFCException
TNF
- An integer in the range specified by the NDEF specification for
Type Name Format.TNFString
- The optional Type Name Format string. This value must
be set according to the NDEF specification. The requirements depend on
the value of the TNF parameter.
NFCException
- If the TNF value is out of the valid range.Method Detail |
---|
public boolean isFirstRecord()
true
if this is the first record; false
otherwise.public boolean isLastRecord()
true
if this is the last record; false
otherwise.public String getId()
public void setId(String id)
id
- The ID of the record.public int getTypeNameFormat()
public String getType()
public void setType(int typeNameFormat, String type) throws NFCException
typeNameFormat
- The Type Name Format.type
- The Type Name Format string.
NFCException
- When Type Name Format is invalid.public byte[] getPayload()
byte
array representing the payload of this NDEF record.public void setPayload(byte[] payload)
payload
- A byte
array representing the payload of NDEF record.public NDEFRecord clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal