mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-14 23:11:08 +01:00
Bump ErrorProne to 2.5.1 and refactor Providers a bit
This also resulted in a refactoring of the Providers and parsing Exceptions. NumberFormatException and ParseException can now be thrown directly, the wrapping in a SmackParsingException is down at a higher layer, i.e. in AbstractProvider.
This commit is contained in:
parent
1df0763f92
commit
a7b3303f3e
136 changed files with 574 additions and 551 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2013-2014 Georg Lukas, 2020 Florian Schmaus.
|
||||
* Copyright 2013-2014 Georg Lukas, 2020-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.
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
package org.jivesoftware.smackx.carbons.provider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
|
|
@ -40,7 +41,8 @@ import org.jivesoftware.smackx.forward.provider.ForwardedProvider;
|
|||
public class CarbonManagerProvider extends ExtensionElementProvider<CarbonExtension> {
|
||||
|
||||
@Override
|
||||
public CarbonExtension parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||
public CarbonExtension parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||
throws XmlPullParserException, IOException, SmackParsingException, ParseException {
|
||||
Direction dir = Direction.valueOf(parser.getName());
|
||||
Forwarded<Message> fwd = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2019 Florian Schmaus
|
||||
* Copyright 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.
|
||||
|
|
@ -31,7 +31,6 @@ import org.jivesoftware.smack.iqrequest.IQRequestHandler.Mode;
|
|||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.StanzaError;
|
||||
import org.jivesoftware.smack.packet.StanzaError.Condition;
|
||||
import org.jivesoftware.smack.packet.StanzaError.Type;
|
||||
import org.jivesoftware.smack.util.RandomUtil;
|
||||
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
|
|
@ -89,7 +88,7 @@ public final class DnsOverXmppManager extends Manager {
|
|||
response = resolver.resolve(query);
|
||||
} catch (IOException exception) {
|
||||
StanzaError errorBuilder = StanzaError.getBuilder()
|
||||
.setType(Type.CANCEL)
|
||||
.setType(StanzaError.Type.CANCEL)
|
||||
.setCondition(Condition.internal_server_error)
|
||||
.setDescriptiveEnText("Exception while resolving your DNS query", exception)
|
||||
.build()
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import java.net.HttpURLConnection;
|
|||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.logging.Level;
|
||||
|
|
@ -437,7 +436,7 @@ public final class HttpFileUploadManager extends Manager {
|
|||
urlConnection.setDoOutput(true);
|
||||
urlConnection.setFixedLengthStreamingMode(fileSize);
|
||||
urlConnection.setRequestProperty("Content-Type", "application/octet-stream");
|
||||
for (Entry<String, String> header : slot.getHeaders().entrySet()) {
|
||||
for (Map.Entry<String, String> header : slot.getHeaders().entrySet()) {
|
||||
urlConnection.setRequestProperty(header.getKey(), header.getValue());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2016 Florian Schmaus
|
||||
* Copyright 2016-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.
|
||||
|
|
@ -22,7 +22,6 @@ import org.jivesoftware.smack.Manager;
|
|||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.iqrequest.AbstractIqRequestHandler;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.IQ.Type;
|
||||
|
||||
import org.jivesoftware.smackx.iot.provisioning.IoTProvisioningManager;
|
||||
|
||||
|
|
@ -70,7 +69,7 @@ public abstract class IoTManager extends Manager {
|
|||
|
||||
protected abstract class IoTIqRequestHandler extends AbstractIqRequestHandler {
|
||||
|
||||
protected IoTIqRequestHandler(String element, String namespace, Type type, Mode mode) {
|
||||
protected IoTIqRequestHandler(String element, String namespace, IQ.Type type, Mode mode) {
|
||||
super(element, namespace, type, mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import java.util.Iterator;
|
|||
import org.jivesoftware.smackx.iot.control.ThingControlRequest;
|
||||
import org.jivesoftware.smackx.iot.data.ThingMomentaryReadOutRequest;
|
||||
import org.jivesoftware.smackx.iot.discovery.element.Tag;
|
||||
import org.jivesoftware.smackx.iot.discovery.element.Tag.Type;
|
||||
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
||||
|
||||
public final class Thing {
|
||||
|
|
@ -112,35 +111,35 @@ public final class Thing {
|
|||
|
||||
public Builder setSerialNumber(String sn) {
|
||||
final String name = "SN";
|
||||
Tag tag = new Tag(name, Type.str, sn);
|
||||
Tag tag = new Tag(name, Tag.Type.str, sn);
|
||||
metaTags.put(name, tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setKey(String key) {
|
||||
final String name = "KEY";
|
||||
Tag tag = new Tag(name, Type.str, key);
|
||||
Tag tag = new Tag(name, Tag.Type.str, key);
|
||||
metaTags.put(name, tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setManufacturer(String manufacturer) {
|
||||
final String name = "MAN";
|
||||
Tag tag = new Tag(name, Type.str, manufacturer);
|
||||
Tag tag = new Tag(name, Tag.Type.str, manufacturer);
|
||||
metaTags.put(name, tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setModel(String model) {
|
||||
final String name = "MODEL";
|
||||
Tag tag = new Tag(name, Type.str, model);
|
||||
Tag tag = new Tag(name, Tag.Type.str, model);
|
||||
metaTags.put(name, tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setVersion(String version) {
|
||||
final String name = "V";
|
||||
Tag tag = new Tag(name, Type.num, version);
|
||||
Tag tag = new Tag(name, Tag.Type.num, version);
|
||||
metaTags.put(name, tag);
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright © 2016-2019 Florian Schmaus
|
||||
* Copyright © 2016-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.
|
||||
|
|
@ -24,8 +24,6 @@ import java.util.List;
|
|||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||
import org.jivesoftware.smack.parsing.SmackParsingException.SmackTextParseException;
|
||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||
import org.jivesoftware.smack.util.ParserUtils;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
|
|
@ -45,7 +43,8 @@ public class IoTFieldsExtensionProvider extends ExtensionElementProvider<IoTFiel
|
|||
private static final Logger LOGGER = Logger.getLogger(IoTFieldsExtensionProvider.class.getName());
|
||||
|
||||
@Override
|
||||
public IoTFieldsExtension parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackTextParseException {
|
||||
public IoTFieldsExtension parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||
throws IOException, XmlPullParserException, ParseException {
|
||||
int seqNr = ParserUtils.getIntegerAttributeOrThrow(parser, "seqnr", "IoT data request <accepted/> without sequence number");
|
||||
boolean done = ParserUtils.getBooleanAttribute(parser, "done", false);
|
||||
List<NodeElement> nodes = new ArrayList<>();
|
||||
|
|
@ -74,7 +73,7 @@ public class IoTFieldsExtensionProvider extends ExtensionElementProvider<IoTFiel
|
|||
return new IoTFieldsExtension(seqNr, done, nodes);
|
||||
}
|
||||
|
||||
public NodeElement parseNode(XmlPullParser parser) throws XmlPullParserException, IOException, SmackTextParseException {
|
||||
public NodeElement parseNode(XmlPullParser parser) throws XmlPullParserException, IOException, ParseException {
|
||||
final int initialDepth = parser.getDepth();
|
||||
final NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
||||
List<TimestampElement> timestampElements = new ArrayList<>();
|
||||
|
|
@ -103,15 +102,11 @@ public class IoTFieldsExtensionProvider extends ExtensionElementProvider<IoTFiel
|
|||
return new NodeElement(nodeInfo, timestampElements);
|
||||
}
|
||||
|
||||
public TimestampElement parseTimestampElement(XmlPullParser parser) throws XmlPullParserException, IOException, SmackTextParseException {
|
||||
public TimestampElement parseTimestampElement(XmlPullParser parser)
|
||||
throws XmlPullParserException, IOException, ParseException {
|
||||
final int initialDepth = parser.getDepth();
|
||||
final String dateString = parser.getAttributeValue(null, "value");
|
||||
Date date;
|
||||
try {
|
||||
date = XmppDateTime.parseDate(dateString);
|
||||
} catch (ParseException e) {
|
||||
throw new SmackParsingException.SmackTextParseException(e);
|
||||
}
|
||||
Date date = XmppDateTime.parseDate(dateString);
|
||||
List<IoTDataField> fields = new ArrayList<>();
|
||||
outerloop: while (true) {
|
||||
final XmlPullParser.Event eventType = parser.next();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2016-2019 Florian Schmaus
|
||||
* Copyright 2016-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.
|
||||
|
|
@ -39,7 +39,6 @@ import org.jivesoftware.smack.filter.StanzaTypeFilter;
|
|||
import org.jivesoftware.smack.iqrequest.AbstractIqRequestHandler;
|
||||
import org.jivesoftware.smack.iqrequest.IQRequestHandler.Mode;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.IQ.Type;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
|
|
@ -201,7 +200,7 @@ public final class IoTProvisioningManager extends Manager {
|
|||
}, FRIEND_MESSAGE);
|
||||
|
||||
connection.registerIQRequestHandler(
|
||||
new AbstractIqRequestHandler(ClearCache.ELEMENT, ClearCache.NAMESPACE, Type.set, Mode.async) {
|
||||
new AbstractIqRequestHandler(ClearCache.ELEMENT, ClearCache.NAMESPACE, IQ.Type.set, Mode.async) {
|
||||
@Override
|
||||
public IQ handleIQRequest(IQ iqRequest) {
|
||||
if (!isFromProvisioningService(iqRequest, true)) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class JingleFileTransferProvider
|
|||
extends JingleContentDescriptionProvider<JingleFileTransfer> {
|
||||
|
||||
@Override
|
||||
public JingleFileTransfer parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||
public JingleFileTransfer parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException, ParseException {
|
||||
ArrayList<JingleContentDescriptionChildElement> payloads = new ArrayList<>();
|
||||
JingleFileTransferChild.Builder builder = JingleFileTransferChild.getBuilder();
|
||||
|
||||
|
|
@ -59,11 +59,7 @@ public class JingleFileTransferProvider
|
|||
elementName = parser.getName();
|
||||
switch (elementName) {
|
||||
case JingleFileTransferChild.ELEM_DATE:
|
||||
try {
|
||||
builder.setDate(XmppDateTime.parseXEP0082Date(parser.nextText()));
|
||||
} catch (ParseException e) {
|
||||
throw new SmackParsingException.SmackTextParseException(e);
|
||||
}
|
||||
break;
|
||||
|
||||
case JingleFileTransferChild.ELEM_DESC:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2016 Fernando Ramirez, 2020 Florian Schmaus
|
||||
* Copyright 2016 Fernando Ramirez, 2020-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.
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
package org.jivesoftware.smackx.mam.provider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
|
|
@ -40,7 +41,8 @@ import org.jivesoftware.smackx.mam.element.MamElements.MamResultExtension;
|
|||
public class MamResultProvider extends ExtensionElementProvider<MamResultExtension> {
|
||||
|
||||
@Override
|
||||
public MamResultExtension parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||
public MamResultExtension parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||
throws XmlPullParserException, IOException, SmackParsingException, ParseException {
|
||||
Forwarded<Message> forwarded = null;
|
||||
String queryId = parser.getAttributeValue("", "queryid");
|
||||
String id = parser.getAttributeValue("", "id");
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.jivesoftware.smackx.message_retraction.provider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
|
|
@ -34,7 +35,7 @@ public class RetractedElementProvider extends ExtensionElementProvider<Retracted
|
|||
|
||||
@Override
|
||||
public RetractedElement parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||
throws XmlPullParserException, IOException, SmackParsingException {
|
||||
throws XmlPullParserException, IOException, SmackParsingException, ParseException {
|
||||
Date date = ParserUtils.getDateFromXep82String(parser.getAttributeValue("", RetractedElement.ATTR_STAMP));
|
||||
|
||||
OriginIdElement originIdElement = null;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
|||
import org.jivesoftware.smack.filter.IQReplyFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.IQ.Type;
|
||||
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
|
||||
|
|
@ -228,7 +227,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
private MUCLightBlockingIQ getBlockingList(DomainBareJid mucLightService)
|
||||
throws NoResponseException, XMPPErrorException, InterruptedException, NotConnectedException {
|
||||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(null, null);
|
||||
mucLightBlockingIQ.setType(Type.get);
|
||||
mucLightBlockingIQ.setType(IQ.Type.get);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
|
||||
StanzaFilter responseFilter = new IQReplyFilter(mucLightBlockingIQ, connection());
|
||||
|
|
@ -278,7 +277,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
private void sendBlockRooms(DomainBareJid mucLightService, HashMap<Jid, Boolean> rooms)
|
||||
throws NoResponseException, XMPPErrorException, InterruptedException, NotConnectedException {
|
||||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(rooms, null);
|
||||
mucLightBlockingIQ.setType(Type.set);
|
||||
mucLightBlockingIQ.setType(IQ.Type.set);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
connection().createStanzaCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
}
|
||||
|
|
@ -322,7 +321,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
private void sendBlockUsers(DomainBareJid mucLightService, HashMap<Jid, Boolean> users)
|
||||
throws NoResponseException, XMPPErrorException, InterruptedException, NotConnectedException {
|
||||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(null, users);
|
||||
mucLightBlockingIQ.setType(Type.set);
|
||||
mucLightBlockingIQ.setType(IQ.Type.set);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
connection().createStanzaCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
}
|
||||
|
|
@ -366,7 +365,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
private void sendUnblockRooms(DomainBareJid mucLightService, HashMap<Jid, Boolean> rooms)
|
||||
throws NoResponseException, XMPPErrorException, InterruptedException, NotConnectedException {
|
||||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(rooms, null);
|
||||
mucLightBlockingIQ.setType(Type.set);
|
||||
mucLightBlockingIQ.setType(IQ.Type.set);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
connection().createStanzaCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
}
|
||||
|
|
@ -410,7 +409,7 @@ public final class MultiUserChatLightManager extends Manager {
|
|||
private void sendUnblockUsers(DomainBareJid mucLightService, HashMap<Jid, Boolean> users)
|
||||
throws NoResponseException, XMPPErrorException, InterruptedException, NotConnectedException {
|
||||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(null, users);
|
||||
mucLightBlockingIQ.setType(Type.set);
|
||||
mucLightBlockingIQ.setType(IQ.Type.set);
|
||||
mucLightBlockingIQ.setTo(mucLightService);
|
||||
connection().createStanzaCollectorAndSend(mucLightBlockingIQ).nextResultOrThrow();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.muclight.provider;
|
|||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.jivesoftware.smack.packet.IQ.Type;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
|
|
@ -65,7 +65,7 @@ public class MUCLightBlockingIQProvider extends IQProvider<MUCLightBlockingIQ> {
|
|||
}
|
||||
|
||||
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(rooms, users);
|
||||
mucLightBlockingIQ.setType(Type.result);
|
||||
mucLightBlockingIQ.setType(IQ.Type.result);
|
||||
return mucLightBlockingIQ;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import org.jivesoftware.smack.XMPPConnection;
|
|||
import org.jivesoftware.smack.XMPPConnectionRegistry;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.IQ.Type;
|
||||
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.push_notifications.element.DisablePushNotificationsIQ;
|
||||
|
|
@ -166,7 +165,7 @@ public final class PushNotificationsManager extends Manager {
|
|||
throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException {
|
||||
final XMPPConnection connection = connection();
|
||||
IQ responseIQ = connection.createStanzaCollectorAndSend(iq).nextResultOrThrow();
|
||||
return responseIQ.getType() != Type.error;
|
||||
return responseIQ.getType() != IQ.Type.error;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.jivesoftware.smackx.stanza_content_encryption.provider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
|
|
@ -42,7 +43,7 @@ public class ContentElementProvider extends ExtensionElementProvider<ContentElem
|
|||
|
||||
@Override
|
||||
public ContentElement parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||
throws XmlPullParserException, IOException, SmackParsingException {
|
||||
throws XmlPullParserException, IOException, ParseException, SmackParsingException {
|
||||
ContentElement.Builder builder = ContentElement.builder();
|
||||
|
||||
while (true) {
|
||||
|
|
@ -117,7 +118,7 @@ public class ContentElementProvider extends ExtensionElementProvider<ContentElem
|
|||
}
|
||||
|
||||
private static void parseTimestampAffix(XmlPullParser parser, ContentElement.Builder builder)
|
||||
throws SmackParsingException.SmackTextParseException {
|
||||
throws ParseException {
|
||||
Date timestamp = ParserUtils.getDateFromXep82String(
|
||||
parser.getAttributeValue("", TimestampAffixElement.ATTR_STAMP));
|
||||
builder.setTimestamp(timestamp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue