mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 10:19:41 +02:00
Make ExtensionElement marker interface wrt. QNAME field
ExtensionElement is now a marker interface that requires all implementation non-abstract classes to carry a static final QNAME field (of type QName). This is verified by a new unit test. Also FullyQualifiedElement is renamed to simply XmlElement. XmlElement is used over ExtensionElement when implementing classes do not statically know the qualified name of the XML elements they represent. In general, XmlElement should be used sparingly, and every XML element should be modeled by its own Java class (implementing ExtensionElement).
This commit is contained in:
parent
5493a22e44
commit
3d4e7938a7
146 changed files with 600 additions and 344 deletions
|
@ -134,6 +134,7 @@ public class MultipleAddresses implements ExtensionElement {
|
|||
public static final class Address implements ExtensionElement {
|
||||
|
||||
public static final String ELEMENT = "address";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
||||
private final Type type;
|
||||
private Jid jid;
|
||||
|
@ -192,12 +193,12 @@ public class MultipleAddresses implements ExtensionElement {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENT;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return NAMESPACE;
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.attention.packet;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||
|
@ -44,6 +46,8 @@ public class AttentionExtension implements ExtensionElement {
|
|||
*/
|
||||
public static final String NAMESPACE = "urn:xmpp:attention:0";
|
||||
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT_NAME);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -51,7 +55,7 @@ public class AttentionExtension implements ExtensionElement {
|
|||
*/
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENT_NAME;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -61,7 +65,7 @@ public class AttentionExtension implements ExtensionElement {
|
|||
*/
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return NAMESPACE;
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.jivesoftware.smack.packet.ExtensionElement;
|
|||
import org.jivesoftware.smack.packet.StanzaView;
|
||||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
import org.jivesoftware.smackx.bob.BoBData;
|
||||
import org.jivesoftware.smackx.bob.BoBManager;
|
||||
import org.jivesoftware.smackx.bob.ContentId;
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
|||
import org.jivesoftware.smack.util.Pair;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||
|
||||
import org.jivesoftware.smackx.bob.BoBData;
|
||||
import org.jivesoftware.smackx.bob.ContentId;
|
||||
import org.jivesoftware.smackx.bob.element.BoBDataExtension;
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.jivesoftware.smack.util.Pair;
|
|||
import org.jivesoftware.smack.util.ParserUtils;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||
|
||||
import org.jivesoftware.smackx.bob.BoBData;
|
||||
import org.jivesoftware.smackx.bob.ContentId;
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.util.InternetAddress;
|
||||
|
@ -275,7 +277,8 @@ public class Bytestream extends IQ {
|
|||
*/
|
||||
public static class StreamHost extends BytestreamExtensionElement {
|
||||
|
||||
public static String ELEMENTNAME = "streamhost";
|
||||
public static final String ELEMENT = "streamhost";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
||||
private final Jid jid;
|
||||
|
||||
|
@ -344,7 +347,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENTNAME;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -375,7 +378,8 @@ public class Bytestream extends IQ {
|
|||
*/
|
||||
public static class StreamHostUsed extends BytestreamExtensionElement {
|
||||
|
||||
public static String ELEMENTNAME = "streamhost-used";
|
||||
public static final String ELEMENT = "streamhost-used";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
||||
private final Jid jid;
|
||||
|
||||
|
@ -399,7 +403,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENTNAME;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -418,7 +422,8 @@ public class Bytestream extends IQ {
|
|||
*/
|
||||
public static class Activate extends BytestreamExtensionElement {
|
||||
|
||||
public static String ELEMENTNAME = "activate";
|
||||
public static final String ELEMENT = "activate";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
||||
private final Jid target;
|
||||
|
||||
|
@ -442,7 +447,7 @@ public class Bytestream extends IQ {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENTNAME;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -57,15 +57,15 @@ public class BytestreamsProvider extends IQProvider<Bytestream> {
|
|||
eventType = parser.next();
|
||||
elementName = parser.getName();
|
||||
if (eventType == XmlPullParser.Event.START_ELEMENT) {
|
||||
if (elementName.equals(Bytestream.StreamHost.ELEMENTNAME)) {
|
||||
if (elementName.equals(Bytestream.StreamHost.ELEMENT)) {
|
||||
JID = ParserUtils.getJidAttribute(parser);
|
||||
host = parser.getAttributeValue("", "host");
|
||||
port = parser.getAttributeValue("", "port");
|
||||
}
|
||||
else if (elementName.equals(Bytestream.StreamHostUsed.ELEMENTNAME)) {
|
||||
else if (elementName.equals(Bytestream.StreamHostUsed.ELEMENT)) {
|
||||
toReturn.setUsedHost(ParserUtils.getJidAttribute(parser));
|
||||
}
|
||||
else if (elementName.equals(Bytestream.Activate.ELEMENTNAME)) {
|
||||
else if (elementName.equals(Bytestream.Activate.ELEMENT)) {
|
||||
toReturn.setToActivate(ParserUtils.getJidAttribute(parser));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,11 +39,11 @@ import org.jivesoftware.smack.filter.FromTypeFilter;
|
|||
import org.jivesoftware.smack.filter.MessageTypeFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaExtensionFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaFilter;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.MessageBuilder;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.StanzaBuilder;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
import org.jivesoftware.smackx.chatstates.packet.ChatStateExtension;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
|
@ -142,7 +142,7 @@ public final class ChatStateManager extends Manager {
|
|||
EntityBareJid bareFrom = fullFrom.asEntityBareJid();
|
||||
|
||||
final Chat chat = ChatManager.getInstanceFor(connection()).chatWith(bareFrom);
|
||||
ExtensionElement extension = message.getExtension(NAMESPACE);
|
||||
XmlElement extension = message.getExtension(NAMESPACE);
|
||||
String chatStateElementName = extension.getElementName();
|
||||
|
||||
ChatState state;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.jivesoftware.smackx.chatstates.packet;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
import org.jivesoftware.smackx.chatstates.ChatState;
|
||||
|
@ -29,7 +29,7 @@ import org.jivesoftware.smackx.chatstates.ChatState;
|
|||
* @author Alexander Wenckus
|
||||
* @see org.jivesoftware.smackx.chatstates.ChatState
|
||||
*/
|
||||
public class ChatStateExtension implements ExtensionElement {
|
||||
public class ChatStateExtension implements XmlElement {
|
||||
|
||||
public static final String NAMESPACE = "http://jabber.org/protocol/chatstates";
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ package org.jivesoftware.smackx.commands.packet;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
import org.jivesoftware.smackx.commands.AdHocCommand;
|
||||
import org.jivesoftware.smackx.commands.AdHocCommand.Action;
|
||||
|
@ -240,7 +240,7 @@ public class AdHocCommandData extends IQ {
|
|||
return sessionID;
|
||||
}
|
||||
|
||||
public static class SpecificError implements ExtensionElement {
|
||||
public static class SpecificError implements XmlElement {
|
||||
|
||||
public static final String namespace = "http://jabber.org/protocol/commands";
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.logging.Logger;
|
|||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.util.XmlUtil;
|
||||
|
||||
import org.jivesoftware.smackx.xdata.FormField;
|
||||
import org.jivesoftware.smackx.xdata.TextSingleFormField;
|
||||
import org.jivesoftware.smackx.xdata.packet.DataForm;
|
||||
|
|
|
@ -22,8 +22,8 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
|
@ -39,7 +39,7 @@ public class RegistrationProvider extends IQProvider<Registration> {
|
|||
public Registration parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||
String instruction = null;
|
||||
Map<String, String> fields = new HashMap<>();
|
||||
List<ExtensionElement> packetExtensions = new LinkedList<>();
|
||||
List<XmlElement> packetExtensions = new LinkedList<>();
|
||||
outerloop:
|
||||
while (true) {
|
||||
XmlPullParser.Event eventType = parser.next();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.element;
|
||||
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
@ -25,7 +25,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
/**
|
||||
* Jingle content element.
|
||||
*/
|
||||
public final class JingleContent implements FullyQualifiedElement {
|
||||
public final class JingleContent implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "content";
|
||||
public static final String NAMESPACE = Jingle.NAMESPACE;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017 Florian Schmaus.
|
||||
* Copyright 2017-2021 Florian Schmaus.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -19,15 +19,15 @@ package org.jivesoftware.smackx.jingle.element;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.NamedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
/**
|
||||
* Jingle content description.
|
||||
*
|
||||
*/
|
||||
public abstract class JingleContentDescription implements ExtensionElement {
|
||||
public abstract class JingleContentDescription implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "description";
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.element;
|
||||
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
/**
|
||||
* An element found usually in 'description' elements.
|
||||
*
|
||||
*/
|
||||
public interface JingleContentDescriptionChildElement extends FullyQualifiedElement {
|
||||
public interface JingleContentDescriptionChildElement extends XmlElement {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017-2019 Florian Schmaus
|
||||
* Copyright 2017-2021 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.jingle.element;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
|
@ -27,7 +27,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
* A jingle transport extension.
|
||||
*
|
||||
*/
|
||||
public abstract class JingleContentTransport implements ExtensionElement {
|
||||
public abstract class JingleContentTransport implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "transport";
|
||||
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.element;
|
||||
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
/**
|
||||
* An element found usually in Jingle 'transport' elements.
|
||||
*
|
||||
*/
|
||||
public abstract class JingleContentTransportCandidate implements FullyQualifiedElement {
|
||||
public abstract class JingleContentTransportCandidate implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "candidate";
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.element;
|
||||
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
/**
|
||||
* Abstract JingleContentTransportInfo element.
|
||||
*/
|
||||
public interface JingleContentTransportInfo extends FullyQualifiedElement {
|
||||
public interface JingleContentTransportInfo extends XmlElement {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2003-2005 Jive Software, 2017 Florian Schmaus.
|
||||
* Copyright 2003-2005 Jive Software, 2017-2021 Florian Schmaus.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -19,10 +19,10 @@ package org.jivesoftware.smackx.jingle.element;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
public final class JingleError implements ExtensionElement {
|
||||
public final class JingleError implements XmlElement {
|
||||
|
||||
public static String NAMESPACE = "urn:xmpp:jingle:errors:1";
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.jingle.element;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
@ -30,7 +30,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
* @see <a href="https://xmpp.org/extensions/xep-0166.html#def-reason">XEP-0166 § 7.4</a>
|
||||
*
|
||||
*/
|
||||
public class JingleReason implements FullyQualifiedElement {
|
||||
public class JingleReason implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "reason";
|
||||
public static final String NAMESPACE = Jingle.NAMESPACE;
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.transports.jingle_ibb.element;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
|
@ -24,8 +27,10 @@ import org.jivesoftware.smackx.jingle.element.JingleContentTransport;
|
|||
/**
|
||||
* Transport Element for JingleInBandBytestream transports.
|
||||
*/
|
||||
public class JingleIBBTransport extends JingleContentTransport {
|
||||
public class JingleIBBTransport extends JingleContentTransport implements ExtensionElement {
|
||||
public static final String NAMESPACE_V1 = "urn:xmpp:jingle:transports:ibb:1";
|
||||
public static final QName QNAME = new QName(NAMESPACE_V1, ELEMENT);
|
||||
|
||||
public static final String ATTR_BLOCK_SIZE = "block-size";
|
||||
public static final String ATTR_SID = "sid";
|
||||
|
||||
|
@ -72,7 +77,7 @@ public class JingleIBBTransport extends JingleContentTransport {
|
|||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return NAMESPACE_V1;
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,6 +19,9 @@ package org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
|
@ -30,12 +33,14 @@ import org.jivesoftware.smackx.jingle.element.JingleContentTransportInfo;
|
|||
/**
|
||||
* Socks5Bytestream transport element.
|
||||
*/
|
||||
public class JingleS5BTransport extends JingleContentTransport {
|
||||
public class JingleS5BTransport extends JingleContentTransport implements ExtensionElement {
|
||||
public static final String NAMESPACE_V1 = "urn:xmpp:jingle:transports:s5b:1";
|
||||
public static final String ATTR_DSTADDR = "dstaddr";
|
||||
public static final String ATTR_MODE = "mode";
|
||||
public static final String ATTR_SID = "sid";
|
||||
|
||||
public static final QName QNAME = new QName(NAMESPACE_V1, ELEMENT);
|
||||
|
||||
private final String streamId;
|
||||
private final String dstAddr;
|
||||
private final Bytestream.Mode mode;
|
||||
|
@ -62,7 +67,7 @@ public class JingleS5BTransport extends JingleContentTransport {
|
|||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return NAMESPACE_V1;
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.List;
|
|||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.datatypes.UInt16;
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
@ -130,7 +130,7 @@ public class MediaElement implements FormFieldChildElement {
|
|||
}
|
||||
}
|
||||
|
||||
public static final class Uri implements FullyQualifiedElement {
|
||||
public static final class Uri implements XmlElement {
|
||||
public static final String ELEMENT = "uri";
|
||||
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
|
|
@ -19,9 +19,9 @@ package org.jivesoftware.smackx.mood.element;
|
|||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.NamedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
@ -158,7 +158,7 @@ public class MoodElement implements ExtensionElement {
|
|||
* {@link NamedElement} which represents the mood.
|
||||
* This element has the element name of the mood selected from {@link Mood}.
|
||||
*/
|
||||
public static class MoodSubjectElement implements FullyQualifiedElement {
|
||||
public static class MoodSubjectElement implements XmlElement {
|
||||
|
||||
private final Mood mood;
|
||||
private final MoodConcretisation concretisation;
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.jivesoftware.smack.packet.XmlEnvironment;
|
|||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||
|
||||
import org.jivesoftware.smackx.offline.OfflineMessageManager;
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.jivesoftware.smack.packet.XmlEnvironment;
|
|||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||
|
||||
import org.jivesoftware.smackx.offline.OfflineMessageManager;
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.jivesoftware.smackx.pubsub;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
@ -36,7 +36,7 @@ import org.jxmpp.jid.BareJid;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class Affiliation implements ExtensionElement {
|
||||
public class Affiliation implements XmlElement {
|
||||
public static final String ELEMENT = "affiliation";
|
||||
|
||||
public enum AffiliationNamespace {
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.form.FilledConfigureForm;
|
||||
|
||||
|
@ -48,10 +48,10 @@ public class ConfigurationEvent extends NodeExtension implements EmbeddedPacketE
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ExtensionElement> getExtensions() {
|
||||
public List<XmlElement> getExtensions() {
|
||||
if (getConfiguration() == null)
|
||||
return Collections.emptyList();
|
||||
else
|
||||
return Arrays.asList((ExtensionElement) getConfiguration().getDataForm());
|
||||
return Arrays.asList((XmlElement) getConfiguration().getDataForm());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||
|
||||
/**
|
||||
|
@ -37,11 +38,11 @@ import org.jivesoftware.smack.util.PacketParserUtils;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public interface EmbeddedPacketExtension extends ExtensionElement {
|
||||
public interface EmbeddedPacketExtension extends XmlElement {
|
||||
/**
|
||||
* Get the list of embedded {@link ExtensionElement} objects.
|
||||
*
|
||||
* @return List of embedded {@link ExtensionElement}
|
||||
*/
|
||||
List<ExtensionElement> getExtensions();
|
||||
List<XmlElement> getExtensions();
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import javax.xml.namespace.QName;
|
|||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
||||
|
@ -35,7 +36,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class EventElement implements EmbeddedPacketExtension {
|
||||
public class EventElement implements EmbeddedPacketExtension, ExtensionElement {
|
||||
/**
|
||||
* The constant String "event".
|
||||
*/
|
||||
|
@ -61,8 +62,8 @@ public class EventElement implements EmbeddedPacketExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ExtensionElement> getExtensions() {
|
||||
return Arrays.asList(new ExtensionElement[] {getEvent()});
|
||||
public List<XmlElement> getExtensions() {
|
||||
return Arrays.asList(new XmlElement[] {getEvent()});
|
||||
}
|
||||
|
||||
public NodeExtension getEvent() {
|
||||
|
@ -71,12 +72,12 @@ public class EventElement implements EmbeddedPacketExtension {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return "event";
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return PubSubNamespace.event.getXmlns();
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.NamedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
/**
|
||||
|
@ -127,8 +128,8 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ExtensionElement> getExtensions() {
|
||||
return (List<ExtensionElement>) getItems();
|
||||
public List<XmlElement> getExtensions() {
|
||||
return (List<XmlElement>) getItems();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.util.List;
|
|||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
|
||||
import org.jivesoftware.smackx.pubsub.form.ConfigureForm;
|
||||
|
@ -71,7 +71,7 @@ public class LeafNode extends Node {
|
|||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
*/
|
||||
public <T extends Item> List<T> getItems() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return getItems((List<ExtensionElement>) null, null);
|
||||
return getItems((List<XmlElement>) null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -177,8 +177,8 @@ public class LeafNode extends Node {
|
|||
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
*/
|
||||
public <T extends Item> List<T> getItems(List<ExtensionElement> additionalExtensions,
|
||||
List<ExtensionElement> returnedExtensions) throws NoResponseException,
|
||||
public <T extends Item> List<T> getItems(List<XmlElement> additionalExtensions,
|
||||
List<XmlElement> returnedExtensions) throws NoResponseException,
|
||||
XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
PubSub request = createPubsubPacket(IQ.Type.get, new GetItemsRequest(getId()));
|
||||
request.addExtensions(additionalExtensions);
|
||||
|
@ -192,7 +192,7 @@ public class LeafNode extends Node {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T extends Item> List<T> getItems(PubSub request,
|
||||
List<ExtensionElement> returnedExtensions) throws NoResponseException,
|
||||
List<XmlElement> returnedExtensions) throws NoResponseException,
|
||||
XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
PubSub result = pubSubManager.getConnection().createStanzaCollectorAndSend(request).nextResultOrThrow();
|
||||
ItemsExtension itemsElem = result.getExtension(PubSubElementType.ITEMS);
|
||||
|
|
|
@ -28,10 +28,10 @@ import org.jivesoftware.smack.XMPPConnection;
|
|||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.filter.FlexibleStanzaTypeFilter;
|
||||
import org.jivesoftware.smack.filter.OrFilter;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
import org.jivesoftware.smackx.delay.DelayInformationManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
|
@ -163,7 +163,7 @@ public abstract class Node {
|
|||
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
*/
|
||||
public List<Subscription> getSubscriptions(List<ExtensionElement> additionalExtensions, Collection<ExtensionElement> returnedExtensions)
|
||||
public List<Subscription> getSubscriptions(List<XmlElement> additionalExtensions, Collection<XmlElement> returnedExtensions)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return getSubscriptions(SubscriptionsNamespace.basic, additionalExtensions, returnedExtensions);
|
||||
}
|
||||
|
@ -207,20 +207,20 @@ public abstract class Node {
|
|||
* Retrieve Subscriptions List</a>
|
||||
* @since 4.1
|
||||
*/
|
||||
public List<Subscription> getSubscriptionsAsOwner(List<ExtensionElement> additionalExtensions,
|
||||
Collection<ExtensionElement> returnedExtensions) throws NoResponseException, XMPPErrorException,
|
||||
public List<Subscription> getSubscriptionsAsOwner(List<XmlElement> additionalExtensions,
|
||||
Collection<XmlElement> returnedExtensions) throws NoResponseException, XMPPErrorException,
|
||||
NotConnectedException, InterruptedException {
|
||||
return getSubscriptions(SubscriptionsNamespace.owner, additionalExtensions, returnedExtensions);
|
||||
}
|
||||
|
||||
private List<Subscription> getSubscriptions(SubscriptionsNamespace subscriptionsNamespace, List<ExtensionElement> additionalExtensions,
|
||||
Collection<ExtensionElement> returnedExtensions)
|
||||
private List<Subscription> getSubscriptions(SubscriptionsNamespace subscriptionsNamespace, List<XmlElement> additionalExtensions,
|
||||
Collection<XmlElement> returnedExtensions)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
PubSubElementType pubSubElementType = subscriptionsNamespace.type;
|
||||
|
||||
PubSub pubSub = createPubsubPacket(IQ.Type.get, new NodeExtension(pubSubElementType, getId()));
|
||||
if (additionalExtensions != null) {
|
||||
for (ExtensionElement pe : additionalExtensions) {
|
||||
for (XmlElement pe : additionalExtensions) {
|
||||
pubSub.addExtension(pe);
|
||||
}
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ public abstract class Node {
|
|||
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
*/
|
||||
public List<Affiliation> getAffiliations(List<ExtensionElement> additionalExtensions, Collection<ExtensionElement> returnedExtensions)
|
||||
public List<Affiliation> getAffiliations(List<XmlElement> additionalExtensions, Collection<XmlElement> returnedExtensions)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
|
||||
return getAffiliations(AffiliationNamespace.basic, additionalExtensions, returnedExtensions);
|
||||
|
@ -326,20 +326,20 @@ public abstract class Node {
|
|||
* @see <a href="http://www.xmpp.org/extensions/xep-0060.html#owner-affiliations-retrieve">XEP-60 § 8.9.1 Retrieve Affiliations List</a>
|
||||
* @since 4.2
|
||||
*/
|
||||
public List<Affiliation> getAffiliationsAsOwner(List<ExtensionElement> additionalExtensions, Collection<ExtensionElement> returnedExtensions)
|
||||
public List<Affiliation> getAffiliationsAsOwner(List<XmlElement> additionalExtensions, Collection<XmlElement> returnedExtensions)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
|
||||
return getAffiliations(AffiliationNamespace.owner, additionalExtensions, returnedExtensions);
|
||||
}
|
||||
|
||||
private List<Affiliation> getAffiliations(AffiliationNamespace affiliationsNamespace, List<ExtensionElement> additionalExtensions,
|
||||
Collection<ExtensionElement> returnedExtensions) throws NoResponseException, XMPPErrorException,
|
||||
private List<Affiliation> getAffiliations(AffiliationNamespace affiliationsNamespace, List<XmlElement> additionalExtensions,
|
||||
Collection<XmlElement> returnedExtensions) throws NoResponseException, XMPPErrorException,
|
||||
NotConnectedException, InterruptedException {
|
||||
PubSubElementType pubSubElementType = affiliationsNamespace.type;
|
||||
|
||||
PubSub pubSub = createPubsubPacket(IQ.Type.get, new NodeExtension(pubSubElementType, getId()));
|
||||
if (additionalExtensions != null) {
|
||||
for (ExtensionElement pe : additionalExtensions) {
|
||||
for (XmlElement pe : additionalExtensions) {
|
||||
pubSub.addExtension(pe);
|
||||
}
|
||||
}
|
||||
|
@ -717,7 +717,7 @@ public abstract class Node {
|
|||
// CHECKSTYLE:OFF
|
||||
EventElement event = (EventElement) packet.getExtensionElement("event", PubSubNamespace.event.getXmlns());
|
||||
|
||||
List<ExtensionElement> extList = event.getExtensions();
|
||||
List<XmlElement> extList = event.getExtensions();
|
||||
|
||||
if (extList.get(0).getElementName().equals(PubSubElementType.PURGE_EVENT.getElementName())) {
|
||||
listener.handlePurge();
|
||||
|
@ -804,7 +804,7 @@ public abstract class Node {
|
|||
return true;
|
||||
|
||||
if (embedEvent instanceof EmbeddedPacketExtension) {
|
||||
List<ExtensionElement> secondLevelList = ((EmbeddedPacketExtension) embedEvent).getExtensions();
|
||||
List<XmlElement> secondLevelList = ((EmbeddedPacketExtension) embedEvent).getExtensions();
|
||||
|
||||
// XEP-0060 allows no elements on second level for notifications. See schema or
|
||||
// for example § 4.3:
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.pubsub;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class NodeExtension implements ExtensionElement {
|
||||
public class NodeExtension implements XmlElement {
|
||||
private final PubSubElementType element;
|
||||
private final String node;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.form.ConfigureForm;
|
||||
|
@ -55,7 +56,7 @@ import org.jivesoftware.smackx.pubsub.provider.ItemProvider;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class PayloadItem<E extends ExtensionElement> extends Item {
|
||||
public class PayloadItem<E extends XmlElement> extends Item {
|
||||
private final E payload;
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,11 +33,11 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
|||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.packet.EmptyResultIQ;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.StanzaError;
|
||||
import org.jivesoftware.smack.packet.StanzaError.Condition;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
|
@ -643,7 +643,7 @@ public final class PubSubManager extends Manager {
|
|||
return true;
|
||||
}
|
||||
|
||||
private PubSub sendPubsubPacket(IQ.Type type, ExtensionElement ext, PubSubNamespace ns)
|
||||
private PubSub sendPubsubPacket(IQ.Type type, XmlElement ext, PubSubNamespace ns)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return sendPubsubPacket(pubSubService, type, Collections.singletonList(ext), ns);
|
||||
}
|
||||
|
@ -652,12 +652,12 @@ public final class PubSubManager extends Manager {
|
|||
return connection();
|
||||
}
|
||||
|
||||
PubSub sendPubsubPacket(Jid to, IQ.Type type, List<ExtensionElement> extList, PubSubNamespace ns)
|
||||
PubSub sendPubsubPacket(Jid to, IQ.Type type, List<XmlElement> extList, PubSubNamespace ns)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException,
|
||||
InterruptedException {
|
||||
// CHECKSTYLE:OFF
|
||||
PubSub pubSub = new PubSub(to, type, ns);
|
||||
for (ExtensionElement pe : extList) {
|
||||
for (XmlElement pe : extList) {
|
||||
pubSub.addExtension(pe);
|
||||
}
|
||||
// CHECKSTYLE:ON
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.pubsub;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
||||
|
@ -26,6 +28,8 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
|||
* @author Robin Collier
|
||||
*/
|
||||
public class RetractItem implements ExtensionElement {
|
||||
public static final QName QNAME = new QName(PubSubNamespace.event.getXmlns(), "retract");
|
||||
|
||||
private final String id;
|
||||
|
||||
/**
|
||||
|
@ -45,12 +49,12 @@ public class RetractItem implements ExtensionElement {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return "retract";
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return PubSubNamespace.event.getXmlns();
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.io.IOException;
|
|||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
|
@ -32,7 +32,7 @@ import org.jivesoftware.smack.xml.XmlPullParserException;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class SimplePayload implements ExtensionElement {
|
||||
public class SimplePayload implements XmlElement {
|
||||
private final String elemName;
|
||||
private final String ns;
|
||||
private final String payload;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.pubsub.packet;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.NodeExtension;
|
||||
import org.jivesoftware.smackx.pubsub.PubSubElementType;
|
||||
|
@ -50,7 +50,7 @@ public class PubSub extends IQ {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <PE extends ExtensionElement> PE getExtension(PubSubElementType elem) {
|
||||
public <PE extends XmlElement> PE getExtension(PubSubElementType elem) {
|
||||
return (PE) getExtensionElement(elem.getElementName(), elem.getNamespace().getXmlns());
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.Affiliation;
|
||||
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.pubsub.AffiliationsExtension;
|
|||
*/public class AffiliationsProvider extends EmbeddedExtensionProvider<AffiliationsExtension> {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected AffiliationsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content) {
|
||||
protected AffiliationsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends XmlElement> content) {
|
||||
AffiliationNamespace affiliationsNamespace = AffiliationNamespace.fromXmlns(currentNamespace);
|
||||
return new AffiliationsExtension(affiliationsNamespace, (List<Affiliation>) content);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.ConfigurationEvent;
|
||||
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.xdata.packet.DataForm;
|
|||
*/
|
||||
public class ConfigEventProvider extends EmbeddedExtensionProvider<ConfigurationEvent> {
|
||||
@Override
|
||||
protected ConfigurationEvent createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends ExtensionElement> content) {
|
||||
protected ConfigurationEvent createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends XmlElement> content) {
|
||||
if (content.size() == 0)
|
||||
return new ConfigurationEvent(attMap.get("node"));
|
||||
else
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.EventElement;
|
||||
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.pubsub.NodeExtension;
|
|||
*/
|
||||
public class EventProvider extends EmbeddedExtensionProvider<EventElement> {
|
||||
@Override
|
||||
protected EventElement createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends ExtensionElement> content) {
|
||||
protected EventElement createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends XmlElement> content) {
|
||||
// TODO: Shouldn't be an embedded extension provider.
|
||||
return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension) content.get(0));
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.FormNode;
|
||||
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.xdata.packet.DataForm;
|
|||
*/
|
||||
public class FormNodeProvider extends EmbeddedExtensionProvider<FormNode> {
|
||||
@Override
|
||||
protected FormNode createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content) {
|
||||
protected FormNode createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends XmlElement> content) {
|
||||
return new FormNode(FormNodeType.valueOfFromElementName(currentElement, currentNamespace), attributeMap.get("node"), (DataForm) content.iterator().next());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.ItemsExtension;
|
||||
|
@ -33,7 +33,7 @@ import org.jivesoftware.smackx.pubsub.ItemsExtension;
|
|||
public class ItemsProvider extends EmbeddedExtensionProvider<ItemsExtension> {
|
||||
|
||||
@Override
|
||||
protected ItemsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content) {
|
||||
protected ItemsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends XmlElement> content) {
|
||||
return new ItemsExtension(ItemsExtension.ItemsElementType.items, attributeMap.get("node"), content);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.RetractItem;
|
||||
|
@ -33,7 +33,7 @@ import org.jivesoftware.smackx.pubsub.RetractItem;
|
|||
*/
|
||||
public class RetractEventProvider extends EmbeddedExtensionProvider<RetractItem> {
|
||||
@Override
|
||||
protected RetractItem createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content) {
|
||||
protected RetractItem createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends XmlElement> content) {
|
||||
return new RetractItem(attributeMap.get("id"));
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.NodeExtension;
|
||||
|
@ -33,7 +33,7 @@ import org.jivesoftware.smackx.pubsub.PubSubElementType;
|
|||
*/
|
||||
public class SimpleNodeProvider extends EmbeddedExtensionProvider<NodeExtension> {
|
||||
@Override
|
||||
protected NodeExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content) {
|
||||
protected NodeExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends XmlElement> content) {
|
||||
return new NodeExtension(PubSubElementType.valueOfFromElemName(currentElement, currentNamespace), attributeMap.get("node"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.pubsub.Subscription;
|
||||
|
@ -35,7 +35,7 @@ import org.jivesoftware.smackx.pubsub.SubscriptionsExtension.SubscriptionsNamesp
|
|||
public class SubscriptionsProvider extends EmbeddedExtensionProvider<SubscriptionsExtension> {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected SubscriptionsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content) {
|
||||
protected SubscriptionsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends XmlElement> content) {
|
||||
SubscriptionsNamespace subscriptionsNamespace = SubscriptionsNamespace.fromXmlns(currentNamespace);
|
||||
String nodeId = attributeMap.get("node");
|
||||
return new SubscriptionsExtension(subscriptionsNamespace, nodeId, (List<Subscription>) content);
|
||||
|
|
|
@ -23,6 +23,7 @@ import javax.xml.namespace.QName;
|
|||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
|
@ -102,7 +103,7 @@ public class DeliveryReceipt implements ExtensionElement {
|
|||
|
||||
@Override
|
||||
protected DeliveryReceipt createReturnExtension(String currentElement, String currentNamespace,
|
||||
Map<String, String> attributeMap, List<? extends ExtensionElement> content) {
|
||||
Map<String, String> attributeMap, List<? extends XmlElement> content) {
|
||||
return new DeliveryReceipt(attributeMap.get("id"));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright © 2014 Florian Schmaus
|
||||
* Copyright © 2014-2021 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -20,7 +20,7 @@ import java.util.Collection;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.util.PacketUtil;
|
||||
|
||||
import org.jivesoftware.smackx.rsm.packet.RSMSet;
|
||||
|
@ -28,19 +28,19 @@ import org.jivesoftware.smackx.rsm.packet.RSMSet.PageDirection;
|
|||
|
||||
public class RSMManager {
|
||||
|
||||
Collection<ExtensionElement> page(int max) {
|
||||
List<ExtensionElement> packetExtensions = new LinkedList<>();
|
||||
Collection<XmlElement> page(int max) {
|
||||
List<XmlElement> packetExtensions = new LinkedList<>();
|
||||
packetExtensions.add(new RSMSet(max));
|
||||
return packetExtensions;
|
||||
}
|
||||
|
||||
Collection<ExtensionElement> continuePage(int max, Collection<ExtensionElement> returnedExtensions) {
|
||||
Collection<XmlElement> continuePage(int max, Collection<XmlElement> returnedExtensions) {
|
||||
return continuePage(max, returnedExtensions, null);
|
||||
}
|
||||
|
||||
Collection<ExtensionElement> continuePage(int max,
|
||||
Collection<ExtensionElement> returnedExtensions,
|
||||
Collection<ExtensionElement> additionalExtensions) {
|
||||
Collection<XmlElement> continuePage(int max,
|
||||
Collection<XmlElement> returnedExtensions,
|
||||
Collection<XmlElement> additionalExtensions) {
|
||||
if (returnedExtensions == null) {
|
||||
throw new IllegalArgumentException("returnedExtensions must no be null");
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.shim.packet;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.NamedElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
@ -27,6 +29,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
*/
|
||||
public class Header implements ExtensionElement {
|
||||
public static final String ELEMENT = "header";
|
||||
public static final QName QNAME = new QName(HeadersExtension.NAMESPACE, ELEMENT);
|
||||
|
||||
private final String name;
|
||||
private final String value;
|
||||
|
@ -46,12 +49,12 @@ public class Header implements ExtensionElement {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENT;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return HeadersExtension.NAMESPACE;
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.shim.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
|
||||
import org.jivesoftware.smackx.shim.packet.Header;
|
||||
|
@ -36,7 +36,7 @@ public class HeadersProvider extends EmbeddedExtensionProvider<HeadersExtension>
|
|||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected HeadersExtension createReturnExtension(String currentElement, String currentNamespace,
|
||||
Map<String, String> attributeMap, List<? extends ExtensionElement> content) {
|
||||
Map<String, String> attributeMap, List<? extends XmlElement> content) {
|
||||
return new HeadersExtension((List<Header>) content);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ package org.jivesoftware.smackx.si.packet;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
@ -196,6 +198,10 @@ public class StreamInitiation extends IQ {
|
|||
*/
|
||||
public static class File implements ExtensionElement {
|
||||
|
||||
public static final String ELEMENT = "file";
|
||||
public static final String NAMESPACE = "http://jabber.org/protocol/si/profile/file-transfer";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
||||
private final String name;
|
||||
|
||||
private final long size;
|
||||
|
@ -318,12 +324,12 @@ public class StreamInitiation extends IQ {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return "file";
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return "http://jabber.org/protocol/si/profile/file-transfer";
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -374,6 +380,8 @@ public class StreamInitiation extends IQ {
|
|||
*/
|
||||
public static class Feature implements ExtensionElement {
|
||||
|
||||
public static final QName QNAME = new QName("http://jabber.org/protocol/feature-neg", "feature");
|
||||
|
||||
private final DataForm data;
|
||||
|
||||
/**
|
||||
|
@ -395,13 +403,13 @@ public class StreamInitiation extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return "http://jabber.org/protocol/feature-neg";
|
||||
public String getElementName() {
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return "feature";
|
||||
public String getNamespace() {
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.jivesoftware.smack.SmackException.NoResponseException;
|
|||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.softwareinfo.form.SoftwareInfoForm;
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
|
||||
import org.jivesoftware.smack.util.EqualsUtil;
|
||||
import org.jivesoftware.smack.util.HashCode;
|
||||
|
||||
import org.jivesoftware.smackx.mediaelement.element.MediaElement;
|
||||
import org.jivesoftware.smackx.xdata.FormField;
|
||||
import org.jivesoftware.smackx.xdata.FormFieldChildElement;
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.List;
|
|||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.CollectionUtil;
|
||||
import org.jivesoftware.smack.util.EqualsUtil;
|
||||
|
@ -51,7 +51,7 @@ import org.jxmpp.util.XmppDateTime;
|
|||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public abstract class FormField implements FullyQualifiedElement {
|
||||
public abstract class FormField implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "field";
|
||||
|
||||
|
@ -381,7 +381,7 @@ public abstract class FormField implements FullyQualifiedElement {
|
|||
return QNAME;
|
||||
}
|
||||
|
||||
protected transient List<FullyQualifiedElement> extraXmlChildElements;
|
||||
protected transient List<XmlElement> extraXmlChildElements;
|
||||
|
||||
protected void populateExtraXmlChildElements() {
|
||||
List<? extends CharSequence> values = getValues();
|
||||
|
@ -709,7 +709,7 @@ public abstract class FormField implements FullyQualifiedElement {
|
|||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public static final class Option implements FullyQualifiedElement {
|
||||
public static final class Option implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "option";
|
||||
|
||||
|
@ -892,7 +892,7 @@ public abstract class FormField implements FullyQualifiedElement {
|
|||
}
|
||||
}
|
||||
|
||||
public static class Value implements FullyQualifiedElement {
|
||||
public static class Value implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "value";
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.xdata;
|
||||
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
|
||||
public interface FormFieldChildElement extends FullyQualifiedElement {
|
||||
public interface FormFieldChildElement extends XmlElement {
|
||||
|
||||
default boolean isExclusiveElement() {
|
||||
return false;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2014 Anno van Vliet, 2019 Florian Schmaus
|
||||
* Copyright 2014 Anno van Vliet, 2019-2021 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -19,6 +19,8 @@ package org.jivesoftware.smackx.xdatalayout.packet;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
|
@ -105,6 +107,8 @@ public class DataLayout implements ExtensionElement {
|
|||
public static class Fieldref extends DataFormLayoutElement{
|
||||
|
||||
public static final String ELEMENT = "fieldref";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
||||
private final String var;
|
||||
|
||||
/**
|
||||
|
@ -142,6 +146,7 @@ public class DataLayout implements ExtensionElement {
|
|||
public static class Section extends DataFormLayoutElement{
|
||||
|
||||
public static final String ELEMENT = "section";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
private final List<DataFormLayoutElement> sectionLayout = new ArrayList<>();
|
||||
private final String label;
|
||||
|
||||
|
@ -206,6 +211,7 @@ public class DataLayout implements ExtensionElement {
|
|||
public static class Reportedref extends DataFormLayoutElement{
|
||||
|
||||
public static final String ELEMENT = "reportedref";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
|
@ -223,6 +229,7 @@ public class DataLayout implements ExtensionElement {
|
|||
|
||||
public static class Text extends DataFormLayoutElement{
|
||||
public static final String ELEMENT = "text";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
private final String text;
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.math.BigInteger;
|
|||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.datatypes.UInt32;
|
||||
import org.jivesoftware.smack.packet.FullyQualifiedElement;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
@ -374,7 +374,7 @@ public abstract class ValidateElement implements FormFieldChildElement {
|
|||
* This element indicates for "list-multi", that a minimum and maximum number of options should be selected and/or
|
||||
* entered.
|
||||
*/
|
||||
public static class ListRange implements FullyQualifiedElement {
|
||||
public static class ListRange implements XmlElement {
|
||||
|
||||
public static final String ELEMENT = "list-range";
|
||||
private final UInt32 min;
|
||||
|
|
|
@ -21,9 +21,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.jivesoftware.smack.ThreadedDummyConnection;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.NamedElement;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.XmlElement;
|
||||
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
|
@ -102,7 +102,7 @@ public class ItemValidationTest extends SmackTestSuite {
|
|||
"</message>");
|
||||
|
||||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
ExtensionElement eventExt = message.getExtension(PubSubNamespace.event.getXmlns());
|
||||
XmlElement eventExt = message.getExtension(PubSubNamespace.event.getXmlns());
|
||||
|
||||
assertTrue(eventExt instanceof EventElement);
|
||||
EventElement event = (EventElement) eventExt;
|
||||
|
@ -132,7 +132,7 @@ public class ItemValidationTest extends SmackTestSuite {
|
|||
"</message>");
|
||||
|
||||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
ExtensionElement eventExt = message.getExtension(PubSubNamespace.event.getXmlns());
|
||||
XmlElement eventExt = message.getExtension(PubSubNamespace.event.getXmlns());
|
||||
EventElement event = (EventElement) eventExt;
|
||||
NamedElement itemExt = ((ItemsExtension) event.getExtensions().get(0)).items.get(0);
|
||||
|
||||
|
@ -178,7 +178,7 @@ public class ItemValidationTest extends SmackTestSuite {
|
|||
"</message>");
|
||||
|
||||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
ExtensionElement eventExt = message.getExtension(PubSubNamespace.event.getXmlns());
|
||||
XmlElement eventExt = message.getExtension(PubSubNamespace.event.getXmlns());
|
||||
EventElement event = (EventElement) eventExt;
|
||||
NamedElement itemExt = ((ItemsExtension) event.getExtensions().get(0)).items.get(0);
|
||||
|
||||
|
@ -210,7 +210,7 @@ public class ItemValidationTest extends SmackTestSuite {
|
|||
"</message>");
|
||||
|
||||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
ExtensionElement eventExt = message.getExtension(PubSubNamespace.event.getXmlns());
|
||||
XmlElement eventExt = message.getExtension(PubSubNamespace.event.getXmlns());
|
||||
|
||||
assertTrue(eventExt instanceof EventElement);
|
||||
EventElement event = (EventElement) eventExt;
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.net.URI;
|
|||
import java.net.URISyntaxException;
|
||||
|
||||
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
||||
|
||||
import org.jivesoftware.smackx.mediaelement.element.MediaElement;
|
||||
import org.jivesoftware.smackx.softwareinfo.form.SoftwareInfoForm;
|
||||
import org.jivesoftware.smackx.xdata.FormField;
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.jivesoftware.smack.parsing.SmackParsingException;
|
|||
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||
|
||||
import org.jivesoftware.smackx.xdata.FormField;
|
||||
import org.jivesoftware.smackx.xdata.packet.DataForm;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue