ezvcard.property
Class Agent

java.lang.Object
  extended by ezvcard.property.VCardProperty
      extended by ezvcard.property.Agent
All Implemented Interfaces:
Comparable<VCardProperty>

public class Agent
extends VCardProperty

An embedded vCard or URL containing the information of someone who represents the person.

URL

 VCard vcard = new VCard();
 Agent agent = new Agent("http://mi5.gov.uk/007");
 vcard.setAgent(agent);
 

vCard

 VCard vcard = new VCard();
 VCard agentVcard = new VCard();
 agentVcard.setFormattedName("Agent 007");
 Agent agent = new Agent(agentVcard);
 vcard.setAgent(agent);
 

Property name: AGENT

Supported versions: 2.1, 3.0

Author:
Michael Angstadt

Field Summary
 
Fields inherited from class ezvcard.property.VCardProperty
group, parameters
 
Constructor Summary
Agent()
          Creates an empty agent property.
Agent(String url)
          Creates an agent property.
Agent(VCard vcard)
          Creates an agent 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.
 String getUrl()
          Gets the URL to the agent's information.
 VCard getVCard()
          Gets an embedded vCard with the agent's information.
 void setUrl(String url)
          Sets the URL to the agent's information.
 void setVCard(VCard vcard)
          Sets an embedded vCard with the agent's information.
 
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

Agent

public Agent()
Creates an empty agent property.


Agent

public Agent(String url)
Creates an agent property.

Parameters:
url - a URL pointing to the agent's information

Agent

public Agent(VCard vcard)
Creates an agent property.

Parameters:
vcard - a vCard containing the agent's information
Method Detail

_supportedVersions

public Set<VCardVersion> _supportedVersions()
Description copied from class: 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.

Overrides:
_supportedVersions in class VCardProperty
Returns:
the vCard versions that support this property.

getUrl

public String getUrl()
Gets the URL to the agent's information.

Returns:
the URL or null if not set

setUrl

public void setUrl(String url)
Sets the URL to the agent's information.

Parameters:
url - the URL

getVCard

public VCard getVCard()
Gets an embedded vCard with the agent's information.

Returns:
the vCard or null if not set

setVCard

public void setVCard(VCard vcard)
Sets an embedded vCard with the agent's information.

Parameters:
vcard - the vCard

_validate

protected void _validate(List<Warning> warnings,
                         VCardVersion version,
                         VCard vcard)
Description copied from class: VCardProperty
Checks the property for data consistency problems or deviations from the spec. Meant to be overridden by child classes that wish to provide validation logic.

Overrides:
_validate in class VCardProperty
Parameters:
warnings - the list to add the warnings to
version - the version to check the property against
vcard - the vCard this property belongs to


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.