Java Code Examples for org.jivesoftware.smack.util.XmlStringBuilder#emptyElement()

The following examples show how to use org.jivesoftware.smack.util.XmlStringBuilder#emptyElement() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SaslNonza.java    From Smack with Apache License 2.0 5 votes vote down vote up
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
    XmlStringBuilder xml = new XmlStringBuilder();
    xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngleBracket();
    xml.emptyElement(saslErrorString);
    addDescriptiveTextsAndExtensions(xml);
    xml.closeElement(ELEMENT);
    return xml;
}
 
Example 2
Source File: Failure.java    From Smack with Apache License 2.0 5 votes vote down vote up
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
    XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
    xml.rightAngleBracket();

    xml.emptyElement(compressFailureError);
    xml.optElement(stanzaError);

    xml.closeElement(this);
    return xml;
}
 
Example 3
Source File: Session.java    From Smack with Apache License 2.0 5 votes vote down vote up
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    if (optional) {
        xml.rightAngleBracket();
        xml.emptyElement(OPTIONAL_ELEMENT);
        xml.closeElement(this);
    } else {
        xml.closeEmptyElement();
    }
    return xml;
}
 
Example 4
Source File: StartTls.java    From Smack with Apache License 2.0 5 votes vote down vote up
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
    XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);

    if (required) {
        xml.rightAngleBracket();
        xml.emptyElement("required");
        xml.closeElement(this);
    } else {
        xml.closeEmptyElement();
    }

    return xml;
}
 
Example 5
Source File: JingleReason.java    From Smack with Apache License 2.0 5 votes vote down vote up
@Override
public XmlStringBuilder toXML(XmlEnvironment enclosingXmlEnvironment) {
    XmlStringBuilder xml = new XmlStringBuilder(this, enclosingXmlEnvironment);
    xml.rightAngleBracket();

    xml.emptyElement(reason);

    xml.closeElement(this);
    return xml;
}
 
Example 6
Source File: SpanElement.java    From Smack with Apache License 2.0 4 votes vote down vote up
@Override
protected void appendInnerXml(XmlStringBuilder xml) {
    for (SpanStyle style : getStyles()) {
        xml.emptyElement(style);
    }
}
 
Example 7
Source File: ValidateElement.java    From Smack with Apache License 2.0 4 votes vote down vote up
@Override
protected void appendXML(XmlStringBuilder buf) {
    buf.emptyElement(METHOD);
}
 
Example 8
Source File: ValidateElement.java    From Smack with Apache License 2.0 4 votes vote down vote up
@Override
protected void appendXML(XmlStringBuilder buf) {
    buf.emptyElement(METHOD);
}