javax.microedition.contactless
Interface TargetProperties


public interface TargetProperties

This interface collects the properties that are common for all contactless targets supported by this specification.

The API implementation may extend this interface to store more target type and physical media type specific properties.


Method Summary
 java.lang.Class[] getConnectionNames()
          Returns the names of connection interfaces that can be opened to communicate with the target as Class objects.
 java.lang.String getMapping()
          If the target type is RFID_TAG this method returns the name of the mapping between the commands in the PlainTagConnection and the physical target structure.
 java.lang.String getProperty(java.lang.String name)
          With this method the application can query target specific properties.
 TargetType[] getTargetTypes()
          Returns the type of the discovered target.
 java.lang.String getUid()
          Returns the unique identifier (UID) for the target.
 java.lang.String getUrl()
          Returns the URL to open a connection to the NDEF_TAG target.
 java.lang.String getUrl(java.lang.Class connectionName)
          Returns the URL for the requested connection to the discovered target.
 boolean hasTargetType(TargetType type)
          Convenience method for checking if the detected target is of specified target type.
 

Method Detail

getConnectionNames

java.lang.Class[] getConnectionNames()
Returns the names of connection interfaces that can be opened to communicate with the target as Class objects. The marker interface TagConnection must not be returned. The API implementation must use the lowest level interface in case of inherited connections.

Returns:
the list of available connections to the target

getMapping

java.lang.String getMapping()

If the target type is RFID_TAG this method returns the name of the mapping between the commands in the PlainTagConnection and the physical target structure. The returned String can be, for example, "Mifare 1K". If the access to the tag is only supported through some target-specific connection interface the API implementation provides and not through the PlainTagConnection interface, this method returns null. If mapping name is provided for the RFID_TAG, the PlainTagConnection must be one of the connections returned with the method getConnectionNames. Mapping names ISO14443A and ISO14443B may be used to indicate protocol based mapping.

For NDEF_TAG targets this method returns the name and the version of the NDEF mapping, like for example, "JewelTag v1.0"". In both cases the mapping name is provided by the API implementation or by the physical tag manufacturer. For other target types the method must return null.

Returns:
the name of the mapping, or null if target type does not have mapping

getProperty

java.lang.String getProperty(java.lang.String name)
With this method the application can query target specific properties. This property can be, for example, the slot number needed to open a JSR 177 APDUConnection to the external smart card. In this case the name of the property could be JSR177_slot. The property name values are implementation dependant and not specified in the API.

Parameters:
name - the name of the requested property
Returns:
the value of the property, null if the property with the specified name has not been defined

getTargetTypes

TargetType[] getTargetTypes()
Returns the type of the discovered target. Possible return values are defined in TargetType class. An NDEF_TAG target always has other physical level target type. This type is either RFID_TAG or ISO14443_CARD. In the case of NDEF_TAG also the physical level type must be returned. The NDEF_TAG target must be the first value in the return array followed by the physical level type.

Returns:
an array of the target types

getUid

java.lang.String getUid()

Returns the unique identifier (UID) for the target. The identifier is likely to be globally unique, though with some devices it may not be constant all the time. Visual tags do not have this identifier. The rules for constructing the UID for different target technologies are defined in the

getUrl

java.lang.String getUrl()
Returns the URL to open a connection to the NDEF_TAG target. If the type of the target is not NDEF_TAG null is returned.

Returns:
the URL to NDEF_TAG target, otherwise null

getUrl

java.lang.String getUrl(java.lang.Class connectionName)
Returns the URL for the requested connection to the discovered target. This URL used to open a connection to the target.

Parameters:
connectionName - name of the connection
Returns:
the URL to the target
Throws:
java.lang.NullPointerException - if connectionName is null
java.lang.IllegalArgumentException - if the URL for the given connectionName is not supported or allowed by the target

hasTargetType

boolean hasTargetType(TargetType type)
Convenience method for checking if the detected target is of specified target type.

Parameters:
type - the type of the target
Returns:
true if the target is of the specified type, else false


Copyright © 2005-2006 Nokia Corporation. All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.