|
|||||||||
| 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
net.rim.device.api.io.nfc.ndef.rtd.SmartPosterRecord
public class SmartPosterRecord
Helps build and parse NFC Forum smart poster NDEF records.
| Field Summary | ||
|---|---|---|
static int |
SMART_POSTER_ACTION_DEFAULT
Indicates that an application should be opened to view the smart poster. |
|
static int |
SMART_POSTER_ACTION_EDIT
Indicates that the smart poster should be opened in edit mode. |
|
static int |
SMART_POSTER_ACTION_SAVE
Indicates that this smart poster should be saved for later viewing. |
|
static String |
SMART_POSTER_RECORD_TYPE
The NFC Forum record type name for smart poster 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 | ||
|---|---|---|
SmartPosterRecord()
Creates an empty smart poster. |
||
SmartPosterRecord(String uri,
String title,
String languageCode)
Creates a smart poster record using the specified URI, title, and language code. |
||
SmartPosterRecord(NDEFRecord ndefRecord)
Creates a smart poster record by extracting smart poster data from an existing NDEFRecord object. |
||
| Method Summary | ||
|---|---|---|
void |
addAdditionalRecord(NDEFRecord record)
Adds an additional NDEFRecord object to the smart poster. |
|
void |
addTitle(String title,
String languageCode)
Adds a title for a specified language code. |
|
NDEFRecord |
clone()
Returns an NDEFRecord object that is a clone of this smart poster. |
|
int |
getAction()
Returns the action associated with the smart poster. |
|
Vector |
getAdditionalRecords()
Returns the additional, user defined NDEFRecord objects included
in this smart poster. |
|
byte[] |
getIconBytes()
Returns a byte[] array of the icon image. |
|
String |
getIconType()
Returns the MIME type of the icon image. |
|
String |
getMimeType()
Returns the MIME type of the data referenced by the smart poster URI. |
|
byte[] |
getPayload()
Returns the payload for this smart poster NDEFRecord as a byte[]. |
|
int |
getSize()
Returns the size of the data referenced by the smart poster URI. |
|
Hashtable |
getTitles()
Returns a Hashtable that maps each supported language code to the
title for that language code. |
|
String |
getUri()
Returns the URI for this smart poster. |
|
void |
setAction(int action)
Sets the action associated with the smart poster. |
|
void |
setAdditionalRecords(Vector records)
Sets the additional, user defined NDEFRecord objects to be included in this smart poster. |
|
void |
setIconBytes(byte[] bytes)
Sets the byte[] icon image. |
|
void |
setIconType(String type)
Sets the MIME type of the icon image. |
|
void |
setMimeType(String type)
Sets the MIME type of the data referenced by the smart poster URI. |
|
void |
setPayload(byte[] payload)
This method is not supported because the payload is generated. |
|
void |
setSize(int size)
Sets the size of the data referenced by the smart poster URI. |
|
void |
setUri(String uri)
Sets the URI for this smart poster. |
|
| 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 |
|---|
public static final String SMART_POSTER_RECORD_TYPE
public static final int SMART_POSTER_ACTION_DEFAULT
public static final int SMART_POSTER_ACTION_SAVE
public static final int SMART_POSTER_ACTION_EDIT
| Constructor Detail |
|---|
public SmartPosterRecord()
throws NFCException
NFCException - If the smart poster record cannot be constructed.
public SmartPosterRecord(String uri,
String title,
String languageCode)
throws NFCException
uri - The URI for the smart poster.title - The title of the smart poster.languageCode - The language code associated with the title.
NFCException - If the smart poster record cannot be constructed.
IllegalArgumentException - If the uri parameter is null.
public SmartPosterRecord(NDEFRecord ndefRecord)
throws NFCException
NDEFRecord object.
ndefRecord - An NDEF record that contains an NFC Forum smart poster.
NFCException - If the smart poster record cannot be constructed.
IllegalArgumentException - If the ndefRecord parameter is null,
or the ndefRecord parameter does not contain a smart poster.| Method Detail |
|---|
public String getUri()
public void setUri(String uri)
IllegalArgumentException - If the uri parameter is null.public Hashtable getTitles()
Hashtable that maps each supported language code to the
title for that language code.
Hashtable that maps each supported language code to the
title for that language code.
public void addTitle(String title,
String languageCode)
title - The title to add.languageCode - The language code of the title to be added. The language code
should conform to RFC 3306.public String getMimeType()
public void setMimeType(String type)
type - The MIME type of the data referenced by the smart poster URI.public int getSize()
public void setSize(int size)
size - The size of the data referenced by the smart poster URI.public int getAction()
SMART_POSTER_ACTION_DEFAULTSMART_POSTER_ACTION_SAVESMART_POSTER_ACTION_EDIT
public void setAction(int action)
SMART_POSTER_ACTION_DEFAULTSMART_POSTER_ACTION_SAVESMART_POSTER_ACTION_EDIT
action - The action associated with the smart poster.public String getIconType()
public void setIconType(String type)
type - MIME type of the icon image.
IllegalArgumentException - If the type is not a valid image or video MIME type.public byte[] getIconBytes()
byte[] array of the icon image.
byte[] array of the icon image.public void setIconBytes(byte[] bytes)
byte[] icon image.
bytes - byte[] array of the icon image.public Vector getAdditionalRecords()
NDEFRecord objects included
in this smart poster.
Vector of additional NDEFRecord objects
included in the smart poster.public void setAdditionalRecords(Vector records)
NDEFRecord objects to be included in this smart poster.
records - Vector of additional NDEFRecord
objects to be included in the smart poster.public void addAdditionalRecord(NDEFRecord record)
NDEFRecord object to the smart poster.
record - Additional NDEFRecord to
add to the smart poster.public byte[] getPayload()
NDEFRecord as a byte[].
Note that the payload is generated each time this method is called.
getPayload in class NDEFRecordbyte[] representation of the payload for the smart poster.public void setPayload(byte[] payload)
setPayload in class NDEFRecordpayload - This parameter is not used.public NDEFRecord clone()
NDEFRecord object that is a clone of this smart poster.
clone in class NDEFRecordNDEFRecord that is a clone of this smart poster.
|
|||||||||
| 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