lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r486627 [2/9] - in /lucene/java/trunk/contrib/gdata-server/src/gom: java/org/ java/org/apache/ java/org/apache/lucene/ java/org/apache/lucene/gdata/ java/org/apache/lucene/gdata/gom/ java/org/apache/lucene/gdata/gom/core/ java/org/apache/lu...
Date Wed, 13 Dec 2006 12:40:04 GMT
Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMTitle.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMTitle.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMTitle.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMTitle.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom;
+
+/**
+ * 
+ * The "atom:title" element is a Text construct that conveys a human-readable
+ * title for an entry or feed.
+ * 
+ * <pre>
+ *  atomTitle = element atom:title { atomTextConstruct }
+ * </pre>
+ * 
+ * @author Simon Willnauer
+ * 
+ */
+public interface GOMTitle extends GOMElement {
+
+	/**
+	 * Atom local name for the xml element
+	 */
+	public static final String LOCALNAME = "title";
+
+	/**
+	 * @return - the content type attribute value as a {@link ContentType}
+	 * @see ContentType
+	 */
+	public abstract ContentType getContentType();
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMUpdated.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMUpdated.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMUpdated.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMUpdated.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom;
+
+/**
+ * 
+ * The "atom:updated" element is a Date construct indicating the most recent
+ * instant in time when an entry or feed was modified in a way the publisher
+ * considers significant. Therefore, not all modifications necessarily result in
+ * a changed atom:updated value.
+ * 
+ * <pre>
+ *  atomUpdated = element atom:updated { atomDateConstruct}
+ * </pre>
+ * 
+ * @author Simon Willnauer
+ * @see org.apache.lucene.gdata.gom.GOMDateConstruct
+ */
+public interface GOMUpdated extends GOMDateConstruct {
+	/**
+	 * Atom local name for the xml element
+	 */
+	public static final String LOCALNAME = "updated";
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMXmlEntity.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMXmlEntity.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMXmlEntity.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/GOMXmlEntity.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.lucene.gdata.gom;
+
+import javax.xml.namespace.QName;
+
+/**
+ * GOMXmlEntity is a abstract base interface for all Gdata Object Model
+ * Interfaces to be implemented by any class which is a part of the GOM. This
+ * interface defines a basic interface for xml attributes and elements
+ * 
+ * @author Simon Willnauer
+ * 
+ */
+public abstract interface GOMXmlEntity {
+
+	/**
+	 * @return - the entities QName
+	 * @see QName
+	 * 
+	 */
+	public abstract QName getQname();
+
+	/**
+	 * @param aString - the namespace uri to set
+	 */
+	public abstract void setNamespaceUri(String aString);
+
+	/**
+	 * @param aString - the namespace prefix to set
+	 */
+	public abstract void setNamespacePrefix(String aString);
+
+	/**
+	 * @param aLocalName - the localname of the entitiy
+	 */
+	public abstract void setLocalName(String aLocalName);
+
+	/**
+	 * @return - the local name of the entitiy
+	 */
+	public abstract String getLocalName();
+
+	/**
+	 * @return - the text value of the entity
+	 */
+	public abstract String getTextValue();
+
+	/**
+	 * @param aTextValue - the text value of the entity
+	 */
+	public abstract void setTextValue(String aTextValue);
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AbstractGOMElement.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AbstractGOMElement.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AbstractGOMElement.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AbstractGOMElement.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,232 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.GOMAttribute;
+import org.apache.lucene.gdata.gom.GOMElement;
+import org.apache.lucene.gdata.gom.GOMNamespace;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+
+/**
+ * @author Simon Willnauer
+ */
+public abstract class AbstractGOMElement implements GOMElement {
+	/**
+	 * atomCommonAttribute <br/> attribute xml:lang { atomLanguageTag }?
+	 */
+	protected String xmlLang;
+
+	/**
+	 * atomCommonAttribute <br/> attribute xml:base { atomUri }?
+	 */
+	protected String xmlBase;
+
+	protected QName qname;
+
+	protected String textValue;
+
+	protected String localName;
+
+	protected String nsUri;
+
+	protected String nsPrefix;
+
+	/**
+	 * atomCommonAttributes <br/> undefinedAttribute*
+	 */
+	protected List<GOMAttribute> extensionAttributes = new LinkedList<GOMAttribute>();
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#getQname()
+	 */
+	public QName getQname() {
+		return this.qname;
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#getTextValue()
+	 */
+	public String getTextValue() {
+		return this.textValue;
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#setTextValue(java.lang.String)
+	 */
+	public void setTextValue(String aTextValue) {
+		this.textValue = aTextValue;
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#getLocalName()
+	 */
+	public String getLocalName() {
+		return this.localName;
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#setLocalName(java.lang.String)
+	 */
+	public void setLocalName(String aLocalName) {
+		// must override
+	}
+
+	protected void addAttribute(GOMAttribute aAttribute) {
+		if (aAttribute != null)
+			this.extensionAttributes.add(aAttribute);
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.core.AtomParser#getChildParser(javax.xml.namespace.QName)
+	 */
+	public AtomParser getChildParser(QName aName) {
+		throw new GDataParseException(String.format(UNEXPECTED_ELEMENT_CHILD,
+				this.qname));
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.core.AtomParser#processAttribute(javax.xml.namespace.QName,
+	 *      java.lang.String)
+	 */
+	public void processAttribute(QName aQName, String aValue) {
+		if (aQName == null)
+			throw new GDataParseException("QName must not be null");
+		if (aQName.getNamespaceURI().equals(GOMNamespace.XML_NS_URI)) {
+			if (aQName.getLocalPart().equals(XML_BASE))
+				this.xmlBase = aValue;
+			else if (aQName.getLocalPart().equals(XML_LANG))
+				this.xmlLang = aValue;
+
+		} else {
+			GOMAttributeImpl impl = new GOMAttributeImpl(aQName
+					.getNamespaceURI(), aQName.getPrefix(), aQName
+					.getLocalPart(), aValue);
+			this.addAttribute(impl);
+		}
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.core.AtomParser#processElementValue(java.lang.String)
+	 */
+	public void processElementValue(String aValue) {
+		throw new GDataParseException(String.format(UNEXPECTED_ELEMENT_VALUE,
+				this.qname));
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.core.AtomParser#processEndElement()
+	 */
+	public void processEndElement() {
+		// no post processing
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#setNamespaceUri(java.lang.String)
+	 */
+	public void setNamespaceUri(String aString) {
+		this.nsUri = aString;
+
+	}
+
+	/**
+	 * 
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#setNamespacePrefix(java.lang.String)
+	 */
+	public void setNamespacePrefix(String aString) {
+		this.nsPrefix = aString;
+	}
+
+	protected List<GOMAttribute> getXmlNamespaceAttributes() {
+		List<GOMAttribute> retVal = new LinkedList<GOMAttribute>();
+		if (this.xmlBase != null)
+			retVal.add(new GOMAttributeImpl(GOMNamespace.XML_NS_URI,
+					GOMNamespace.XML_NS_PREFIX, "base", this.xmlBase));
+		if (this.xmlLang != null)
+			retVal.add(new GOMAttributeImpl(GOMNamespace.XML_NS_URI,
+					GOMNamespace.XML_NS_PREFIX, "lang", this.xmlLang));
+		return retVal;
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter,
+	 *      java.lang.String)
+	 */
+	public void writeRssOutput(GOMOutputWriter aStreamWriter, String aRssName)
+			throws XMLStreamException {
+
+	}
+
+
+
+
+	/**
+	 * 
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMElement#getXmlBase()
+	 */
+	public String getXmlBase() {
+		return this.xmlBase;
+	}
+
+	/**
+	 * 
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMElement#getXmlLang()
+	 */
+	public String getXmlLang() {
+
+		return this.xmlLang;
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/ArbitraryGOMXml.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/ArbitraryGOMXml.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/ArbitraryGOMXml.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/ArbitraryGOMXml.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,162 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.GOMAttribute;
+import org.apache.lucene.gdata.gom.GOMElement;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+//TODO add java doc
+/**
+ * 
+ * @author Simon Willnauer
+ * 
+ */
+public class ArbitraryGOMXml extends AbstractGOMElement {
+	private List<GOMElement> children = new LinkedList<GOMElement>();
+
+	private List<GOMAttribute> attributes = new LinkedList<GOMAttribute>();
+
+	/**
+	 * this method will never return <code>null</code>
+	 * 
+	 * @return Returns the attributes of this xml element.
+	 */
+	public List<GOMAttribute> getAttributes() {
+		return this.attributes;
+	}
+
+	/**
+	 * this method will never return <code>null</code>
+	 * 
+	 * @return - the child elements of this xml element
+	 */
+	public List<GOMElement> getChildren() {
+		return this.children;
+	}
+
+	/**
+	 * Class constructor
+	 * 
+	 * @param qname -
+	 *            the elements qname
+	 */
+	public ArbitraryGOMXml(QName qname) {
+		if (qname == null)
+			throw new IllegalArgumentException("QName must not be null");
+
+		this.qname = qname;
+		this.localName = qname.getLocalPart();
+	}
+
+	/**
+	 * {@inheritDoc} 
+	 * 
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#getChildParser(javax.xml.namespace.QName)
+	 */
+	@Override
+	public AtomParser getChildParser(QName aName) {
+		if (aName == null)
+			throw new GDataParseException("QName must not be null");
+		/*
+		 * either a text value or a child
+		 */
+		if (this.textValue != null)
+			throw new GDataParseException(String.format(
+					AtomParser.UNEXPECTED_ELEMENT_CHILD, this.localName));
+		GOMElement element = new ArbitraryGOMXml(aName);
+		this.children.add(element);
+		return element;
+	}
+
+	/**
+	 * {@inheritDoc} 
+	 * 
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#processAttribute(javax.xml.namespace.QName,
+	 *      java.lang.String)
+	 */
+	@Override
+	public void processAttribute(QName aQName, String aValue) {
+		if (aQName == null)
+			throw new GDataParseException("QName must not be null");
+		GOMAttributeImpl impl = new GOMAttributeImpl(aQName.getNamespaceURI(),
+				aQName.getPrefix(), aQName.getLocalPart(), aValue);
+		this.attributes.add(impl);
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#processElementValue(java.lang.String)
+	 */
+	@Override
+	public void processElementValue(String aValue) {
+		if (aValue == null)
+			throw new GDataParseException("Element value must not be null");
+		/*
+		 * either a text value or a child
+		 */
+		if (this.children.size() > 0)
+			throw new GDataParseException(String.format(
+					AtomParser.UNEXPECTED_ELEMENT_VALUE, this.localName));
+		if (this.textValue != null)
+			throw new GDataParseException(String.format(
+					AtomParser.UNEXPECTED_ELEMENT_VALUE, this.localName));
+		this.textValue = aValue;
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeAtomOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		if (aStreamWriter == null)
+			throw new NullPointerException("StreamWriter is null");
+		aStreamWriter.writeStartElement(this.qname, this.attributes);
+		if (this.textValue == null) {
+			for (GOMElement element : this.children) {
+				element.writeAtomOutput(aStreamWriter);
+			}
+		} else {
+			aStreamWriter.writeContent(this.textValue);
+		}
+		aStreamWriter.writeEndElement();
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeRssOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		// delegate it by default
+		this.writeAtomOutput(aStreamWriter);
+
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AtomParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AtomParser.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AtomParser.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AtomParser.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,134 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public interface AtomParser {
+
+	/**
+	 * Error message for an unexpected element
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String UNEXPECTED_ELEMENT = "Expected Element '%s' but was '%s' ";
+
+
+	/**
+	 * Error message for an unexpected element child
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String UNEXPECTED_ELEMENT_CHILD = "Element '%s' can not contain child elements ";
+
+	/**
+	 * Error message for an urecognized element child
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String URECOGNIZED_ELEMENT_CHILD = "Element '%s' can not contain child elements of the type %s";
+
+	/**
+	 * Error message for an unexpected attribute
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String UNEXPECTED_ATTRIBUTE = "Element '%s' can not contain attributes ";
+
+	/**
+	 * Error message for an unexpected element value
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String UNEXPECTED_ELEMENT_VALUE = "Element '%s' can not contain any element value";
+
+	/**
+	 * Error message for a missing element attribute
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String MISSING_ELEMENT_ATTRIBUTE = "Element '%s' requires an '%s' attribute";
+
+	/**
+	 * Error message for a missing element child
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String MISSING_ELEMENT_CHILD = "Element '%s' requires a child of the type '%s'";
+
+	/**
+	 * Error message for a missing element value
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String MISSING_ELEMENT_VALUE = "Element '%s' requires a element value of the type '%s'";
+
+	/**
+	 * Error message for a missing element value 
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String MISSING_ELEMENT_VALUE_PLAIN = "Element '%s' requires a element value'";
+
+	/**
+	 * Error message for a duplicated element
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String DUPLICATE_ELEMENT = "Duplicated Element '%s'";
+
+	/**
+	 * Error message for a duplicated element value
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String DUPLICATE_ELEMENT_VALUE = "Duplicated Element value for element '%s'";
+
+	/**
+	 * Error message for a duplicated attribute
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String DUPLICATE_ATTRIBUTE = "Duplicated Attribute '%s'";
+
+	/**
+	 * Error message for an invalid attribute
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String INVALID_ATTRIBUTE = "The attribute '%s' must be an %s";
+
+	/**
+	 * Error message for an invalid element value
+	 * @see String#format(java.lang.String, java.lang.Object[])
+	 */
+	public static final String INVALID_ELEMENT_VALUE = "The element value '%s' must be an %s";
+
+	/**
+	 * @param aValue
+	 */
+	public abstract void processElementValue(String aValue);
+
+	/**
+	 * @param aQName
+	 * @param aValue
+	 */
+	public abstract void processAttribute(QName aQName, String aValue);
+
+	/**
+	 * 
+	 */
+	public abstract void processEndElement();
+
+	/**
+	 * @param name
+	 * @return
+	 */
+	public abstract AtomParser getChildParser(QName name);
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AtomUriElement.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AtomUriElement.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AtomUriElement.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/AtomUriElement.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import java.net.URISyntaxException;
+
+import org.apache.lucene.gdata.gom.core.utils.AtomParserUtils;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+abstract class AtomUriElement extends SimpleGOMElementImpl {
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.SimpleGOMElementImpl#processEndElement()
+	 */
+	@Override
+	public void processEndElement() {
+		if (this.textValue == null)
+			throw new GDataParseException(String.format(
+					MISSING_ELEMENT_VALUE, this.localName, "atomUri"));
+		try {
+			AtomParserUtils.getAbsolutAtomURI(this.xmlBase, this.textValue);
+		} catch (URISyntaxException e) {
+			throw new GDataParseException(String.format(INVALID_ELEMENT_VALUE,
+					this.localName, "absolute uri"), e);
+		}
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GDataParseException.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GDataParseException.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GDataParseException.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GDataParseException.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public class GDataParseException extends RuntimeException {
+
+	/**
+	 * Serial Version ID -- implements {@link java.io.Serializable}
+	 */
+	private static final long serialVersionUID = -3633604155009277238L;
+
+	/**
+	 * 
+	 */
+	public GDataParseException() {
+	}
+
+	/**
+	 * @param arg0
+	 */
+	public GDataParseException(String arg0) {
+		super(arg0);
+	}
+
+	/**
+	 * @param arg0
+	 */
+	public GDataParseException(Throwable arg0) {
+		super(arg0);
+	}
+
+	/**
+	 * @param arg0
+	 * @param arg1
+	 */
+	public GDataParseException(String arg0, Throwable arg1) {
+		super(arg0, arg1);
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMAttributeImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMAttributeImpl.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMAttributeImpl.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMAttributeImpl.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,151 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import javax.xml.namespace.QName;
+
+import org.apache.lucene.gdata.gom.GOMAttribute;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public class GOMAttributeImpl implements GOMAttribute {
+	private boolean hasDefaultNamespace;
+
+	private QName qName;
+
+	private String localName;
+
+	private String uri;
+
+	private String prefix;
+
+	private String value;
+
+	/**
+	 * 
+	 */
+	public GOMAttributeImpl() {
+		super();
+	}
+
+	/**
+	 * @param localName
+	 * @param value
+	 */
+	public GOMAttributeImpl(String localName, String value) {
+		this.hasDefaultNamespace = true;
+		this.value = value;
+		this.localName = localName;
+	}
+
+	/**
+	 * @param namespaceUri
+	 * @param namespacePrefix
+	 * @param localName
+	 * @param value
+	 */
+	public GOMAttributeImpl(String namespaceUri, String namespacePrefix,
+			String localName, String value) {
+		this.localName = localName;
+		this.uri = namespaceUri;
+		this.prefix = namespacePrefix;
+		this.value = value;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#getQname()
+	 */
+	public QName getQname() {
+		if (this.qName == null)
+			this.qName = new QName(this.uri, (this.localName == null ? ""
+					: this.localName), (this.prefix == null ? "" : this.prefix));
+		return this.qName;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#setLocalName(java.lang.String)
+	 */
+	public void setLocalName(String aLocalName) {
+		if (aLocalName == null)
+			return;
+		this.qName = null;
+		this.localName = aLocalName;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#getLocalName()
+	 */
+	public String getLocalName() {
+		return this.localName;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#getTextValue()
+	 */
+	public String getTextValue() {
+		return this.value == null ? "" : this.value;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#setTextValue(java.lang.String)
+	 */
+	public void setTextValue(String aTextValue) {
+		this.value = aTextValue;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMAttribute#hasDefaultNamespace()
+	 */
+	public boolean hasDefaultNamespace() {
+
+		return this.hasDefaultNamespace;
+	}
+
+	void setHasDefaultNamespace(boolean aBoolean) {
+		this.hasDefaultNamespace = aBoolean;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#setNamespaceUri(java.lang.String)
+	 */
+	public void setNamespaceUri(String aString) {
+		if (aString == null)
+			return;
+		this.qName = null;
+		this.hasDefaultNamespace = false;
+		this.uri = aString;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMXmlEntity#setNamespacePrefix(java.lang.String)
+	 */
+	public void setNamespacePrefix(String aString) {
+		if (aString == null)
+			return;
+		this.qName = null;
+		this.hasDefaultNamespace = false;
+		this.prefix = aString;
+
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMAuthorImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMAuthorImpl.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMAuthorImpl.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMAuthorImpl.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.GOMAuthor;
+import org.apache.lucene.gdata.gom.GOMNamespace;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public class GOMAuthorImpl extends GOMPersonImpl implements GOMAuthor {
+	/**
+	 * 
+	 */
+	public GOMAuthorImpl() {
+		this.localName = GOMAuthor.LOCALNAME;
+		this.qname = new QName(GOMNamespace.ATOM_NS_URI, this.localName);
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.GOMPersonImpl#writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	@Override
+	public void writeRssOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		writeRssOutput(aStreamWriter, this.localName);
+
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMBuilder.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMBuilder.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMBuilder.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,154 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import java.util.Stack;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.lucene.gdata.gom.GOMDocument;
+import org.apache.lucene.gdata.gom.GOMEntry;
+import org.apache.lucene.gdata.gom.GOMFeed;
+import org.apache.lucene.gdata.gom.GOMNamespace;
+
+/**
+ * @author Simon Willnauer
+ */
+public class GOMBuilder {
+
+	private final XMLStreamReader streamReader;
+
+	private final GOMFactory factory;
+
+	private final Stack<AtomParser> parserStack;
+
+	/**
+	 * @param arg0
+	 */
+	public GOMBuilder(XMLStreamReader arg0) {
+		if (arg0 == null)
+			throw new IllegalArgumentException(
+					"XMLStreamReader instance must not be null");
+		this.streamReader = arg0;
+		this.factory = GOMFactory.createInstance();
+		this.parserStack = new Stack<AtomParser>();
+	}
+
+	public GOMDocument<GOMFeed> buildGOMFeed() throws XMLStreamException {
+		GOMDocument<GOMFeed> document = new GOMDocumentImpl<GOMFeed>();
+		GOMFeed element = startFeedDocument(document);
+		document.setRootElement(element);
+		parse(this.streamReader);
+
+		return document;
+	}
+
+	private void parse(XMLStreamReader aReader) throws XMLStreamException {
+
+		int next = 0;
+
+		while ((next = next()) != XMLStreamConstants.END_DOCUMENT) {
+
+			if (next == XMLStreamConstants.START_ELEMENT) {
+				AtomParser childParser = this.parserStack.peek()
+						.getChildParser(this.streamReader.getName());
+				processAttributes(childParser);
+				this.parserStack.push(childParser);
+			} else if (next == XMLStreamConstants.END_ELEMENT) {
+				this.parserStack.pop().processEndElement();
+			} else if (next == XMLStreamConstants.CHARACTERS) {
+				this.parserStack.peek().processElementValue(
+						this.streamReader.getText());
+			} else if (next == XMLStreamConstants.CDATA) {
+				System.out.println("CDdata");
+			}
+			// System.out.println(next);
+		}
+
+	}
+
+	/**
+	 * @param childParser
+	 */
+	private void processAttributes(AtomParser childParser) {
+		int attributeCount = this.streamReader.getAttributeCount();
+		for (int i = 0; i < attributeCount; i++) {
+			childParser.processAttribute(this.streamReader.getAttributeName(i),
+					this.streamReader.getAttributeValue(i));
+		}
+	}
+
+	public GOMDocument<GOMEntry> buildGOMEntry() throws XMLStreamException {
+		GOMDocument<GOMEntry> document = new GOMDocumentImpl<GOMEntry>();
+		GOMEntry element = startEntryDocument(document);
+		document.setRootElement(element);
+		parse(this.streamReader);
+
+		return document;
+
+	}
+
+	private GOMEntry startEntryDocument(GOMDocument aDocument)
+			throws XMLStreamException {
+		aDocument.setVersion(this.streamReader.getVersion());
+		aDocument.setCharacterEncoding(this.streamReader
+				.getCharacterEncodingScheme());
+		GOMEntry entry = this.factory.createEntry();
+		if (next() != XMLStreamConstants.START_ELEMENT)
+			throw new GDataParseException("Expected start of feed element");
+		processAttributes(entry);
+		this.parserStack.push(entry);
+		int count = this.streamReader.getNamespaceCount();
+		for (int i = 0; i < count; i++) {
+			GOMNamespace namespace = new GOMNamespace(this.streamReader
+					.getNamespaceURI(i), this.streamReader
+					.getNamespacePrefix(i));
+			entry.addNamespace(namespace);
+		}
+		return entry;
+	}
+
+	private GOMFeed startFeedDocument(GOMDocument aDocument)
+			throws XMLStreamException {
+		aDocument.setVersion(this.streamReader.getVersion());
+		aDocument.setCharacterEncoding(this.streamReader
+				.getCharacterEncodingScheme());
+		GOMFeed feed = this.factory.createFeed();
+		if (next() != XMLStreamConstants.START_ELEMENT)
+			throw new GDataParseException("Expected start of feed element");
+		processAttributes(feed);
+		this.parserStack.push(feed);
+		int count = this.streamReader.getNamespaceCount();
+		for (int i = 0; i < count; i++) {
+
+			GOMNamespace namespace = new GOMNamespace(this.streamReader
+					.getNamespaceURI(i), this.streamReader
+					.getNamespacePrefix(i));
+			System.out.println(namespace);
+			feed.addNamespace(namespace);
+		}
+		return feed;
+	}
+
+	private int next() throws XMLStreamException {
+		return this.streamReader.next();
+
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMCategoryImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMCategoryImpl.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMCategoryImpl.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMCategoryImpl.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,206 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import java.net.URISyntaxException;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.GOMAttribute;
+import org.apache.lucene.gdata.gom.GOMCategory;
+import org.apache.lucene.gdata.gom.GOMNamespace;
+import org.apache.lucene.gdata.gom.core.utils.AtomParserUtils;
+import org.apache.lucene.gdata.gom.core.utils.GOMUtils;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public class GOMCategoryImpl extends AbstractGOMElement implements GOMCategory {
+
+	private static final String DOMAIN = "domain";
+
+	protected String term;
+
+	protected String label;
+
+	protected String scheme;
+
+	/**
+	 * 
+	 */
+	public GOMCategoryImpl() {
+		super();
+		this.localName = LOCALNAME;
+		this.qname = new QName(GOMNamespace.ATOM_NS_URI, this.localName);
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMCategory#setTerm(java.lang.String)
+	 */
+	public void setTerm(String aTerm) {
+
+		this.term = aTerm;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMCategory#setLabel(java.lang.String)
+	 */
+	public void setLabel(String aLabel) {
+		this.label = aLabel;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMCategory#setScheme(java.lang.String)
+	 */
+	public void setScheme(String aScheme) {
+		this.scheme = aScheme;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMCategory#getTerm()
+	 */
+	public String getTerm() {
+		return this.term;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMCategory#getScheme()
+	 */
+	public String getScheme() {
+		return this.scheme;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMCategory#getLabel()
+	 */
+	public String getLabel() {
+		return this.label;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#processAttribute(javax.xml.namespace.QName,
+	 *      java.lang.String)
+	 */
+	@Override
+	public void processAttribute(QName aQName, String aValue) {
+		if (aQName == null)
+			throw new GDataParseException("QName must not be null");
+		if (aQName.getNamespaceURI().equals(GOMNamespace.ATOM_NS_URI)
+				|| aQName.getNamespaceURI().equals("")) {
+			String localPart = aQName.getLocalPart();
+			if (localPart.equals(TERM_ATTRIBUTE)) {
+				if (this.term != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ATTRIBUTE, TERM_ATTRIBUTE));
+				this.term = aValue;
+			} else if (localPart.equals(LABLE_ATTRIBUTE)) {
+				if (this.label != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ATTRIBUTE, LABLE_ATTRIBUTE));
+				this.label = aValue;
+			} else if (localPart.equals(SCHEME_ATTRIBUTE)) {
+				if (this.scheme != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ATTRIBUTE, SCHEME_ATTRIBUTE));
+				this.scheme = aValue;
+			} else {
+				super.processAttribute(aQName, aValue);
+			}
+
+		} else {
+			super.processAttribute(aQName, aValue);
+		}
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#processEndElement()
+	 */
+	@Override
+	public void processEndElement() {
+		/*
+		 * ATOM defines "undefinedContent" for this. GData defines this as no
+		 * content containing element
+		 */
+		if (this.term == null)
+			throw new GDataParseException(String.format(
+					AtomParser.MISSING_ELEMENT_ATTRIBUTE, this.localName,
+					TERM_ATTRIBUTE));
+		if (this.scheme != null) {
+			try {
+				AtomParserUtils.getAbsolutAtomURI(this.xmlBase, this.scheme);
+			} catch (URISyntaxException e) {
+				throw new GDataParseException(String.format(
+						AtomParser.INVALID_ATTRIBUTE, this.localName
+								+ " attribute " + GOMCategory.SCHEME_ATTRIBUTE,
+						"absolute uri"), e);
+			}
+		}
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeAtomOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		if (aStreamWriter == null)
+			throw new NullPointerException("StreamWriter is null");
+		List<GOMAttribute> list = new LinkedList<GOMAttribute>();
+		/*
+		 * term attribute is requiered for a category. attribute term { text },
+		 */
+		list.add(GOMUtils.buildDefaultNamespaceAttribute(this.term,
+				TERM_ATTRIBUTE));
+		if (this.scheme != null)
+			list.add(GOMUtils.buildDefaultNamespaceAttribute(this.scheme,
+					SCHEME_ATTRIBUTE));
+		if (this.label != null)
+			list.add(GOMUtils.buildDefaultNamespaceAttribute(this.label,
+					LABLE_ATTRIBUTE));
+
+		if (this.xmlLang != null)
+			list.add(GOMUtils
+					.buildXMLNamespaceAttribute(this.xmlLang, XML_LANG));
+		aStreamWriter.writeSimpleXMLElement(this.localName, list, null);
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeRssOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		if (aStreamWriter == null)
+			throw new NullPointerException("StreamWriter is null");
+		List<GOMAttribute> list = getXmlNamespaceAttributes();
+		/*
+		 * build this domain attr. even if scheme is null or empty
+		 */
+		list.add(GOMUtils.buildDefaultNamespaceAttribute(this.scheme, DOMAIN));
+
+		aStreamWriter.writeSimpleXMLElement(this.localName, list, this.term);
+
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMContentImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMContentImpl.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMContentImpl.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMContentImpl.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,216 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import java.net.URISyntaxException;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.AtomMediaType;
+import org.apache.lucene.gdata.gom.GOMAttribute;
+import org.apache.lucene.gdata.gom.GOMContent;
+import org.apache.lucene.gdata.gom.GOMNamespace;
+import org.apache.lucene.gdata.gom.core.utils.AtomParserUtils;
+import org.apache.lucene.gdata.gom.core.utils.GOMUtils;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public class GOMContentImpl extends GOMTextContructImpl implements GOMContent {
+	private String src;
+
+	private String type;
+
+	private AtomMediaType mediaType;
+
+	/**
+	 * 
+	 */
+	public GOMContentImpl() {
+		this.localName = GOMContent.LOCALNAME;
+		this.qname = new QName(GOMNamespace.ATOM_NS_URI, this.localName);
+		this.rssLocalName = GOMContent.LOCAL_NAME_RSS;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMContent#getSrc()
+	 */
+	public String getSrc() {
+		return this.src;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMContent#setSrc(java.lang.String)
+	 */
+	public void setSrc(String aSrc) {
+		this.src = aSrc;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.GOMTextContructImpl#processAttribute(javax.xml.namespace.QName,
+	 *      java.lang.String)
+	 */
+	@Override
+	public void processAttribute(QName aQName, String aValue) {
+		if (aQName == null)
+			throw new GDataParseException("QName must not be null");
+		if (aValue == null)
+			throw new GDataParseException("Value must not be null");
+		if ("src".equals(aQName.getLocalPart())) {
+			if (this.src != null)
+				throw new GDataParseException(String.format(
+						DUPLICATE_ATTRIBUTE, "src"));
+			this.src = aValue;
+			return;
+		}
+		if ("type".equals(aQName.getLocalPart())) {
+			if (this.contentType != null || this.mediaType != null)
+				throw new GDataParseException(String.format(
+						DUPLICATE_ATTRIBUTE, "type"));
+			if (AtomParserUtils.isAtomMediaType(aValue)) {
+				this.type = aValue;
+				this.mediaType = AtomParserUtils.getAtomMediaType(aValue);
+				return;
+			}
+
+		}
+		super.processAttribute(aQName, aValue);
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.GOMTextContructImpl#processElementValue(java.lang.String)
+	 */
+	@Override
+	public void processElementValue(String aValue) {
+		if (this.src != null)
+			throw new GDataParseException(String.format(
+					AtomParser.UNEXPECTED_ELEMENT_VALUE, this.localName
+							+ " with attribute src set "));
+		super.processElementValue(aValue);
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.GOMTextContructImpl#processEndElement()
+	 */
+	@Override
+	public void processEndElement() {
+		if (this.src != null)
+			try {
+				AtomParserUtils.getAbsolutAtomURI(this.xmlBase, this.src);
+			} catch (URISyntaxException e) {
+				throw new GDataParseException(String.format(INVALID_ATTRIBUTE,
+						"src", "absolute uri"), e);
+			}
+
+		if (this.mediaType == null)
+			super.processEndElement();
+		else if (this.blobParser != null) {
+			this.textValue = this.blobParser.toString();
+			this.blobParser.close();
+			this.blobParser = null;
+		}
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.GOMTextContructImpl#getChildParser(javax.xml.namespace.QName)
+	 */
+	@Override
+	public AtomParser getChildParser(QName aName) {
+		if (aName == null)
+			throw new GDataParseException("QName must not be null");
+		if (this.mediaType == AtomMediaType.XML) {
+			if (this.blobParser != null)
+				throw new GDataParseException(String.format(
+						DUPLICATE_ELEMENT, aName.getLocalPart()));
+			this.blobParser = new XMLBlobContentParser();
+			return this.blobParser.getChildParser(aName);
+		}
+		return super.getChildParser(aName);
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeAtomOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+
+		if (this.mediaType != null) {
+			List<GOMAttribute> xmlNamespaceAttributes = getXmlNamespaceAttributes();
+			xmlNamespaceAttributes.add(GOMUtils.buildDefaultNamespaceAttribute(
+					this.type, "type"));
+			aStreamWriter.writeStartElement(this.localName,
+					xmlNamespaceAttributes);
+			if (this.src == null)
+				aStreamWriter.writeContentUnescaped(this.textValue);
+			else
+				aStreamWriter.writeAttribute(GOMUtils
+						.buildDefaultNamespaceAttribute(this.src, "src"));
+			aStreamWriter.writeEndElement();
+
+		} else {
+			super.writeAtomOutput(aStreamWriter);
+		}
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.GOMTextContructImpl#writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	@Override
+	public void writeRssOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		if (this.mediaType != null) {
+			// if content is atomOutOfLineContent (has not textValue) ->
+			// generate a <link> element.
+			if (src != null) {
+				aStreamWriter.writeSimpleXMLElement("link", null, this.src);
+			} else if (this.mediaType == AtomMediaType.TEXT) {
+				aStreamWriter.writeSimpleXMLElement("description", null,
+						this.textValue);
+			} else {
+				// RSS doesn't support non-text content --> write atom type
+				this.writeAtomOutput(aStreamWriter);
+			}
+		} else {
+			super.writeRssOutput(aStreamWriter);
+		}
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMContent#setAtomMediaType(org.apache.lucene.gdata.gom.AtomMediaType)
+	 */
+	public void setAtomMediaType(AtomMediaType aMediaType) {
+
+		this.mediaType = aMediaType;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMContent#getAtomMediaType()
+	 */
+	public AtomMediaType getAtomMediaType() {
+		return this.mediaType;
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMContributorImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMContributorImpl.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMContributorImpl.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMContributorImpl.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.GOMAuthor;
+import org.apache.lucene.gdata.gom.GOMContributor;
+import org.apache.lucene.gdata.gom.GOMNamespace;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public class GOMContributorImpl extends GOMPersonImpl implements GOMContributor {
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.GOMPersonImpl#writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter)
+	 */
+	@Override
+	public void writeRssOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		writeRssOutput(aStreamWriter, GOMAuthor.LOCALNAME);
+	}
+
+	/**
+	 * 
+	 */
+	public GOMContributorImpl() {
+		this.localName = GOMContributor.LOCALNAME;
+		this.qname = new QName(GOMNamespace.ATOM_NS_URI, this.localName);
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMDateConstructImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMDateConstructImpl.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMDateConstructImpl.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMDateConstructImpl.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,100 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import java.util.Date;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.GOMDateConstruct;
+import org.apache.lucene.gdata.gom.core.utils.GOMUtils;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+
+/**
+ * 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
+ */
+public abstract class GOMDateConstructImpl extends AbstractGOMElement implements
+		GOMDateConstruct {
+	protected long date;
+
+	/*
+	 * save the rfcString to skip the building while rendering the element
+	 */
+	protected String rfc3339String;
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDateConstruct#setDate(java.util.Date)
+	 */
+	public void setDate(Date aDate) {
+		if (aDate == null)
+			return;
+		this.date = aDate.getTime();
+		this.rfc3339String = GOMUtils.buildRfc3339DateFormat(this.date);
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDateConstruct#getDate()
+	 */
+	public Date getDate() {
+		return new Date(this.date);
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#processElementValue(java.lang.String)
+	 */
+	@Override
+	public void processElementValue(String aValue) {
+		if (aValue == null)
+			throw new IllegalArgumentException("element value must not be null");
+		this.date = GOMUtils.parseRfc3339DateFormat(aValue);
+		this.rfc3339String = aValue;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#processEndElement()
+	 */
+	@Override
+	public void processEndElement() {
+		if (this.rfc3339String == null)
+			throw new GDataParseException(String.format(
+					MISSING_ELEMENT_VALUE, this.localName,
+					"RFC3339 Date Time"));
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeAtomOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		if (this.rfc3339String == null)
+			this.rfc3339String = GOMUtils
+					.buildRfc3339DateFormat(this.date == 0 ? System
+							.currentTimeMillis() : this.date);
+		aStreamWriter.writeSimpleXMLElement(this.qname,
+				getXmlNamespaceAttributes(), this.rfc3339String);
+
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMDocumentImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMDocumentImpl.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMDocumentImpl.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMDocumentImpl.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,135 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.GOMDocument;
+import org.apache.lucene.gdata.gom.GOMElement;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+
+/**
+ * @author Simon Willnauer
+ * @param <T>
+ */
+public class GOMDocumentImpl<T extends GOMElement> implements GOMDocument<T> {
+
+	private static final String DEFAULT_ENCODING = "UTF-8";
+
+	private static final String DEFAULT_VERSION = "1.0";
+
+	private T root;
+
+	private String version;
+
+	private String charEncoding;
+
+	/**
+	 * 
+	 */
+	public GOMDocumentImpl() {
+		super();
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDocument#setRootElement(org.apache.lucene.gdata.gom.GOMElement)
+	 */
+	public void setRootElement(T aRootElement) {
+		this.root = aRootElement;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDocument#getRootElement()
+	 */
+	public T getRootElement() {
+		return this.root;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDocument#setVersion(java.lang.String)
+	 */
+	public void setVersion(String aVersion) {
+		this.version = aVersion;
+
+	}
+
+	/**
+	 * @return the version
+	 * @uml.property name="version"
+	 */
+	public String getVersion() {
+		return this.version;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDocument#getCharacterEncoding()
+	 */
+	public String getCharacterEncoding() {
+		return this.charEncoding;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDocument#setCharacterEncoding(java.lang.String)
+	 */
+	public void setCharacterEncoding(String aEncoding) {
+		this.charEncoding = aEncoding;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDocument#writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeAtomOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		try {
+			aStreamWriter.writeStartDocument(
+					this.charEncoding == null ? DEFAULT_ENCODING
+							: this.charEncoding,
+					this.version == null ? DEFAULT_VERSION : this.version);
+			if (this.root != null)
+				this.root.writeAtomOutput(aStreamWriter);
+			aStreamWriter.writeEndDocument();
+			aStreamWriter.flush();
+		} finally {
+			aStreamWriter.close();
+		}
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMDocument#writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeRssOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		try {
+			aStreamWriter.writeStartDocument(
+					this.charEncoding == null ? DEFAULT_ENCODING
+							: this.charEncoding,
+					this.version == null ? DEFAULT_VERSION : this.version);
+			if (this.root != null) {
+				this.root.writeRssOutput(aStreamWriter);
+			}
+			aStreamWriter.writeEndDocument();
+			aStreamWriter.flush();
+		} finally {
+			aStreamWriter.close();
+		}
+
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMEntryImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMEntryImpl.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMEntryImpl.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMEntryImpl.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,668 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.lucene.gdata.gom.AtomMediaType;
+import org.apache.lucene.gdata.gom.GOMAuthor;
+import org.apache.lucene.gdata.gom.GOMCategory;
+import org.apache.lucene.gdata.gom.GOMContent;
+import org.apache.lucene.gdata.gom.GOMContributor;
+import org.apache.lucene.gdata.gom.GOMEntry;
+import org.apache.lucene.gdata.gom.GOMExtension;
+import org.apache.lucene.gdata.gom.GOMId;
+import org.apache.lucene.gdata.gom.GOMLink;
+import org.apache.lucene.gdata.gom.GOMNamespace;
+import org.apache.lucene.gdata.gom.GOMPublished;
+import org.apache.lucene.gdata.gom.GOMRights;
+import org.apache.lucene.gdata.gom.GOMSource;
+import org.apache.lucene.gdata.gom.GOMSummary;
+import org.apache.lucene.gdata.gom.GOMTitle;
+import org.apache.lucene.gdata.gom.GOMUpdated;
+import org.apache.lucene.gdata.gom.core.extension.GOMExtensionFactory;
+import org.apache.lucene.gdata.gom.core.utils.AtomParserUtils;
+import org.apache.lucene.gdata.gom.writer.GOMOutputWriter;
+
+/**
+ * 
+ * The default implementation of {@link org.apache.lucene.gdata.gom.GOMEntry}
+ * 
+ * <pre>
+ *         atomEntry =
+ *         element atom:entry {
+ *         atomCommonAttributes,
+ *         (	atomAuthor*
+ *         	&amp; atomCategory*
+ *         	&amp; atomContent?
+ *         	&amp; atomContributor*
+ *         	&amp; atomId
+ *         	&amp; atomLink*
+ *         	&amp; atomPublished?
+ *       	 	&amp; atomRights?
+ *         	&amp; atomSource?
+ *         	&amp; atomSummary?
+ *         	&amp; atomTitle
+ *         	&amp; atomUpdated
+ *         	&amp; extensionElement*)
+ *         }
+ * </pre>
+ * 
+ * @author Simon Willnauer
+ * 
+ */
+public class GOMEntryImpl extends AbstractGOMElement implements GOMEntry {
+
+	protected List<GOMNamespace> namespaces = new LinkedList<GOMNamespace>();
+
+	protected List<GOMExtension> extensions = new LinkedList<GOMExtension>();
+
+	private List<GOMAuthor> authors = new LinkedList<GOMAuthor>();
+
+	private List<GOMCategory> categories = new LinkedList<GOMCategory>();
+
+	private List<GOMContributor> contributors = new LinkedList<GOMContributor>();
+
+	private GOMId id;
+
+	private List<GOMLink> links = new LinkedList<GOMLink>();
+
+	private GOMPublished published;
+
+	private GOMRights rights;
+
+	private GOMSource source;
+
+	private GOMSummary summary;
+
+	private GOMTitle title;
+
+	private GOMUpdated updated;
+
+	private GOMExtensionFactory extensionFactory;
+
+	private GOMContent content;
+
+	private final GOMNamespace defaultNamespace = GOMNamespace.ATOM_NAMESPACE;
+
+	/**
+	 * 
+	 */
+	public GOMEntryImpl() {
+		super();
+		this.localName = GOMEntry.LOCALNAME;
+		this.qname = new QName(GOMNamespace.ATOM_NS_URI, this.localName);
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#addAuthor(org.apache.lucene.gdata.gom.GOMAuthor)
+	 */
+	public void addAuthor(GOMAuthor aAuthor) {
+		if (aAuthor != null)
+			this.authors.add(aAuthor);
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#addCategory(org.apache.lucene.gdata.gom.GOMCategory)
+	 */
+	public void addCategory(GOMCategory aCategory) {
+		if (aCategory != null)
+			this.categories.add(aCategory);
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#addContributor(org.apache.lucene.gdata.gom.GOMContributor)
+	 */
+	public void addContributor(GOMContributor aContributor) {
+		if (aContributor != null)
+			this.contributors.add(aContributor);
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#addLink(org.apache.lucene.gdata.gom.GOMLink)
+	 */
+	public void addLink(GOMLink aLink) {
+		if (aLink != null)
+			this.links.add(aLink);
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getAuthors()
+	 */
+	public List<GOMAuthor> getAuthors() {
+		return this.authors;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getCategories()
+	 */
+	public List<GOMCategory> getCategories() {
+		return this.categories;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getContributor()
+	 */
+	public List<GOMContributor> getContributor() {
+		return this.contributors;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getId()
+	 */
+	public GOMId getId() {
+		return this.id;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getLinks()
+	 */
+	public List<GOMLink> getLinks() {
+		return this.links;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getPublished()
+	 */
+	public GOMPublished getPublished() {
+		return this.published;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getRights()
+	 */
+	public GOMRights getRights() {
+		return this.rights;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getSource()
+	 */
+	public GOMSource getSource() {
+		return this.source;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getSummary()
+	 */
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getSummary()
+	 */
+	public GOMSummary getSummary() {
+		return this.summary;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getTitle()
+	 */
+	public GOMTitle getTitle() {
+		return this.title;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getUpdated()
+	 */
+	public GOMUpdated getUpdated() {
+		return this.updated;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#setId(org.apache.lucene.gdata.gom.GOMId)
+	 */
+	public void setId(GOMId aId) {
+		this.id = aId;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#setPublished(org.apache.lucene.gdata.gom.GOMPublished)
+	 */
+	public void setPublished(GOMPublished aPublished) {
+		this.published = aPublished;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#setRights(org.apache.lucene.gdata.gom.GOMRights)
+	 */
+	public void setRights(GOMRights aRights) {
+		this.rights = aRights;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#setSource(org.apache.lucene.gdata.gom.GOMSource)
+	 */
+	public void setSource(GOMSource aSource) {
+		this.source = aSource;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#setSummary(org.apache.lucene.gdata.gom.GOMSummary)
+	 */
+	public void setSummary(GOMSummary aSummary) {
+		this.summary = aSummary;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#setTitle(org.apache.lucene.gdata.gom.GOMTitle)
+	 */
+	public void setTitle(GOMTitle aTitle) {
+		this.title = aTitle;
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#setUpdated(org.apache.lucene.gdata.gom.GOMUpdated)
+	 */
+	public void setUpdated(GOMUpdated aUpdated) {
+		this.updated = aUpdated;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#addNamespace(org.apache.lucene.gdata.gom.GOMNamespace)
+	 */
+	public void addNamespace(GOMNamespace aNamespace) {
+		if (aNamespace == null)
+			return;
+		// namespace overrides hash / equals
+		if (this.namespaces.contains(aNamespace))
+			return;
+		if ("".equals(aNamespace.getNamespacePrefix())
+				|| aNamespace.getNamespaceUri()
+						.equals(GOMNamespace.ATOM_NS_URI))
+			return;
+		else
+			this.namespaces.add(aNamespace);
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getNamespaces()
+	 */
+	public List<GOMNamespace> getNamespaces() {
+		return this.namespaces;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getDefaultNamespace()
+	 */
+	public GOMNamespace getDefaultNamespace() {
+
+		return this.defaultNamespace;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeAtomOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		aStreamWriter
+				.writeStartElement(this.qname, getXmlNamespaceAttributes());
+		if (this.defaultNamespace != null)
+			aStreamWriter.writeDefaultNamespace(this.defaultNamespace);
+		for (GOMNamespace namespace : this.namespaces) {
+			aStreamWriter.writeNamespace(namespace);
+		}
+		if (this.id != null)
+			this.id.writeAtomOutput(aStreamWriter);
+		if (this.published != null)
+			this.published.writeAtomOutput(aStreamWriter);
+		if (this.updated != null)
+			this.updated.writeAtomOutput(aStreamWriter);
+		for (GOMCategory category : this.categories) {
+			category.writeAtomOutput(aStreamWriter);
+		}
+		if (this.title != null)
+			this.title.writeAtomOutput(aStreamWriter);
+		if (this.summary != null)
+			this.summary.writeAtomOutput(aStreamWriter);
+		if (this.content != null)
+			this.content.writeAtomOutput(aStreamWriter);
+		for (GOMLink link : this.links) {
+			link.writeAtomOutput(aStreamWriter);
+		}
+		for (GOMAuthor autor : this.authors) {
+			autor.writeAtomOutput(aStreamWriter);
+		}
+		for (GOMContributor contributor : this.contributors) {
+			contributor.writeAtomOutput(aStreamWriter);
+		}
+		if (this.rights != null) {
+			this.rights.writeAtomOutput(aStreamWriter);
+		}
+		if (this.source != null) {
+			this.source.writeAtomOutput(aStreamWriter);
+		}
+
+		for (GOMExtension extension : this.extensions) {
+			extension.writeAtomOutput(aStreamWriter);
+		}
+		aStreamWriter.writeEndElement();
+
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMElement#writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMStaxWriter)
+	 */
+	public void writeRssOutput(GOMOutputWriter aStreamWriter)
+			throws XMLStreamException {
+		aStreamWriter.writeStartElement(GOMEntry.LOCALNAME_RSS,
+				getXmlNamespaceAttributes());
+		if (this.defaultNamespace != null)
+			aStreamWriter.writeNamespace(this.defaultNamespace);
+		for (GOMNamespace namespace : this.namespaces) {
+			aStreamWriter.writeNamespace(namespace);
+		}
+		if (this.id != null)
+			this.id.writeRssOutput(aStreamWriter, GOMId.LOCALNAME_RSS);
+		String xmlLang = null;
+
+		if (this.content != null) {
+			xmlLang = this.content.getXmlLang();
+		}
+		if (xmlLang == null && this.summary != null) {
+			xmlLang = this.summary.getXmlLang();
+		}
+
+		if (xmlLang == null && this.title != null) {
+			xmlLang = this.title.getXmlLang();
+		}
+
+		if (xmlLang != null) {
+			aStreamWriter.writeSimpleXMLElement("language", xmlLang, null);
+		}
+		if (this.published != null) {
+			this.published.writeRssOutput(aStreamWriter);
+		}
+		if (this.updated != null)
+			this.updated.writeRssOutput(aStreamWriter);
+		for (GOMCategory category : this.categories) {
+			category.writeRssOutput(aStreamWriter);
+		}
+		if (this.title != null)
+			this.title.writeRssOutput(aStreamWriter);
+		if (this.summary != null)
+			this.summary.writeRssOutput(aStreamWriter);
+		if (this.content != null)
+			this.content.writeRssOutput(aStreamWriter);
+		for (GOMLink link : this.links) {
+			link.writeRssOutput(aStreamWriter);
+		}
+		for (GOMAuthor author : this.authors) {
+			author.writeRssOutput(aStreamWriter);
+		}
+
+		for (GOMContributor contributors : this.contributors) {
+			contributors.writeRssOutput(aStreamWriter);
+		}
+
+		for (GOMExtension extension : this.extensions) {
+			extension.writeRssOutput(aStreamWriter);
+		}
+		aStreamWriter.writeEndElement();
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#getChildParser(javax.xml.namespace.QName)
+	 */
+	@Override
+	public AtomParser getChildParser(QName aName) {
+		if (aName.getNamespaceURI().equals(GOMNamespace.ATOM_NS_URI)) {
+			if (aName.getLocalPart().equals(GOMId.LOCALNAME)) {
+				// atom:feed elements MUST contain exactly one atom:id element.
+				if (this.id != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ELEMENT, GOMId.LOCALNAME));
+				this.id = new GOMIdImpl();
+				return this.id;
+			}
+			if (aName.getLocalPart().equals(GOMTitle.LOCALNAME)) {
+				// atom:entry elements MUST contain exactly one atom:title
+				// element.
+				if (this.title != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ELEMENT, GOMTitle.LOCALNAME));
+				this.title = new GOMTitleImpl();
+				return this.title;
+			}
+			if (aName.getLocalPart().equals(GOMAuthor.LOCALNAME)) {
+				GOMAuthor author = new GOMAuthorImpl();
+				this.authors.add(author);
+				return author;
+			}
+			if (aName.getLocalPart().equals(GOMCategory.LOCALNAME)) {
+				GOMCategory category = new GOMCategoryImpl();
+				this.categories.add(category);
+				return category;
+			}
+			if (aName.getLocalPart().equals(GOMContributor.LOCALNAME)) {
+				GOMContributorImpl impl = new GOMContributorImpl();
+				this.contributors.add(impl);
+				return impl;
+			}
+			if (aName.getLocalPart().equals(GOMLink.LOCALNAME)) {
+				GOMLinkImpl impl = new GOMLinkImpl();
+				this.links.add(impl);
+				return impl;
+			}
+
+			if (aName.getLocalPart().equals(GOMUpdated.LOCALNAME)) {
+				if (this.updated != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ELEMENT,
+							GOMUpdated.LOCALNAME));
+				GOMUpdated updatedImpl = new GOMUpdatedImpl();
+				this.updated = updatedImpl;
+				return this.updated;
+
+			}
+			if (aName.getLocalPart().equals(GOMRights.LOCALNAME)) {
+				if (this.rights != null)
+					throw new GDataParseException(String
+							.format(AtomParser.DUPLICATE_ELEMENT,
+									GOMRights.LOCALNAME));
+
+				this.rights = new GOMRightsImpl();
+				return this.rights;
+
+			}
+			if (aName.getLocalPart().equals(GOMSource.LOCALNAME)) {
+				if (this.source != null)
+					throw new GDataParseException(String
+							.format(AtomParser.DUPLICATE_ELEMENT,
+									GOMSource.LOCALNAME));
+				this.source = new GOMSourceImpl();
+
+				return this.source;
+
+			}
+			if (aName.getLocalPart().equals(GOMSummary.LOCALNAME)) {
+				if (this.summary != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ELEMENT,
+							GOMSummary.LOCALNAME));
+
+				this.summary = new GOMSummaryImpl();
+				return this.summary;
+
+			}
+			if (aName.getLocalPart().equals(GOMPublished.LOCALNAME)) {
+				if (this.published != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ELEMENT,
+							GOMPublished.LOCALNAME));
+
+				this.published = new GOMPublishedImpl();
+				return this.published;
+
+			}
+			if (aName.getLocalPart().endsWith(GOMContent.LOCALNAME)) {
+				if (this.content != null)
+					throw new GDataParseException(String.format(
+							AtomParser.DUPLICATE_ELEMENT,
+							GOMContent.LOCALNAME));
+				this.content = new GOMContentImpl();
+				return this.content;
+
+			}
+
+		}
+		if (this.extensionFactory != null) {
+			GOMExtension extension = this.extensionFactory
+					.canHandleExtensionElement(aName);
+			if (extension != null) {
+				this.extensions.add(extension);
+				return extension;
+			}
+		}
+		return super.getChildParser(aName);
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.core.AbstractGOMElement#processEndElement()
+	 */
+	@Override
+	public void processEndElement() {
+
+		/*
+		 * atom:entry elements MUST contain an atom:summary element in either of
+		 * the following cases:
+		 * 
+		 * the atom:entry contains an atom:content that has a "src" attribute
+		 * (and is thus empty). the atom:entry contains content that is encoded
+		 * in Base64; i.e., the "type" attribute of atom:content is a MIME media
+		 * type [MIMEREG], but is not an XML media type [RFC3023], does not
+		 * begin with "text/", and does not end with "/xml" or "+xml".
+		 * 
+		 * 
+		 */
+		if (this.summary == null && this.content != null) {
+
+			if (this.content.getAtomMediaType() == AtomMediaType.BINARY
+					|| "".equals(this.content.getSrc())) {
+				throw new GDataParseException(String.format(
+						MISSING_ELEMENT_CHILD, this.localName,
+						GOMSummary.LOCALNAME));
+			}
+		}
+
+		/*
+		 * atom:entry elements MUST contain exactly one atom:id element.
+		 */
+		if (this.id == null)
+			throw new GDataParseException(String.format(
+					MISSING_ELEMENT_CHILD, this.localName, GOMId.LOCALNAME));
+		/*
+		 * atom:entry elements MUST contain exactly one atom:title element.
+		 */
+		if (this.title == null)
+			throw new GDataParseException(String
+					.format(MISSING_ELEMENT_CHILD, this.localName,
+							GOMTitle.LOCALNAME));
+		/*
+		 * atom:entry elements MUST contain exactly one atom:updated element.
+		 */
+		if (this.updated == null)
+			throw new GDataParseException(String.format(
+					MISSING_ELEMENT_CHILD, this.localName,
+					GOMUpdated.LOCALNAME));
+
+		/*
+		 * atom:entry elements MUST NOT contain more than one atom:link element
+		 * with a rel attribute value of "alternate" that has the same
+		 * combination of type and hreflang attribute values.
+		 */
+		List<GOMLink> alternateLinks = new LinkedList<GOMLink>();
+		for (GOMLink link : this.links) {
+			/*
+			 * atom:link elements MAY have a "rel" attribute that indicates the
+			 * link relation type. If the "rel" attribute is not present, the
+			 * link element MUST be interpreted as if the link relation type is
+			 * "alternate".
+			 */
+			if (link.getRel() == null
+					|| link.getRel().equalsIgnoreCase("alternate"))
+				alternateLinks.add(link);
+		}
+
+		/*
+		 * atom:entry elements MUST NOT contain more than one atom:link element
+		 * with a rel attribute value of "alternate" that has the same
+		 * combination of type and hreflang attribute values.
+		 */
+		if (alternateLinks.size() > 1) {
+			for (GOMLink link : alternateLinks) {
+				for (GOMLink link2 : alternateLinks) {
+					if (AtomParserUtils.compareAlternateLinks(link, link2))
+						throw new GDataParseException(
+								String
+										.format(DUPLICATE_ELEMENT,
+												"link with rel=\"alternate\" and same href and type attributes"));
+
+				}
+			}
+		} else if (this.content == null && alternateLinks.size() == 0) {
+			throw new GDataParseException(
+					"Element Entry must contain a element link with attribute alternate if no content element is set");
+		}
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMExtensible#getExtensions()
+	 */
+	public List<GOMExtension> getExtensions() {
+		return this.extensions;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMExtensible#setExtensionFactory(org.apache.lucene.gdata.gom.core.extension.GOMExtensionFactory)
+	 */
+	public void setExtensionFactory(GOMExtensionFactory aFactory) {
+		if (extensionFactory != null) {
+			List<GOMNamespace> namespaces2 = extensionFactory.getNamespaces();
+			if (namespaces2 != null)
+				for (GOMNamespace namespace : namespaces2) {
+					this.addNamespace(namespace);
+				}
+
+		}
+		this.extensionFactory = aFactory;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#getContent()
+	 */
+	public GOMContent getContent() {
+		return this.content;
+	}
+
+	/**
+	 * @see org.apache.lucene.gdata.gom.GOMEntry#setContent(org.apache.lucene.gdata.gom.GOMContent)
+	 */
+	public void setContent(GOMContent aContent) {
+		this.content = aContent;
+
+	}
+
+}

Added: lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMFactory.java?view=auto&rev=486627
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMFactory.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/gom/java/org/apache/lucene/gdata/gom/core/GOMFactory.java Wed Dec 13 04:39:54 2006
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.gdata.gom.core;
+
+import org.apache.lucene.gdata.gom.GOMEntry;
+import org.apache.lucene.gdata.gom.GOMFeed;
+
+/**
+ * @author Simon Willnauer
+ * 
+ */
+public class GOMFactory {
+	/**
+	 * 
+	 */
+	private GOMFactory() {
+		super();
+	}
+
+	public static GOMFactory createInstance() {
+		return new GOMFactory();
+	}
+
+	public GOMFeed createFeed() {
+		return new GOMFeedImpl();
+	}
+
+	public GOMEntry createEntry() {
+		return new GOMEntryImpl();
+
+	}
+
+}



Mime
View raw message