Methods Summary |
---|
public void | addEntry(org.apache.lucene.gdata.gom.GOMEntry aEntry)
if (aEntry != null)
this.entries.add(aEntry);
|
public void | addLink(org.apache.lucene.gdata.gom.GOMLink aLink)
if (aLink == null)
return;
this.links.add(aLink);
|
public void | addNamespace(org.apache.lucene.gdata.gom.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);
|
public AtomParser | getChildParser(javax.xml.namespace.QName aName)
if (aName.getNamespaceURI().equals(GOMNamespace.OPENSEARCH_NS_URI)) {
if (aName.getLocalPart().equals(
SimpleGOMElementImpl.ELEMENT_OS_ITEMS_PER_PAGE)) {
this.itemsPerPageElement = new SimpleGOMElementImpl(
SimpleGOMElementImpl.ELEMENT_OS_ITEMS_PER_PAGE,
GOMNamespace.OPENSEARCH_NAMESPACE);
this.itemsPerPageElement
.setValidator(new PositiveIntegerValidator(
SimpleGOMElementImpl.ELEMENT_OS_ITEMS_PER_PAGE));
return this.itemsPerPageElement;
}
if (aName.getLocalPart().equals(
SimpleGOMElementImpl.ELEMENT_OS_START_INDEX)) {
this.startIndexElement = new SimpleGOMElementImpl(
SimpleGOMElementImpl.ELEMENT_OS_START_INDEX,
GOMNamespace.OPENSEARCH_NAMESPACE);
this.startIndexElement
.setValidator(new PositiveIntegerValidator(
SimpleGOMElementImpl.ELEMENT_OS_START_INDEX));
return this.startIndexElement;
}
}
if (aName.getNamespaceURI().equals(GOMNamespace.ATOM_NS_URI)
&& aName.getLocalPart().equals(GOMEntry.LOCALNAME)) {
GOMEntry entry = new GOMEntryImpl();
this.entries.add(entry);
return entry;
}
if (this.extensionFactory != null) {
GOMExtension extension = this.extensionFactory
.canHandleExtensionElement(aName);
if (extension != null) {
this.extensions.add(extension);
return extension;
}
}
return super.getChildParser(aName);
|
public org.apache.lucene.gdata.gom.GOMNamespace | getDefaultNamespace()
return this.defaultNamespace;
|
public java.util.List | getEntries()
return this.entries;
|
public java.util.List | getExtensions()
return this.extensions;
|
public int | getItemsPerPage()
return Integer.parseInt(this.itemsPerPageElement.getTextValue());
|
public java.util.List | getNamespaces()
return this.namespaces;
|
public int | getStartIndex()
return Integer.parseInt(this.startIndexElement.getTextValue());
|
public void | setExtensionFactory(org.apache.lucene.gdata.gom.core.extension.GOMExtensionFactory aFactory)
if (extensionFactory != null) {
List<GOMNamespace> namespaces2 = extensionFactory.getNamespaces();
if (namespaces2 != null)
for (GOMNamespace namespace : namespaces2) {
this.addNamespace(namespace);
}
}
this.extensionFactory = aFactory;
|
public void | setItemsPerPage(int aInt)
if (aInt < 0)
return;
this.itemsPerPageElement.textValue = Integer.toString(aInt);
|
public void | setStartIndex(int aIndex)
if (aIndex < 1)
return;
this.startIndexElement.textValue = Integer.toString(aIndex);
|
public void | writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter aStreamWriter)
aStreamWriter.writeStartElement(this.localName,
this.extensionAttributes);
if (this.defaultNamespace != null)
aStreamWriter.writeDefaultNamespace(this.defaultNamespace);
for (GOMNamespace namespace : this.namespaces) {
aStreamWriter.writeNamespace(namespace);
}
List<GOMAttribute> xmlNamespaceAttributes = getXmlNamespaceAttributes();
for (GOMAttribute attribute : xmlNamespaceAttributes) {
aStreamWriter.writeAttribute(attribute);
}
writeInnerAtomOutput(aStreamWriter);
if (this.itemsPerPageElement != null)
this.itemsPerPageElement.writeAtomOutput(aStreamWriter);
if (this.startIndexElement != null)
this.startIndexElement.writeAtomOutput(aStreamWriter);
for (GOMExtension extension : this.extensions) {
extension.writeAtomOutput(aStreamWriter);
}
for (GOMEntry entry : this.entries) {
entry.writeAtomOutput(aStreamWriter);
}
aStreamWriter.writeEndElement();
|
public void | writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter aStreamWriter)
aStreamWriter
.writeStartElement(LOCALNAME_RSS, this.extensionAttributes);
List<GOMAttribute> xmlNamespaceAttributes = getXmlNamespaceAttributes();
for (GOMAttribute attribute : xmlNamespaceAttributes) {
aStreamWriter.writeAttribute(attribute);
}
if (this.defaultNamespace != null)
aStreamWriter.writeNamespace(this.defaultNamespace);
for (GOMNamespace namespace : this.namespaces) {
aStreamWriter.writeNamespace(namespace);
}
aStreamWriter.writeAttribute(RSS_VERSION_ATTRIBUTE);
aStreamWriter.writeStartElement(RSS_CHANNEL_ELEMENT_NAME);
if (this.id != null)
this.id.writeRssOutput(aStreamWriter);
if (this.title != null)
this.title.writeRssOutput(aStreamWriter);
if (this.subtitle != null)
this.subtitle.writeRssOutput(aStreamWriter);
if (this.rights != null)
this.rights.writeRssOutput(aStreamWriter);
for (GOMAuthor authors : this.authors) {
authors.writeRssOutput(aStreamWriter, "managingEditor");
}
for (GOMCategory category : this.categories) {
category.writeRssOutput(aStreamWriter);
}
for (GOMLink link : this.links) {
link.writeRssOutput(aStreamWriter);
}
if (this.updated != null) {
// udated.getDate can not be null
aStreamWriter.writeSimpleXMLElement("lastBuildDate", GOMUtils
.buildRfc822Date(this.updated.getDate().getTime()), null);
}
if (this.logo != null || this.icon != null) {
aStreamWriter.writeStartElement("image");
if (this.logo != null)
this.logo.writeRssOutput(aStreamWriter);
else
this.icon.writeRssOutput(aStreamWriter);
aStreamWriter.writeEndElement();
}
if (this.generator != null)
this.generator.writeRssOutput(aStreamWriter);
if (this.itemsPerPageElement != null)
this.itemsPerPageElement.writeRssOutput(aStreamWriter);
if (this.startIndexElement != null)
this.startIndexElement.writeRssOutput(aStreamWriter);
for (GOMExtension extension : this.extensions) {
extension.writeRssOutput(aStreamWriter);
}
for (GOMExtension extension : this.extensions) {
extension.writeRssOutput(aStreamWriter);
}
for (GOMEntry entry : this.entries) {
entry.writeRssOutput(aStreamWriter);
}
// channel
aStreamWriter.writeEndElement();
// rss
aStreamWriter.writeEndElement();
|