|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.types.VCardType
ezvcard.types.TypeParameterType<T>
ezvcard.types.MultiValuedTypeParameterType<ImppTypeParameter>
ezvcard.types.ImppType
public class ImppType
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".
VCard vcard = new VCard(); //URI ImppType impp = new ImppType("aim:johndoe@aol.com"); vcard.addImpp(impp); //static helper constructors impp = ImppType.msn("janedoe@msn.com"); vcard.addImpp(impp);
vCard property name: IMPP
vCard versions: 3.0, 4.0
Nested Class Summary | |
---|---|
protected static class |
ImppType.ImHtmlLink
Helper class for parsing and building instant messenger links for webpages. |
Field Summary | |
---|---|
static String |
NAME
|
Fields inherited from class ezvcard.types.VCardType |
---|
group, subTypes, typeName |
Constructor Summary | |
---|---|
ImppType()
|
|
ImppType(String uri)
Constructs a new IMPP type. |
|
ImppType(String protocol,
String handle)
Constructs a new IMPP type. |
|
ImppType(URI uri)
Constructs a new IMPP type. |
Method Summary | |
---|---|
void |
addPid(int localId,
int clientPidMapRef)
Adds a PID value. |
static ImppType |
aim(String handle)
Creates an IMPP property that contains a AOL Instant Messenger handle. |
String |
buildLink()
Builds a URI suitable for use as a link on a webpage. |
protected ImppTypeParameter |
buildTypeObj(String type)
Builds an object that wraps the value of the TYPE parameter. |
protected void |
doMarshalText(StringBuilder sb,
VCardVersion version,
List<String> warnings,
CompatibilityMode compatibilityMode)
Converts this type object to a string for sending over the wire. |
protected void |
doMarshalXml(XCardElement parent,
List<String> warnings,
CompatibilityMode compatibilityMode)
Marshals this type for inclusion in an xCard (XML document). |
protected void |
doUnmarshalHtml(HCardElement element,
List<String> warnings)
Unmarshals the type from an hCard (HTML document). |
protected void |
doUnmarshalText(String value,
VCardVersion version,
List<String> warnings,
CompatibilityMode compatibilityMode)
Unmarshals the type value from off the wire. |
protected void |
doUnmarshalXml(XCardElement element,
List<String> warnings,
CompatibilityMode compatibilityMode)
Unmarshals the type from an xCard (XML document). |
String |
getAltId()
Gets the ALTID. |
String |
getHandle()
Gets the IM handle. |
String |
getMediaType()
Gets the MEDIATYPE parameter. |
List<Integer[]> |
getPids()
Gets all PID parameter values. |
Integer |
getPref()
Gets the preference value. |
String |
getProtocol()
Gets the IM protocol. |
VCardVersion[] |
getSupportedVersions()
Gets the vCard versions that support this type. |
URI |
getUri()
Gets the IM URI. |
static ImppType |
icq(String handle)
Creates an IMPP property that contains an ICQ handle. |
static ImppType |
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 ImppType |
msn(String handle)
Creates an IMPP property that contains an MSN IMPP property. |
protected static URI |
parseUriFromLink(String linkUri)
Parses an IM URI from an HTML link. |
void |
removePids()
Removes all PID values. |
void |
setAltId(String altId)
Sets the ALTID. |
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 ImppType |
sip(String handle)
Creates an IMPP property that contains a Session Initiation Protocol handle. |
static ImppType |
skype(String handle)
Creates an IMPP property that contains a Skype handle. |
static ImppType |
xmpp(String handle)
Creates an IMPP property that contains an Extensible Messaging and Presence Protocol handle. |
static ImppType |
yahoo(String handle)
Creates an IMPP property that contains a Yahoo! Messenger handle. |
Methods inherited from class ezvcard.types.MultiValuedTypeParameterType |
---|
addType, getTypes, removeType |
Methods inherited from class ezvcard.types.VCardType |
---|
compareTo, doMarshalSubTypes, getGroup, getQName, getSubTypes, getTypeName, marshalSubTypes, marshalText, marshalXml, setGroup, unmarshalHtml, unmarshalText, unmarshalXml |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NAME
Constructor Detail |
---|
public ImppType()
public ImppType(String uri)
uri
- the IM URI (e.g. "aim:johndoe@aol.com")
IllegalArgumentException
- if the URI is not a valid URIpublic ImppType(URI uri)
uri
- the IM URI (e.g. "aim:johndoe@aol.com")public ImppType(String protocol, String handle)
protocol
- the IM protocol (e.g. "aim")handle
- the IM handle (e.g. "johndoe@aol.com")Method Detail |
---|
public static ImppType aim(String handle)
handle
- the IM handle
public boolean isAim()
public static ImppType yahoo(String handle)
handle
- the IM handle
public boolean isYahoo()
public static ImppType msn(String handle)
handle
- the IM handle
public boolean isMsn()
public static ImppType icq(String handle)
handle
- the IM handle
public boolean isIcq()
public static ImppType irc(String handle)
handle
- the IM handle
public boolean isIrc()
public static ImppType sip(String handle)
handle
- the IM handle
public boolean isSip()
public static ImppType skype(String handle)
handle
- the IM handle
public boolean isSkype()
public static ImppType 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 String getMediaType()
vCard versions: 4.0
public void setMediaType(String mediaType)
vCard versions: 4.0
mediaType
- the media type or null to removepublic List<Integer[]> getPids()
vCard versions: 4.0
VCardSubTypes.getPids()
public void addPid(int localId, int clientPidMapRef)
vCard versions: 4.0
localId
- the local IDclientPidMapRef
- the ID used to reference the property's globally
unique identifier in the CLIENTPIDMAP property.VCardSubTypes.addPid(int, int)
public void removePids()
vCard versions: 4.0
VCardSubTypes.removePids()
public Integer getPref()
vCard versions: 4.0
VCardSubTypes.getPref()
public void setPref(Integer pref)
vCard versions: 4.0
pref
- the preference value or null to removeVCardSubTypes.setPref(java.lang.Integer)
public String getAltId()
vCard versions: 4.0
VCardSubTypes.getAltId()
public void setAltId(String altId)
vCard versions: 4.0
altId
- the ALTID or null to removeVCardSubTypes.setAltId(java.lang.String)
protected ImppTypeParameter buildTypeObj(String type)
TypeParameterType
buildTypeObj
in class TypeParameterType<ImppTypeParameter>
type
- the value of the TYPE parameter
public VCardVersion[] getSupportedVersions()
VCardType
getSupportedVersions
in class VCardType
protected void doMarshalText(StringBuilder sb, VCardVersion version, List<String> warnings, CompatibilityMode compatibilityMode)
VCardType
doMarshalText
in class VCardType
sb
- the buffer to add the marshalled value toversion
- the version vCard that is being generatedwarnings
- allows the programmer to alert the user to any
note-worthy (but non-critical) issues that occurred during the
marshalling processcompatibilityMode
- allows the programmer to customize the
marshalling process depending on the expected consumer of the vCardprotected void doUnmarshalText(String value, VCardVersion version, List<String> warnings, CompatibilityMode compatibilityMode)
VCardType
doUnmarshalText
in class VCardType
value
- the unfolded value from off the wire. If the wire value is
in the "quoted-printable" encoding, it will be decoded.version
- the version of the vCard that is being read or null if the
VERSION type has not been parsed yet (v3.0 and v4.0 require that the
VERSION type be at the top of the vCard, but v2.1 has no such
requirement)warnings
- allows the programmer to alert the user to any
note-worthy (but non-critical) issues that occurred during the
unmarshalling processcompatibilityMode
- allows you to customize the unmarshalling
process depending on where the vCard came fromprotected void doMarshalXml(XCardElement parent, List<String> warnings, CompatibilityMode compatibilityMode)
VCardType
doMarshalXml
in class VCardType
parent
- the XML element that the type's value will be inserted
into. For example, this would be the "<fn>" element for the "FN"
type.warnings
- allows the programmer to alert the user to any
note-worthy (but non-critical) issues that occurred during the
marshalling processcompatibilityMode
- allows the programmer to customize the
marshalling process depending on the expected consumer of the vCardprotected void doUnmarshalXml(XCardElement element, List<String> warnings, CompatibilityMode compatibilityMode)
VCardType
doUnmarshalXml
in class VCardType
element
- the XML element that contains the type data. For example,
this would be the "<fn>" element for the "FN" type. This object
will NOT include the "<parameters>" child element (it is removed
after being unmarshalled into a VCardSubTypes
object).warnings
- allows the programmer to alert the user to any
note-worthy (but non-critical) issues that occurred during the
unmarshalling processcompatibilityMode
- allows the programmer to customize the
unmarshalling process depending on where the vCard came fromprotected void doUnmarshalHtml(HCardElement element, List<String> warnings)
VCardType
doUnmarshalHtml
in class VCardType
element
- the HTML element that contains the type data.warnings
- allows the programmer to alert the user to any
note-worthy (but non-critical) issues that occurred during the
unmarshalling processprotected static URI parseUriFromLink(String linkUri)
linkUri
- the HTML link (e.g. "aim:goim?screenname=theuser")
public String buildLink()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |