public class PacketParserUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PacketParserUtils.UnparsedResultIQ
This class represents and unparsed IQ of the type 'result'.
|
Constructor and Description |
---|
PacketParserUtils() |
Modifier and Type | Method and Description |
---|---|
static org.xmlpull.v1.XmlPullParser |
getParserFor(java.io.Reader reader) |
static org.xmlpull.v1.XmlPullParser |
getParserFor(java.lang.String stanza) |
static org.xmlpull.v1.XmlPullParser |
getParserFor(java.lang.String stanza,
java.lang.String startTag) |
static java.util.Collection<java.lang.String> |
parseCompressionMethods(org.xmlpull.v1.XmlPullParser parser)
Parse the available compression methods reported from the server.
|
static java.lang.String |
parseContentDepth(org.xmlpull.v1.XmlPullParser parser,
int depth) |
static XMPPError |
parseError(org.xmlpull.v1.XmlPullParser parser)
Parses error sub-packets.
|
static IQ |
parseIQ(org.xmlpull.v1.XmlPullParser parser,
XMPPConnection connection)
Parses an IQ packet.
|
static java.util.Collection<java.lang.String> |
parseMechanisms(org.xmlpull.v1.XmlPullParser parser)
Parse the available SASL mechanisms reported from the server.
|
static Message |
parseMessage(org.xmlpull.v1.XmlPullParser parser)
Parses a message packet.
|
static PacketExtension |
parsePacketExtension(java.lang.String elementName,
java.lang.String namespace,
org.xmlpull.v1.XmlPullParser parser)
Parses a packet extension sub-packet.
|
static Presence |
parsePresence(org.xmlpull.v1.XmlPullParser parser)
Parses a presence packet.
|
static SASLMechanism.SASLFailure |
parseSASLFailure(org.xmlpull.v1.XmlPullParser parser)
Parses SASL authentication error packets.
|
static Packet |
parseStanza(java.lang.String stanza) |
static Packet |
parseStanza(org.xmlpull.v1.XmlPullParser parser) |
static Packet |
parseStanza(org.xmlpull.v1.XmlPullParser parser,
XMPPConnection connection)
Tries to parse and return either a Message, IQ or Presence stanza.
|
static StreamError |
parseStreamError(org.xmlpull.v1.XmlPullParser parser)
Parses stream error packets.
|
static java.lang.Object |
parseWithIntrospection(java.lang.String elementName,
java.lang.Class<?> objectClass,
org.xmlpull.v1.XmlPullParser parser) |
public static org.xmlpull.v1.XmlPullParser getParserFor(java.lang.String stanza) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
org.xmlpull.v1.XmlPullParserException
java.io.IOException
public static org.xmlpull.v1.XmlPullParser getParserFor(java.io.Reader reader) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
org.xmlpull.v1.XmlPullParserException
java.io.IOException
public static org.xmlpull.v1.XmlPullParser getParserFor(java.lang.String stanza, java.lang.String startTag) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
org.xmlpull.v1.XmlPullParserException
java.io.IOException
public static Packet parseStanza(java.lang.String stanza) throws java.lang.Exception
java.lang.Exception
public static Packet parseStanza(org.xmlpull.v1.XmlPullParser parser) throws java.lang.Exception
java.lang.Exception
public static Packet parseStanza(org.xmlpull.v1.XmlPullParser parser, XMPPConnection connection) throws java.lang.Exception
parser
- connection
- java.lang.Exception
public static Message parseMessage(org.xmlpull.v1.XmlPullParser parser) throws java.lang.Exception
parser
- the XML parser, positioned at the start of a message packet.java.lang.Exception
- if an exception occurs while parsing the packet.public static java.lang.String parseContentDepth(org.xmlpull.v1.XmlPullParser parser, int depth) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
org.xmlpull.v1.XmlPullParserException
java.io.IOException
public static Presence parsePresence(org.xmlpull.v1.XmlPullParser parser) throws java.lang.Exception
parser
- the XML parser, positioned at the start of a presence packet.java.lang.Exception
- if an exception occurs while parsing the packet.public static IQ parseIQ(org.xmlpull.v1.XmlPullParser parser, XMPPConnection connection) throws java.lang.Exception
parser
- the XML parser, positioned at the start of an IQ packet.connection
- the optional XMPPConnection used to send feature-not-implemented replies.java.lang.Exception
- if an exception occurs while parsing the packet.public static java.util.Collection<java.lang.String> parseMechanisms(org.xmlpull.v1.XmlPullParser parser) throws java.lang.Exception
parser
- the XML parser, positioned at the start of the mechanisms stanza.java.lang.Exception
- if an exception occurs while parsing the stanza.public static java.util.Collection<java.lang.String> parseCompressionMethods(org.xmlpull.v1.XmlPullParser parser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException
parser
- the XML parser, positioned at the start of the compression stanza.org.xmlpull.v1.XmlPullParserException
- if an exception occurs while parsing the stanza.java.io.IOException
public static SASLMechanism.SASLFailure parseSASLFailure(org.xmlpull.v1.XmlPullParser parser) throws java.lang.Exception
parser
- the XML parser.java.lang.Exception
- if an exception occurs while parsing the packet.public static StreamError parseStreamError(org.xmlpull.v1.XmlPullParser parser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException
parser
- the XML parser.org.xmlpull.v1.XmlPullParserException
- if an exception occurs while parsing the packet.java.io.IOException
public static XMPPError parseError(org.xmlpull.v1.XmlPullParser parser) throws java.lang.Exception
parser
- the XML parser.java.lang.Exception
- if an exception occurs while parsing the packet.public static PacketExtension parsePacketExtension(java.lang.String elementName, java.lang.String namespace, org.xmlpull.v1.XmlPullParser parser) throws java.lang.Exception
elementName
- the XML element name of the packet extension.namespace
- the XML namespace of the packet extension.parser
- the XML parser, positioned at the starting element of the extension.java.lang.Exception
public static java.lang.Object parseWithIntrospection(java.lang.String elementName, java.lang.Class<?> objectClass, org.xmlpull.v1.XmlPullParser parser) throws java.lang.NoSuchMethodException, java.lang.SecurityException, java.lang.InstantiationException, java.lang.IllegalAccessException, org.xmlpull.v1.XmlPullParserException, java.io.IOException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.InstantiationException
java.lang.IllegalAccessException
org.xmlpull.v1.XmlPullParserException
java.io.IOException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException