Methods Summary |
---|
public org.apache.lucene.gdata.gom.GOMDocument | buildGOMEntry()
GOMDocument<GOMEntry> document = new GOMDocumentImpl<GOMEntry>();
GOMEntry element = startEntryDocument(document);
document.setRootElement(element);
parse(this.streamReader);
return document;
|
public org.apache.lucene.gdata.gom.GOMDocument | buildGOMFeed()
GOMDocument<GOMFeed> document = new GOMDocumentImpl<GOMFeed>();
GOMFeed element = startFeedDocument(document);
document.setRootElement(element);
parse(this.streamReader);
return document;
|
private int | next()
return this.streamReader.next();
|
private void | parse(javax.xml.stream.XMLStreamReader aReader)
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);
}
|
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));
}
|
private org.apache.lucene.gdata.gom.GOMEntry | startEntryDocument(org.apache.lucene.gdata.gom.GOMDocument aDocument)
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 org.apache.lucene.gdata.gom.GOMFeed | startFeedDocument(org.apache.lucene.gdata.gom.GOMDocument aDocument)
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;
|