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

GOMGeneratorImpl

public class GOMGeneratorImpl extends AbstractGOMElement implements org.apache.lucene.gdata.gom.GOMGenerator
author
Simon Willnauer

Fields Summary
private String
generatorVersion
private String
uri
Constructors Summary
public GOMGeneratorImpl()

		super();
		this.localName = GOMGenerator.LOCALNAME;
		this.qname = new QName(GOMNamespace.ATOM_NS_URI, this.localName);
	
Methods Summary
public java.lang.StringgetGeneratorVersion()

see
org.apache.lucene.gdata.gom.GOMGenerator#getGeneratorVersion()

		return this.generatorVersion;
	
public java.lang.StringgetUri()

see
org.apache.lucene.gdata.gom.GOMGenerator#getUri()

		return this.uri;
	
public voidprocessAttribute(javax.xml.namespace.QName aQName, java.lang.String aValue)

see
org.apache.lucene.gdata.gom.core.AbstractGOMElement#processAttribute(javax.xml.namespace.QName, java.lang.String)

		if (aQName == null)
			throw new IllegalArgumentException("Qname must not be null");
		if (aValue == null)
			throw new IllegalArgumentException("Value must not be null");
		if (aQName.getNamespaceURI().equals(GOMNamespace.ATOM_NS_URI)) {
			if (aQName.getLocalPart().equals("uri")) {
				if (this.uri != null)
					throw new GDataParseException(String.format(
							AtomParser.DUPLICATE_ATTRIBUTE, "uri"));
				this.uri = aValue;
			} else if (aQName.getLocalPart().equals("version")) {
				if (this.generatorVersion != null)
					throw new GDataParseException(String.format(
							AtomParser.DUPLICATE_ATTRIBUTE, "version"));
				this.generatorVersion = aValue;
			}
		}
		super.processAttribute(aQName, aValue);
	
public voidprocessElementValue(java.lang.String aValue)

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

		if (this.textValue != null)
			throw new GDataParseException(String.format(
					AtomParser.DUPLICATE_ELEMENT_VALUE, this.localName));
		this.textValue = aValue;

	
public voidprocessEndElement()

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

		if (this.uri != null)
			try {
				AtomParserUtils.getAbsolutAtomURI(this.xmlBase, this.uri);
			} catch (URISyntaxException e) {
				throw new GDataParseException(String.format(
						AtomParser.INVALID_ELEMENT_VALUE, this.localName,
						"absolute uri"));
			}

	
public voidsetGeneratorVersion(java.lang.String aVersion)

see
org.apache.lucene.gdata.gom.GOMGenerator#setGeneratorVersion(java.lang.String)

		this.generatorVersion = aVersion;

	
public voidsetUri(java.lang.String aUri)

see
org.apache.lucene.gdata.gom.GOMGenerator#setUri(java.lang.String)

		this.uri = aUri;

	
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)

		List<GOMAttribute> list = getXmlNamespaceAttributes();
		if (this.uri != null)
			list.add(new GOMAttributeImpl("uri", this.uri));
		if (this.generatorVersion != null)
			list.add(new GOMAttributeImpl("version", this.generatorVersion));

		aStreamWriter.writeSimpleXMLElement(this.qname, list, this.textValue);
	
public voidwriteRssOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter aStreamWriter)

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

		aStreamWriter.writeSimpleXMLElement(this.localName,
				getXmlNamespaceAttributes(), this.textValue);