本文整理汇总了Java中org.jivesoftware.smack.packet.NamedElement类的典型用法代码示例。如果您正苦于以下问题:Java NamedElement类的具体用法?Java NamedElement怎么用?Java NamedElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NamedElement类属于org.jivesoftware.smack.packet包,在下文中一共展示了NamedElement类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseData
import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
private AbstractHttpOverXmpp.Data parseData(XmlPullParser parser) throws XmlPullParserException, IOException {
NamedElement child = null;
boolean done = false;
while (!done) {
int eventType = parser.next();
if (eventType == XmlPullParser.START_TAG) {
if (parser.getName().equals(ELEMENT_TEXT)) {
child = parseText(parser);
} else if (parser.getName().equals(ELEMENT_BASE_64)) {
child = parseBase64(parser);
} else if (parser.getName().equals(ELEMENT_CHUNKED_BASE_64)) {
child = parseChunkedBase64(parser);
} else if (parser.getName().equals(ELEMENT_XML)) {
child = parseXml(parser);
} else if (parser.getName().equals(ELEMENT_IBB)) {
child = parseIbb(parser);
} else if (parser.getName().equals(ELEMENT_SIPUB)) {
// TODO: sipub is allowed by xep-0332, but is not implemented yet
throw new UnsupportedOperationException("sipub is not supported yet");
} else if (parser.getName().equals(ELEMENT_JINGLE)) {
// TODO: jingle is allowed by xep-0332, but is not implemented yet
throw new UnsupportedOperationException("jingle is not supported yet");
} else {
// other elements are not allowed
throw new IllegalArgumentException("unsupported child tag: " + parser.getName());
}
} else if (eventType == XmlPullParser.END_TAG) {
if (parser.getName().equals(ELEMENT_DATA)) {
done = true;
}
}
}
AbstractHttpOverXmpp.Data data = new AbstractHttpOverXmpp.Data(child);
return data;
}
示例2: toXML
import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
@Override
public XmlStringBuilder toXML() {
// Upcast to NamedElement since we don't want a xmlns attribute
XmlStringBuilder xml = new XmlStringBuilder((NamedElement) this);
xml.attribute("name", name);
xml.rightAngleBracket();
xml.escape(value);
xml.closeElement(this);
return xml;
}
示例3: XmlStringBuilder
import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
public XmlStringBuilder(NamedElement e) {
this();
halfOpenElement(e.getElementName());
}
示例4: halfOpenElement
import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
public XmlStringBuilder halfOpenElement(NamedElement namedElement) {
return halfOpenElement(namedElement.getElementName());
}
示例5: closeElement
import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
public XmlStringBuilder closeElement(NamedElement e) {
closeElement(e.getElementName());
return this;
}
示例6: Data
import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
/**
* Creates Data element.
*
* @param child element nested by Data
*/
public Data(NamedElement child) {
this.child = child;
}
示例7: getChild
import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
/**
* Returns element nested by Data.
*
* @return element nested by Data
*/
public NamedElement getChild() {
return child;
}