|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.property.VCardProperty
ezvcard.property.Address
public class Address
A mailing address.
Adding an address
VCard vcard = new VCard(); Address adr = new Address(); adr.setStreetAddress("123 Main St."); adr.setLocality("Austin"); adr.setRegion("TX"); adr.setPostalCode("12345"); adr.setCountry("USA"); adr.addType(AddressType.WORK); adr.addType(AddressType.DOM); //optionally, provide the exact text to print out on the mailing label adr.setLabel("123 Main St.\nAustin, Tx 12345\nUSA"); vcard.addAddress(adr);
Getting the addresses
VCard vcard = ... for (Address adr : vcard.getAddresses()){ ... }
Property name: ADR
Supported versions: 2.1, 3.0, 4.0
Field Summary |
---|
Fields inherited from class ezvcard.property.VCardProperty |
---|
group, parameters |
Constructor Summary | |
---|---|
Address()
|
Method Summary | |
---|---|
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(AddressType type)
Adds a TYPE parameter. |
String |
getAltId()
Gets the property's ALTID parameter. |
String |
getCountry()
Gets the country. |
String |
getExtendedAddress()
Gets the extended address. |
double[] |
getGeo()
Gets the global positioning coordinates that are associated with this address. |
String |
getLabel()
Gets the label of the address. |
String |
getLanguage()
Gets the language that the property value is written in. |
String |
getLocality()
Gets the locality (city) |
List<Integer[]> |
getPids()
Gets all PID values. |
String |
getPoBox()
Gets the P.O. |
String |
getPostalCode()
Gets the postal code. |
Integer |
getPref()
Gets the preference value. |
String |
getRegion()
Gets the region. |
String |
getStreetAddress()
Gets the street address |
String |
getTimezone()
Gets the timezone that's associated with this address. |
Set<AddressType> |
getTypes()
Gets all the TYPE parameters. |
void |
removePids()
Removes all PID values. |
void |
removeType(AddressType type)
Removes a TYPE parameter. |
void |
setAltId(String altId)
Sets the property's ALTID parameter. |
void |
setCountry(String country)
Sets the country. |
void |
setExtendedAddress(String extendedAddress)
Sets the extended address. |
void |
setGeo(double latitude,
double longitude)
Sets the global positioning coordinates that are associated with this address. |
void |
setLabel(String label)
Sets the label of the address. |
void |
setLanguage(String language)
Sets the language that the property value is written in. |
void |
setLocality(String locality)
Sets the locality (city). |
void |
setPoBox(String poBox)
Sets the P.O. |
void |
setPostalCode(String postalCode)
Sets the postal code. |
void |
setPref(Integer pref)
Sets the preference value. |
void |
setRegion(String region)
Sets the region. |
void |
setStreetAddress(String streetAddress)
Sets the street address. |
void |
setTimezone(String timezone)
Sets the timezone that's associated with this address. |
Methods inherited from class ezvcard.property.VCardProperty |
---|
_supportedVersions, 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 Address()
Method Detail |
---|
public String getPoBox()
public void setPoBox(String poBox)
poBox
- the P.O. box or null to removepublic String getExtendedAddress()
public void setExtendedAddress(String extendedAddress)
extendedAddress
- the extended address (e.g. "Suite 200") or null to
removepublic String getStreetAddress()
public void setStreetAddress(String streetAddress)
streetAddress
- the street address (e.g. "123 Main St") or null to
removepublic String getLocality()
public void setLocality(String locality)
locality
- the locality or null to removepublic String getRegion()
public void setRegion(String region)
region
- the region (e.g. "Texas") or null to removepublic String getPostalCode()
public void setPostalCode(String postalCode)
postalCode
- the postal code (e.g. "90210") or null to removepublic String getCountry()
public void setCountry(String country)
country
- the country (e.g. "USA") or null to removepublic Set<AddressType> getTypes()
public void addType(AddressType type)
type
- the TYPE parameter to addpublic void removeType(AddressType type)
type
- the TYPE parameter to removepublic String getLanguage()
VCardProperty
VCardParameters.getLanguage()
public void setLanguage(String language)
VCardProperty
language
- the language or null to removeVCardParameters.setLanguage(java.lang.String)
public String getLabel()
public void setLabel(String label)
label
- the label or null to removepublic double[] getGeo()
Supported versions: 4.0
VCardParameters.getGeo()
public void setGeo(double latitude, double longitude)
Supported versions: 4.0
latitude
- the latitudelongitude
- the longitudeVCardParameters.setGeo(double, double)
public 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)
public String getTimezone()
Supported versions: 4.0
public void setTimezone(String timezone)
Supported versions: 4.0
timezone
- the timezone (e.g. "America/New_York") or null to removeprotected 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 |