|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.types.VCardType
ezvcard.types.TimezoneType
public class TimezoneType
Contains the timezone that the person lives/works in.
VCard vcard = new VCard(); TimezoneType tz = new TimezoneType(-5, 0, "America/New_York"); vcard.addTimezone(tz);
vCard property name: TZ
vCard versions: 2.1, 3.0, 4.0
Field Summary | |
---|---|
static String |
NAME
|
Fields inherited from class ezvcard.types.VCardType |
---|
group, subTypes, typeName |
Constructor Summary | |
---|---|
TimezoneType()
|
|
TimezoneType(Integer hourOffset,
Integer minuteOffset)
This is the recommended constructor for version 2.1 and 3.0 vCards. |
|
TimezoneType(Integer hourOffset,
Integer minuteOffset,
String text)
This constructor can be used for all vCard versions. |
|
TimezoneType(String text)
This is the recommended constructor for version 4.0 vCards. |
Method Summary | |
---|---|
void |
addPid(int localId,
int clientPidMapRef)
Adds a PID value. |
protected void |
doMarshalSubTypes(VCardSubTypes copy,
VCardVersion version,
List<String> warnings,
CompatibilityMode compatibilityMode,
VCard vcard)
Gets the sub types that will be sent over the wire. |
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. |
Integer |
getHourOffset()
Gets the hour offset. |
String |
getMediaType()
Gets the MEDIATYPE parameter. |
Integer |
getMinuteOffset()
Gets the minute offset. |
List<Integer[]> |
getPids()
Gets all PID parameter values. |
Integer |
getPref()
Gets the preference value. |
String |
getText()
Gets the text portion of the timezone. |
String |
getType()
Gets the TYPE parameter. |
void |
removePids()
Removes all PID values. |
void |
setAltId(String altId)
Sets the ALTID. |
void |
setHourOffset(Integer hourOffset)
Sets the hour offset. |
void |
setMediaType(String mediaType)
Sets the MEDIATYPE parameter. |
void |
setMinuteOffset(Integer minuteOffset)
Sets the minute offset. |
void |
setPref(Integer pref)
Sets the preference value. |
void |
setText(String text)
Sets the text portion of the timezone. |
void |
setType(String type)
Sets the TYPE parameter. |
TimeZone |
toTimeZone()
Creates a TimeZone representation of this class. |
Methods inherited from class ezvcard.types.VCardType |
---|
compareTo, 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 |
---|
public static final String NAME
Constructor Detail |
---|
public TimezoneType()
public TimezoneType(String text)
text
- string representing the timezone from the Olson
Database (e.g. "America/New_York")public TimezoneType(Integer hourOffset, Integer minuteOffset)
hourOffset
- the hour offsetminuteOffset
- the minute offsetpublic TimezoneType(Integer hourOffset, Integer minuteOffset, String text)
hourOffset
- the hour offsetminuteOffset
- the minute offsettext
- can be anything, but should be a string representing the
timezone from the Olson
Database (e.g. "America/New_York")Method Detail |
---|
public Integer getHourOffset()
public void setHourOffset(Integer hourOffset)
hourOffset
- the hour offset or null to removepublic Integer getMinuteOffset()
public void setMinuteOffset(Integer minuteOffset)
minuteOffset
- the minute offset or null to remove
IllegalArgumentException
- if the minute offset is not between 0
and 59public String getText()
public void setText(String text)
text
- the text portion (e.g. "America/New_York")public TimeZone toTimeZone()
TimeZone
representation of this class.
TimeZone
object or null if this object contains no
offset datapublic String getType()
vCard versions: 4.0
public void setType(String type)
vCard versions: 4.0
type
- the TYPE value (this should be either "work" or "home") or
null to removepublic 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 void doMarshalSubTypes(VCardSubTypes copy, VCardVersion version, List<String> warnings, CompatibilityMode compatibilityMode, VCard vcard)
VCardType
If this method is NOT overridden, then the type's sub types will be sent
over the wire as-is. In other words, whatever is in the
VCardType.subTypes
field will be sent. Child classes can override
this method in order to modify the sub types before they are marshalled.
doMarshalSubTypes
in class VCardType
copy
- the sub types that will be marshalled into the vCard.
This object is a copy of the VCardType.subTypes
field, so any
modifications done to this object will not effect the state of the field.version
- 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 vCardvcard
- the VCard
object that is being marshalledprotected 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 process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |