当前位置: 首页>>代码示例>>Java>>正文


Java NamedElement类代码示例

本文整理汇总了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;
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:39,代码来源:AbstractHttpOverXmppProvider.java

示例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;
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:11,代码来源:Header.java

示例3: XmlStringBuilder

import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
public XmlStringBuilder(NamedElement e) {
    this();
    halfOpenElement(e.getElementName());
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:5,代码来源:XmlStringBuilder.java

示例4: halfOpenElement

import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
public XmlStringBuilder halfOpenElement(NamedElement namedElement) {
    return halfOpenElement(namedElement.getElementName());
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:4,代码来源:XmlStringBuilder.java

示例5: closeElement

import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
public XmlStringBuilder closeElement(NamedElement e) {
    closeElement(e.getElementName());
    return this;
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:5,代码来源:XmlStringBuilder.java

示例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;
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:9,代码来源:AbstractHttpOverXmpp.java

示例7: getChild

import org.jivesoftware.smack.packet.NamedElement; //导入依赖的package包/类
/**
 * Returns element nested by Data.
 *
 * @return element nested by Data
 */
public NamedElement getChild() {
    return child;
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:9,代码来源:AbstractHttpOverXmpp.java


注:本文中的org.jivesoftware.smack.packet.NamedElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。