Methods Summary |
---|
public java.lang.String | getLabel()
return this.label;
|
public java.lang.String | getScheme()
return this.scheme;
|
public java.lang.String | getTerm()
return this.term;
|
public void | processAttribute(javax.xml.namespace.QName aQName, java.lang.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);
}
|
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);
}
}
|
public void | setLabel(java.lang.String aLabel)
this.label = aLabel;
|
public void | setScheme(java.lang.String aScheme)
this.scheme = aScheme;
|
public void | setTerm(java.lang.String aTerm)
this.term = aTerm;
|
public void | writeAtomOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter aStreamWriter)
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);
|
public void | writeRssOutput(org.apache.lucene.gdata.gom.writer.GOMOutputWriter aStreamWriter)
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);
|