Methods Summary |
---|
public java.lang.String | getHref()
return this.href;
|
public java.lang.String | getHrefLang()
return this.hrefLang;
|
public java.lang.Integer | getLength()
return this.length;
|
public java.lang.String | getRel()
return this.rel;
|
public java.lang.String | getTitle()
return this.title;
|
public java.lang.String | getType()
return this.type;
|
public void | processAttribute(javax.xml.namespace.QName aQName, java.lang.String aValue)
if (aQName == null)
throw new IllegalArgumentException("QName must not be null");
if (aQName.getNamespaceURI().equals(GOMNamespace.ATOM_NS_URI)
|| aQName.getNamespaceURI().equals("")) {
String localName = aQName.getLocalPart();
if (localName.equals("href")) {
if (this.href != null)
throw new GDataParseException(String.format(
DUPLICATE_ATTRIBUTE, "href"));
this.href = aValue;
} else if (localName.equals("type")) {
if (this.type != null)
throw new GDataParseException(String.format(
DUPLICATE_ATTRIBUTE, "type"));
this.type = aValue;
} else if (localName.equals("rel")) {
if (this.rel != null)
throw new GDataParseException(String.format(
DUPLICATE_ATTRIBUTE, "rel"));
this.rel = aValue;
} else if (localName.equals("title")) {
if (this.title != null)
throw new GDataParseException(String.format(
DUPLICATE_ATTRIBUTE, "title"));
this.title = aValue;
} else if (localName.equals("hreflang")) {
if (this.hrefLang != null)
throw new GDataParseException(String.format(
DUPLICATE_ATTRIBUTE, "hreflang"));
this.hrefLang = aValue;
} else if (localName.equals("length")) {
if (this.length != null)
throw new GDataParseException(String.format(
DUPLICATE_ATTRIBUTE, "length"));
try {
this.length = new Integer(Integer.parseInt(aValue));
} catch (NumberFormatException e) {
throw new GDataParseException(
"attribute lenght must be an integer");
}
}
}
super.processAttribute(aQName, aValue);
|
public void | processEndElement()
if (this.href == null)
throw new GDataParseException(String.format(
MISSING_ELEMENT_ATTRIBUTE, this.localName, "href"));
try {
AtomParserUtils.getAbsolutAtomURI(this.xmlBase, this.href);
} catch (URISyntaxException e) {
throw new GDataParseException(String.format(INVALID_ATTRIBUTE,
"href", "absolute uri"), e);
}
|
public void | setHref(java.lang.String aHref)
href = aHref;
|
public void | setHrefLang(java.lang.String aHrefLang)
hrefLang = aHrefLang;
|
public void | setLength(java.lang.Integer aLength)
length = aLength;
|
public void | setRel(java.lang.String aRel)
rel = aRel;
|
public void | setTitle(java.lang.String aTitle)
title = aTitle;
|
public void | setType(java.lang.String aType)
type = aType;
|
public void | writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter aStreamWriter)
List<GOMAttribute> attList = getXmlNamespaceAttributes();
attList.add(GOMUtils.buildDefaultNamespaceAttribute(
this.href == null ? "" : this.href, "href"));
if (this.rel != null)
attList.add(GOMUtils
.buildDefaultNamespaceAttribute(this.rel, "rel"));
if (this.title != null)
attList.add(GOMUtils.buildDefaultNamespaceAttribute(this.title,
"title"));
if (this.type != null)
attList.add(GOMUtils.buildDefaultNamespaceAttribute(this.type,
"type"));
if (this.hrefLang != null)
attList.add(GOMUtils.buildDefaultNamespaceAttribute(this.hrefLang,
"hreflang"));
if (this.length != null)
attList.add(GOMUtils.buildDefaultNamespaceAttribute(this.length
.toString(), "length"));
aStreamWriter.writeSimpleXMLElement(this.qname, attList, null);
|
public void | writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter aStreamWriter)
List<GOMAttribute> xmlNamespaceAttributes = getXmlNamespaceAttributes();
if (this.rel != null && rel.equalsIgnoreCase("enclosure")) {
if (type != null)
xmlNamespaceAttributes.add(GOMUtils
.buildDefaultNamespaceAttribute(type, "type"));
if (href != null)
xmlNamespaceAttributes.add(GOMUtils
.buildDefaultNamespaceAttribute(href, "href"));
aStreamWriter.writeSimpleXMLElement("enclosure",
xmlNamespaceAttributes, null);
} else if ("comments".equalsIgnoreCase(this.rel))
aStreamWriter.writeSimpleXMLElement("comments", null, this.href);
else if ("alternate".equalsIgnoreCase(this.rel))
aStreamWriter.writeSimpleXMLElement("link", null, this.href);
|