ezvcard.types
Class OrganizationType

java.lang.Object
  extended by ezvcard.types.VCardType
      extended by ezvcard.types.TextListType
          extended by ezvcard.types.OrganizationType
All Implemented Interfaces:
Comparable<VCardType>

public class OrganizationType
extends TextListType

A list of organizations the person belongs to. The list is ordered. It starts with the broadest organization and ends with the most specific.

 VCard vcard = new VCard();
 OrganizationType org = new OrganizationType();
 org.addValue("Google");
 org.addValue("GMail Team");
 org.addValue("Spam Detection Team");
 vcard.setOrganizations(org);
 

vCard property name: ORG

vCard versions: 2.1, 3.0, 4.0

Author:
Michael Angstadt

Field Summary
static String NAME
           
 
Fields inherited from class ezvcard.types.TextListType
values
 
Fields inherited from class ezvcard.types.VCardType
group, subTypes, typeName
 
Constructor Summary
OrganizationType()
           
 
Method Summary
 void addPid(int localId, int clientPidMapRef)
          Adds a PID value.
protected  void doUnmarshalHtml(HCardElement element, List<String> warnings)
          Unmarshals the type from an hCard (HTML document).
 String getAltId()
          Gets the ALTID.
 String getLanguage()
          Gets the language that the address is written in.
 List<Integer[]> getPids()
          Gets all PID parameter values.
 Integer getPref()
          Gets the preference value.
 List<String> getSortAs()
          Gets the string(s) that define how to sort the vCard.
 String getType()
          Gets the TYPE parameter.
 void removePids()
          Removes all PID values.
 void setAltId(String altId)
          Sets the ALTID.
 void setLanguage(String language)
          Sets the language that the address is written in.
 void setPref(Integer pref)
          Sets the preference value.
 void setSortAs(String... names)
          Sets the string(s) that define how to sort the vCard.
 void setType(String type)
          Sets the TYPE parameter.
 
Methods inherited from class ezvcard.types.TextListType
addValue, doMarshalText, doMarshalXml, doUnmarshalText, doUnmarshalXml, getValues, removeValue
 
Methods inherited from class ezvcard.types.VCardType
compareTo, doMarshalSubTypes, getGroup, getQName, getSubTypes, getSupportedVersions, 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

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

OrganizationType

public OrganizationType()
Method Detail

getLanguage

public String getLanguage()
Gets the language that the address is written in.

Returns:
the language or null if not set
See Also:
VCardSubTypes.getLanguage()

setLanguage

public void setLanguage(String language)
Sets the language that the address is written in.

Parameters:
language - the language or null to remove
See Also:
VCardSubTypes.setLanguage(java.lang.String)

getType

public String getType()
Gets the TYPE parameter.

vCard versions: 4.0

Returns:
the TYPE value (typically, this will be either "work" or "home") or null if it doesn't exist

setType

public void setType(String type)
Sets the TYPE parameter.

vCard versions: 4.0

Parameters:
type - the TYPE value (this should be either "work" or "home") or null to remove

getPids

public List<Integer[]> getPids()
Gets all PID parameter values.

vCard versions: 4.0

Returns:
the PID values or empty set if there are none
See Also:
VCardSubTypes.getPids()

addPid

public void addPid(int localId,
                   int clientPidMapRef)
Adds a PID value.

vCard versions: 4.0

Parameters:
localId - the local ID
clientPidMapRef - the ID used to reference the property's globally unique identifier in the CLIENTPIDMAP property.
See Also:
VCardSubTypes.addPid(int, int)

removePids

public void removePids()
Removes all PID values.

vCard versions: 4.0

See Also:
VCardSubTypes.removePids()

getPref

public Integer getPref()
Gets the preference value.

vCard versions: 4.0

Returns:
the preference value or null if it doesn't exist
See Also:
VCardSubTypes.getPref()

setPref

public void setPref(Integer pref)
Sets the preference value.

vCard versions: 4.0

Parameters:
pref - the preference value or null to remove
See Also:
VCardSubTypes.setPref(java.lang.Integer)

getAltId

public String getAltId()
Gets the ALTID.

vCard versions: 4.0

Returns:
the ALTID or null if it doesn't exist
See Also:
VCardSubTypes.getAltId()

setAltId

public void setAltId(String altId)
Sets the ALTID.

vCard versions: 4.0

Parameters:
altId - the ALTID or null to remove
See Also:
VCardSubTypes.setAltId(java.lang.String)

getSortAs

public List<String> getSortAs()
Gets the string(s) that define how to sort the vCard.

2.1 and 3.0 vCards should use the SORT-STRING property instead.

vCard versions: 4.0

Returns:
the sort string(s) or empty list if there are none
See Also:
VCardSubTypes.getSortAs()

setSortAs

public void setSortAs(String... names)
Sets the string(s) that define how to sort the vCard. These strings correspond to the values that are in this property.

2.1 and 3.0 vCards should use the SORT-STRING property instead.

vCard versions: 4.0

Parameters:
names - the names or empty parameter list to remove
See Also:
VCardSubTypes.setSortAs(java.lang.String...)

doUnmarshalHtml

protected void doUnmarshalHtml(HCardElement element,
                               List<String> warnings)
Description copied from class: VCardType
Unmarshals the type from an hCard (HTML document).

Overrides:
doUnmarshalHtml in class VCardType
Parameters:
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 process


Copyright © 2012-2013. All Rights Reserved.