public class VCard extends SmartMessage
Example:
... SmsService service = new GsmSmsService(); ... VCard card = new VCard(); card.setItem(VCard.NAME, "Fredy Bean"); card.setItem(VCard.ORG, "object XP"); card.addItem(VCard.TEL, new String[]{VCard.TYPE_WORK, VCard.TYPE_VOICE}, "0012345678"); card.addItem(VCard.TEL, new String[]{VCard.TYPE_WORK, VCard.TYPE_FAX}, "0023456789"); card.addItem(VCard.TEL, new String[]{VCard.TYPE_HOME, VCard.TYPE_CELL}, "0034567890"); card.addItem(VCard.ADR, new String[]{VCard.TYPE_WORK}, "Marktgasse 11, Winterthur, Switzerland"); card.setRecipient("+41791234567"); service.sendMessage(card); ...For more information about VCard visit the web-site of the Internet Mail Consortium.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADR
Delivery Address, may contain types DOM, INTL, POSTAL, PARCEL, HOME, WORK
|
static java.lang.String |
AGENT
Specifies information about another person who will act on behalf
|
static java.lang.String |
BDAY
Specifies the birth date
|
static int |
CELL
Deprecated.
use Strings parameters with
addItem(String, String[], String) instead. |
static int |
DOM
Deprecated.
use String parameters with
addItem(String, String[], String) |
static java.lang.String |
EMAIL
Electronic Mail Address.
|
static int |
FAX
Deprecated.
use String parameters with
addItem(String, String[], String) |
static java.lang.String |
FORMATED_NAME
Specifies the formatted text corresponding to the name of the object
|
static java.lang.String |
GEO
Specifies information related to the global position
|
static int |
HOME
Deprecated.
use String parameters with
addItem(String, String[], String) |
static int |
INTL
Deprecated.
use String parameters with
addItem(String, String[], String) |
static java.lang.String |
LABEL
Delivery Label, may contain types DOM, INTL, POSTAL, PARCEL, HOME, WORK
|
static java.lang.String |
MAILER
Specifies the type of electronic mail software that is used
|
static java.lang.String |
NAME
Specifies the Name
|
static java.lang.String |
NO_TYPE
Indicates the default type if no type is set.
|
static java.lang.String |
NOTE
Specifies supplemental information or a comment
|
static java.lang.String |
ORG
Specifies the organizational name and unit
|
static int |
PAGER
Deprecated.
use String parameters with
addItem(String, String[], String) |
static java.lang.String |
REV
Specifies the combination of the calendar date and time of day of the
last update to the vCard object
|
static java.lang.String |
ROLE
Specifies information concerning the role, occupation, or business category
|
static java.lang.String |
TEL
Specifies the Phone Number, may contain types PREF, WORK, HOME, VOICE,
FAX, MSG, CELL, PAGER, BBS, MODEM, CAR, ISDN, VIDEO
|
static java.lang.String |
TITLE
Specifies the job title, functional position or function
|
static java.lang.String |
TYPE_BBS
Indicates a bulletin board service number
|
static java.lang.String |
TYPE_CAR
Indicates a car-phone number
|
static java.lang.String |
TYPE_CELL
Type definition for Mobile Phone
|
static java.lang.String |
TYPE_DOM
Place definition for domestic
|
static java.lang.String |
TYPE_FAX
Type definition for a Fax
|
static java.lang.String |
TYPE_HOME
Indicates a home number or place
|
static java.lang.String |
TYPE_INTL
Place definition for international
|
static java.lang.String |
TYPE_ISDN
Indicates an ISDN number
|
static java.lang.String |
TYPE_MODEM
Indicates a MODEM number
|
static java.lang.String |
TYPE_MSG
Indicates a messaging service on the number
|
static java.lang.String |
TYPE_PAGER
Type definition for Pager
|
static java.lang.String |
TYPE_PARCEL
Indicates a parcel delivery address
|
static java.lang.String |
TYPE_POSTAL
Indicates a postal delivery address
|
static java.lang.String |
TYPE_PREF
Indicates preferred number or place
|
static java.lang.String |
TYPE_VIDEO
Indicates a video-phone number
|
static java.lang.String |
TYPE_VOICE
type definition for Voice
|
static java.lang.String |
TYPE_WORK
Indicates a work number or place
|
static java.lang.String |
TZ
Specifies information related to the standard time
|
static java.lang.String |
UDI
Specifies a persistent, globally unique identifier
|
static java.lang.String |
URL
Specifies a Internet location
|
static int |
VOICE
Deprecated.
use String parameters with
addItem(String, String[], String) |
static int |
WORK
Deprecated.
use String parameters with
addItem(String, String[], String) |
CLASS_0, CLASS_1, CLASS_2, CLASS_3, DC_8BIT, DC_DEFAULT, DC_GROUP_DATA, DC_GROUP_GENERAL, DC_GROUP_MSG_WAITING_DISCARD, DC_GROUP_MSG_WAITING_STORE, DC_UCS2, INDICATION_ACTIVE, INDICATION_INACTIVE, INDICATION_TYPE_EMAIL, INDICATION_TYPE_FAX, INDICATION_TYPE_OTHER, INDICATION_TYPE_VOICEMAIL, NO_CLASS
ACK_TIME, MT_BINARY, MT_STATUS, MT_TEXT, SENDER_TYPE_ALPHA, SENDER_TYPE_GUESS, SENDER_TYPE_NUMBER
Constructor and Description |
---|
VCard()
Creates a new, empty VCard.
|
VCard(SmsService service)
Deprecated.
since jSMS 1.7, use
VCard() |
Modifier and Type | Method and Description |
---|---|
void |
addAddress(int place,
java.lang.String addr)
Deprecated.
since jSMS 1.8, because the VCard specification allows to add several types for a address.
Use
addItem(String, String[], String) instead. |
void |
addItem(java.lang.String item,
java.lang.String[] types,
java.lang.String value)
Adds the given value to the internal properties.
|
void |
addTel(int place,
int type,
java.lang.String tel)
Deprecated.
since jSMS 1.8, because the VCard specification allows to add more the two types for a phone.
Use
addItem(String, String[], String) instead. |
java.lang.String |
getItem(java.lang.String item)
Gets the value associated with a specific item or null if the item is not set.
|
java.util.Iterator |
getItems()
Returns all items which are set in this VCard.
|
java.util.Properties |
getItems(java.lang.String item)
Returns the types and values associated with a specific item.
|
java.lang.String |
getMessage()
Get the Message (User Data) as String.
|
java.lang.String |
getName()
Deprecated.
since jSMS 1.8, use
getItem(String) instead. |
byte[] |
getUserData()
Get the User Data of this message.
|
void |
setAddress(java.lang.String addr)
Deprecated.
since jSMS 1.8, use
setItem(String, String) instead. |
void |
setBirthday(java.lang.String b)
Deprecated.
since jSMS 1.8, use
setItem(String, String) instead. |
void |
setItem(java.lang.String item,
java.lang.String value)
Sets a Item without a type.
|
void |
setName(java.lang.String n)
Deprecated.
since jSMS 1.8, use
setItem(String, String) instead. |
void |
setOrganisation(java.lang.String org)
Deprecated.
since jSMS 1.8, use
setItem(String, String) instead. |
void |
setTel(java.lang.String tel)
Deprecated.
since jSMS 1.8, use
setItem(String, String) instead. |
buildParts, buildParts, getParts, getTimestamp
containsUserDataHeader, copyFields, getAlphabet, getBytes, getCodingGroup, getDeferredDeliveryAsDate, getDeferredDeliveryInMinutes, getID, getIndicationState, getIndicationType, getMessageClass, getParent, getPID, getRecipient, getRecipientAddress, getSender, getSenderAddress, getType, getUserDataHeader, getValidityPeriodAsDate, getValidityPeriodInMinutes, hasDeferredDelivery, hasMessageClass, hasValidityPeriod, isCompressed, isMMS, isRejectDuplicates, isRelativeDeferredDelivery, isRelativeValidityPeriod, isReplyPath, requestStatusReport, requestStatusReport, setAlphabet, setCodingGroup, setCompression, setDeferredDelivery, setDeferredDelivery, setIndicationState, setIndicationType, setMessage, setMessage, setMessageClass, setMMS, setParent, setPID, setRecipient, setRecipientAddress, setRejectDuplicates, setReplyPath, setSender, setSenderAddress, setType, setUserData, setUserDataHeader, setUserDataHeader, setValidityPeriod, setValidityPeriod, toString
clone, getProperty, getSenderType, setID, setProperty, setSenderType
public static final java.lang.String TEL
public static final java.lang.String ADR
public static final java.lang.String LABEL
public static final java.lang.String EMAIL
public static final java.lang.String NAME
public static final java.lang.String BDAY
public static final java.lang.String ORG
public static final java.lang.String FORMATED_NAME
public static final java.lang.String TITLE
public static final java.lang.String ROLE
public static final java.lang.String NOTE
public static final java.lang.String REV
public static final java.lang.String URL
public static final java.lang.String UDI
public static final java.lang.String TZ
public static final java.lang.String GEO
public static final java.lang.String MAILER
public static final java.lang.String AGENT
public static final java.lang.String TYPE_CELL
public static final java.lang.String TYPE_PAGER
public static final java.lang.String TYPE_FAX
public static final java.lang.String TYPE_VOICE
public static final java.lang.String TYPE_PREF
public static final java.lang.String TYPE_WORK
public static final java.lang.String TYPE_HOME
public static final java.lang.String TYPE_MSG
public static final java.lang.String TYPE_BBS
public static final java.lang.String TYPE_MODEM
public static final java.lang.String TYPE_CAR
public static final java.lang.String TYPE_ISDN
public static final java.lang.String TYPE_VIDEO
public static final java.lang.String TYPE_DOM
public static final java.lang.String TYPE_INTL
public static final java.lang.String TYPE_PARCEL
public static final java.lang.String TYPE_POSTAL
public static final java.lang.String NO_TYPE
public static final int CELL
addItem(String, String[], String)
instead.public static final int PAGER
addItem(String, String[], String)
public static final int FAX
addItem(String, String[], String)
public static final int VOICE
addItem(String, String[], String)
public static final int WORK
addItem(String, String[], String)
public static final int HOME
addItem(String, String[], String)
public static final int DOM
addItem(String, String[], String)
public static final int INTL
addItem(String, String[], String)
public VCard() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public VCard(SmsService service) throws java.lang.IllegalArgumentException
VCard()
service
- the initialized SmsService used for sending the messagejava.lang.IllegalArgumentException
- if the SmsService is null or has not yet
been initializedpublic void setName(java.lang.String n)
setItem(String, String)
instead.n
- String representing the namepublic java.lang.String getName()
getItem(String)
instead.public void setOrganisation(java.lang.String org)
setItem(String, String)
instead.org
- organisation namepublic void setBirthday(java.lang.String b)
setItem(String, String)
instead.b
- public void setTel(java.lang.String tel)
setItem(String, String)
instead.tel
- the phone numberpublic void addTel(int place, int type, java.lang.String tel) throws java.lang.IllegalArgumentException
addItem(String, String[], String)
instead.place
- int value representing a placetype
- int value representing a typetel
- the phone numberjava.lang.IllegalArgumentException
public void setAddress(java.lang.String addr)
setItem(String, String)
instead.addr
- String representing the address.public void addAddress(int place, java.lang.String addr)
addItem(String, String[], String)
instead.place
- int value representing a place.addr
- java.lang.IllegalArgumentException
public void setItem(java.lang.String item, java.lang.String value)
public void addItem(java.lang.String item, java.lang.String[] types, java.lang.String value) throws java.lang.IllegalArgumentException
TYPE_HOME
, TYPE_CAR
,... or any
other types according to the VCard specification.java.lang.IllegalArgumentException
public java.lang.String getItem(java.lang.String item)
getItems(String)
instead.public java.util.Properties getItems(java.lang.String item)
key | value | |
[HOME] | [+41525008844] | |
[HOME;FAX] | [+4152508848] | |
[CELL] | [+41785001122] | |
[] | [+41785001122] | (default) |
NO_TYPE
public java.util.Iterator getItems()
getItem(String)
public java.lang.String getMessage()
SmsMessage
getMessage
in class SmsMessage
SmsMessage.getUserData()
public byte[] getUserData()
SmsMessage
getUserData
in class SmsMessage
object XP, Inc. © 2000-2013. All rights reserved object XP