public class Agent extends VCardProperty
Defines information about the person's agent.
Code sample (creating)
VCard vcard = new VCard(); //URL Agent agent = new Agent("http://www.linkedin.com/BobSmith"); vcard.setAgent(agent); //vCard VCard agentVCard = new VCard(); agentVCard.setFormattedName("Bob Smith"); agentVCard.addTelephoneNumber("(555) 123-4566"); agentVCard.addUrl("http://www.linkedin.com/BobSmith"); agent = new Agent(agentVCard); vcard.setAgent(agent);
Code sample (retrieving)
VCard vcard = ... Agent agent = vcard.getAgent(); String url = agent.getUrl(); if (url != null){ //property value is a URL } VCard agentVCard = agent.getVCard(); if (agentVCard != null){ //property value is a vCard }
Property name: AGENT
Supported versions: 2.1, 3.0
group, parameters
Constructor and Description |
---|
Agent()
Creates an empty agent property.
|
Agent(java.lang.String url)
Creates an agent property.
|
Agent(VCard vcard)
Creates an agent property.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<VCardVersion> |
_supportedVersions()
Gets the vCard versions that support this property.
|
protected void |
_validate(java.util.List<Warning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
java.lang.String |
getUrl()
Gets the URL to the agent's information.
|
VCard |
getVCard()
Gets an embedded vCard with the agent's information.
|
void |
setUrl(java.lang.String url)
Sets the URL to the agent's information.
|
void |
setVCard(VCard vcard)
Sets an embedded vCard with the agent's information.
|
addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate
public Agent()
public Agent(java.lang.String url)
url
- a URL pointing to the agent's informationpublic Agent(VCard vcard)
vcard
- a vCard containing the agent's informationpublic java.util.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 java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- the URLpublic VCard getVCard()
public void setVCard(VCard vcard)
vcard
- the vCardprotected void _validate(java.util.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 toThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.