net.rim.device.api.io.nfc.ndef.rtd
Class URIRecord

java.lang.Object
  extended by net.rim.device.api.io.nfc.ndef.NDEFRecord
      extended by net.rim.device.api.io.nfc.ndef.rtd.URIRecord

public class URIRecord
extends NDEFRecord

Helps build and parse NFC Forum URI NDEF records.

Since:
BlackBerry API 7.1.0

Field Summary
static String URI_RECORD_TYPE
          The NFC Forum record type name for URI records
 
Fields inherited from class net.rim.device.api.io.nfc.ndef.NDEFRecord
TNF_ABSOLUTE_URI, TNF_ANY, TNF_EMPTY, TNF_EXTERNAL, TNF_MEDIA, TNF_UNCHANGED, TNF_UNKNOWN, TNF_WELL_KNOWN
 
Constructor Summary
URIRecord()
          Creates an empty URI record.
URIRecord(String uri)
          Creates a URI record with the specified URI.
URIRecord(NDEFRecord ndefRecord)
          Creates a URI record by extracting URI record data from an existing NDEFRecord object.
 
Method Summary
 NDEFRecord clone()
          Returns an NDEFRecord object that is a clone of this URI record.
 byte[] getPayload()
          Returns the payload for this URI record as a byte[] array.
 String getUri()
          Returns the URI contained in the NDEF record.
 void setPayload(byte[] payload)
          This method is not supported because the payload is generated.
 void setUri(String uri)
          Sets the URI contained in the NDEF record.
 
Methods inherited from class net.rim.device.api.io.nfc.ndef.NDEFRecord
getId, getType, getTypeNameFormat, isFirstRecord, isLastRecord, setId, setType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

URI_RECORD_TYPE

public static final String URI_RECORD_TYPE
The NFC Forum record type name for URI records

See Also:
Constant Field Values
Since:
BlackBerry API 7.1.0


Constructor Detail

URIRecord

public URIRecord()
          throws NFCException
Creates an empty URI record.

Throws:
NFCException - If the URIRecord cannot be constructed.
Since:
BlackBerry API 7.1.0

URIRecord

public URIRecord(String uri)
          throws NFCException
Creates a URI record with the specified URI.

Throws:
NFCException - If the URIRecord cannot be constructed.
Since:
BlackBerry API 7.1.0

URIRecord

public URIRecord(NDEFRecord ndefRecord)
          throws NFCException
Creates a URI record by extracting URI record data from an existing NDEFRecord object.

Parameters:
ndefRecord - NDEFRecord to extract data from.
Throws:
NFCException - If the URIRecord cannot be constructed.
Since:
BlackBerry API 7.1.0


Method Detail

getUri

public String getUri()
Returns the URI contained in the NDEF record.

Returns:
URI contained NDEF record.
Since:
BlackBerry API 7.1.0

setUri

public void setUri(String uri)
Sets the URI contained in the NDEF record.

Parameters:
uri - URI to store in the NDEF record.
Throws:
IllegalArgumentException - If the uri parameter is null.
Since:
BlackBerry API 7.1.0

getPayload

public byte[] getPayload()
Returns the payload for this URI record as a byte[] array. Note that the payload is generated each time this method is called.

Overrides:
getPayload in class NDEFRecord
Returns:
byte[] representation of the payload for the URI record.
Since:
BlackBerry API 7.1.0

setPayload

public void setPayload(byte[] payload)
This method is not supported because the payload is generated.

Overrides:
setPayload in class NDEFRecord
Parameters:
payload - This parameter is not used.
Since:
BlackBerry API 7.1.0

clone

public NDEFRecord clone()
Returns an NDEFRecord object that is a clone of this URI record.

Overrides:
clone in class NDEFRecord
Returns:
NDEFRecord that is a clone of this URI Record.
Since:
BlackBerry API 7.1.0





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