FileDocCategorySizeDatePackage
GOMDateConstructImpl.javaAPI DocApache Lucene 2.1.03181Wed Feb 14 10:45:58 GMT 2007org.apache.lucene.gdata.gom.core

GOMDateConstructImpl

public abstract class GOMDateConstructImpl extends AbstractGOMElement implements org.apache.lucene.gdata.gom.GOMDateConstruct
A Date construct is an element whose content MUST conform to the "date-time" production in [RFC3339]. In addition, an uppercase "T" character MUST be used to separate date and time, and an uppercase "Z" character MUST be present in the absence of a numeric time zone offset.
author
Simon Willnauer

Fields Summary
protected long
date
protected String
rfc3339String
Constructors Summary
Methods Summary
public java.util.DategetDate()

see
org.apache.lucene.gdata.gom.GOMDateConstruct#getDate()

		return new Date(this.date);

	
public voidprocessElementValue(java.lang.String aValue)

see
org.apache.lucene.gdata.gom.core.AbstractGOMElement#processElementValue(java.lang.String)

		if (aValue == null)
			throw new IllegalArgumentException("element value must not be null");
		this.date = GOMUtils.parseRfc3339DateFormat(aValue);
		this.rfc3339String = aValue;

	
public voidprocessEndElement()

see
org.apache.lucene.gdata.gom.core.AbstractGOMElement#processEndElement()

		if (this.rfc3339String == null)
			throw new GDataParseException(String.format(
					MISSING_ELEMENT_VALUE, this.localName,
					"RFC3339 Date Time"));

	
public voidsetDate(java.util.Date aDate)

see
org.apache.lucene.gdata.gom.GOMDateConstruct#setDate(java.util.Date)

		if (aDate == null)
			return;
		this.date = aDate.getTime();
		this.rfc3339String = GOMUtils.buildRfc3339DateFormat(this.date);
	
public voidwriteAtomOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter aStreamWriter)

see
org.apache.lucene.gdata.gom.GOMElement#writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)

		if (this.rfc3339String == null)
			this.rfc3339String = GOMUtils
					.buildRfc3339DateFormat(this.date == 0 ? System
							.currentTimeMillis() : this.date);
		aStreamWriter.writeSimpleXMLElement(this.qname,
				getXmlNamespaceAttributes(), this.rfc3339String);