|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.property.VCardProperty
ezvcard.property.Impp
public class Impp
An instant message handle. The handle is represented as a URI in the format "
<IM-PROTOCOL>:<IM-HANDLE>
". For example, someone with a Yahoo!
Messenger handle of "johndoe@yahoo.com" would have an IMPP vCard property
value of "ymsgr:johndoe@yahoo.com".
Code sample
VCard vcard = new VCard(); //URI Impp impp = new Impp("aim:johndoe@aol.com"); vcard.addImpp(impp); //static factory methods impp = Impp.msn("janedoe@msn.com"); vcard.addImpp(impp);
Property name: IMPP
Supported versions: 3.0, 4.0
Field Summary |
---|
Fields inherited from class ezvcard.property.VCardProperty |
---|
group, parameters |
Constructor Summary | |
---|---|
Impp(String uri)
Creates an IMPP property. |
|
Impp(String protocol,
String handle)
Creates an IMPP property. |
|
Impp(URI uri)
Creates an IMPP property. |
Method Summary | |
---|---|
Set<VCardVersion> |
_supportedVersions()
Gets the vCard versions that support this property. |
protected void |
_validate(List<Warning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the spec. |
void |
addPid(int localId,
int clientPidMapRef)
Adds a PID value. |
void |
addType(ImppType type)
Adds a TYPE parameter. |
static Impp |
aim(String handle)
Creates an IMPP property that contains a AOL Instant Messenger handle. |
String |
getAltId()
Gets the property's ALTID parameter. |
String |
getHandle()
Gets the IM handle. |
String |
getMediaType()
Gets the MEDIATYPE parameter. |
List<Integer[]> |
getPids()
Gets all PID values. |
Integer |
getPref()
Gets the preference value. |
String |
getProtocol()
Gets the IM protocol. |
Set<ImppType> |
getTypes()
Gets all the TYPE parameters. |
URI |
getUri()
Gets the IM URI. |
static Impp |
icq(String handle)
Creates an IMPP property that contains an ICQ handle. |
static Impp |
irc(String handle)
Creates an IMPP property that contains an IRC handle. |
boolean |
isAim()
Determines if this IMPP property contains an AOL Instant Messenger handle. |
boolean |
isIcq()
Determines if this IMPP property contains an ICQ handle. |
boolean |
isIrc()
Determines if this IMPP property contains an IRC handle. |
boolean |
isMsn()
Determines if this IMPP property contains an MSN handle. |
boolean |
isSip()
Determines if this IMPP property contains a Session Initiation Protocol handle. |
boolean |
isSkype()
Determines if this IMPP property contains a Skype handle. |
boolean |
isXmpp()
Determines if this IMPP property contains an Extensible Messaging and Presence Protocol handle. |
boolean |
isYahoo()
Determines if this IMPP property contains a Yahoo! Messenger handle. |
static Impp |
msn(String handle)
Creates an IMPP property that contains an MSN IMPP property. |
void |
removePids()
Removes all PID values. |
void |
removeType(ImppType type)
Removes a TYPE parameter. |
void |
setAltId(String altId)
Sets the property's ALTID parameter. |
void |
setMediaType(String mediaType)
Sets the MEDIATYPE parameter. |
void |
setPref(Integer pref)
Sets the preference value. |
void |
setUri(String uri)
Sets the IM URI. |
void |
setUri(String protocol,
String handle)
Sets the IM URI. |
void |
setUri(URI uri)
Sets the IM URI. |
static Impp |
sip(String handle)
Creates an IMPP property that contains a Session Initiation Protocol handle. |
static Impp |
skype(String handle)
Creates an IMPP property that contains a Skype handle. |
static Impp |
xmpp(String handle)
Creates an IMPP property that contains an Extensible Messaging and Presence Protocol handle. |
static Impp |
yahoo(String handle)
Creates an IMPP property that contains a Yahoo! Messenger handle. |
Methods inherited from class ezvcard.property.VCardProperty |
---|
addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Impp(String uri)
uri
- the IM URI (e.g. "aim:johndoe@aol.com")
IllegalArgumentException
- if the URI is not a valid URIpublic Impp(URI uri)
uri
- the IM URI (e.g. "aim:johndoe@aol.com")public Impp(String protocol, String handle)
protocol
- the IM protocol (e.g. "aim")handle
- the IM handle (e.g. "johndoe@aol.com")Method Detail |
---|
public Set<VCardVersion> _supportedVersions()
VCardProperty
Gets the vCard versions that support this property.
This method should be overridden by child classes if the property does not support all vCard versions. The default implementation of this method returns all vCard versions.
_supportedVersions
in class VCardProperty
public static Impp aim(String handle)
handle
- the IM handle
public boolean isAim()
public static Impp yahoo(String handle)
handle
- the IM handle
public boolean isYahoo()
public static Impp msn(String handle)
handle
- the IM handle
public boolean isMsn()
public static Impp icq(String handle)
handle
- the IM handle
public boolean isIcq()
public static Impp irc(String handle)
handle
- the IM handle
public boolean isIrc()
public static Impp sip(String handle)
handle
- the IM handle
public boolean isSip()
public static Impp skype(String handle)
handle
- the IM handle
public boolean isSkype()
public static Impp xmpp(String handle)
handle
- the IM handle
public boolean isXmpp()
public URI getUri()
public void setUri(String uri)
uri
- the IM URI (e.g. "aim:theuser@aol.com")
IllegalArgumentException
- if the URI is not a valid URIpublic void setUri(URI uri)
uri
- the IM URI (e.g. "aim:theuser@aol.com")public void setUri(String protocol, String handle)
protocol
- the IM protocol (e.g. "aim")handle
- the IM handle (e.g. "theuser@aol.com")public String getProtocol()
setUri(String, String)
to set the
protocol.
public String getHandle()
setUri(String, String)
to set the
handle.
public Set<ImppType> getTypes()
public void addType(ImppType type)
type
- the TYPE parameter to addpublic void removeType(ImppType type)
type
- the TYPE parameter to removepublic String getMediaType()
Supported versions: 4.0
public void setMediaType(String mediaType)
Supported versions: 4.0
mediaType
- the media type or null to removepublic List<Integer[]> getPids()
VCardProperty
Gets all PID values.
Supported versions: 4.0
VCardParameters.getPids()
public void addPid(int localId, int clientPidMapRef)
VCardProperty
Adds a PID value.
Supported versions: 4.0
localId
- the local IDclientPidMapRef
- the ID used to reference the property's globally
unique identifier in the CLIENTPIDMAP property.VCardParameters.addPid(int, int)
public void removePids()
VCardProperty
Removes all PID values.
Supported versions: 4.0
VCardParameters.removePids()
public Integer getPref()
VCardProperty
Gets the preference value. The lower the number, the more preferred this property instance is compared with other properties in the same vCard of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
Supported versions: 4.0
VCardParameters.getPref()
public void setPref(Integer pref)
VCardProperty
Sets the preference value. The lower the number, the more preferred this property instance is compared with other properties in the same vCard of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
Supported versions: 4.0
pref
- the preference value or null to removeVCardParameters.setPref(java.lang.Integer)
public String getAltId()
HasAltId
Supported versions: 4.0
getAltId
in interface HasAltId
VCardParameters.getAltId()
public void setAltId(String altId)
HasAltId
Supported versions: 4.0
setAltId
in interface HasAltId
altId
- the ALTID or null to removeVCardParameters.setAltId(java.lang.String)
protected void _validate(List<Warning> warnings, VCardVersion version, VCard vcard)
VCardProperty
_validate
in class VCardProperty
warnings
- the list to add the warnings toversion
- the version to check the property againstvcard
- the vCard this property belongs to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |