public class DateOrTimeProperty extends VCardProperty implements HasAltId
group, parameters
Constructor and Description |
---|
DateOrTimeProperty(Date date)
Creates a date-and-or-time property.
|
DateOrTimeProperty(Date date,
boolean hasTime)
Creates a date-and-or-time property.
|
DateOrTimeProperty(PartialDate partialDate)
Creates a date-and-or-time property.
|
DateOrTimeProperty(String text)
Creates a date-and-or-time property.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_validate(List<Warning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
String |
getAltId()
Gets the property's ALTID parameter.
|
Calscale |
getCalscale()
Gets the type of calendar that is used for a date or date-time property
value.
|
Date |
getDate()
Gets the date value.
|
PartialDate |
getPartialDate()
Gets the reduced accuracy or truncated date.
|
String |
getText()
Gets the text value of this type.
|
boolean |
hasTime()
Determines whether the "date" or "partialDate" fields have a time
component.
|
void |
setAltId(String altId)
Sets the property's ALTID parameter.
|
void |
setCalscale(Calscale calscale)
Sets the type of calendar that is used for a date or date-time property
value.
|
void |
setDate(Date date,
boolean hasTime)
Sets the value of this property to a complete date.
|
void |
setPartialDate(PartialDate partialDate)
Sets the value of this property to a reduced accuracy or truncated date.
|
void |
setText(String text)
Sets the value of this property to a text string.
|
_supportedVersions, addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate
public DateOrTimeProperty(Date date)
date
- the date valuepublic DateOrTimeProperty(Date date, boolean hasTime)
date
- the date valuehasTime
- true to include the date's time component, false if it's
strictly a datepublic DateOrTimeProperty(PartialDate partialDate)
partialDate
- the partial date value (vCard 4.0 only)public DateOrTimeProperty(String text)
text
- the text value (vCard 4.0 only)public Date getDate()
public void setDate(Date date, boolean hasTime)
date
- the datehasTime
- true to include the date's time component, false if it's
strictly a datepublic PartialDate getPartialDate()
public void setPartialDate(PartialDate partialDate)
Sets the value of this property to a reduced accuracy or truncated date. This is only supported by vCard 4.0.
Birthday bday = new Birthday(); bday.setPartialDate(PartialDate.date(null, 4, 20)); //April 20
partialDate
- the reduced accuracy or truncated datepublic String getText()
public void setText(String text)
text
- the text valuepublic boolean hasTime()
public Calscale getCalscale()
Gets the type of calendar that is used for a date or date-time property value.
Supported versions: 4.0
VCardParameters.getCalscale()
public void setCalscale(Calscale calscale)
Sets the type of calendar that is used for a date or date-time property value.
Supported versions: 4.0
calscale
- the type of calendar or null to removeVCardParameters.setCalscale(org.opencrx.application.uses.ezvcard.parameter.Calscale)
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)
protected 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 toThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.