Package org.jivesoftware.smack.util
Class ParserUtils
java.lang.Object
org.jivesoftware.smack.util.ParserUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertAtEndTag(org.jivesoftware.smack.xml.XmlPullParser parser) static voidassertAtStartTag(org.jivesoftware.smack.xml.XmlPullParser parser) static voidassertAtStartTag(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static voidforwardToEndTagOfDepth(org.jivesoftware.smack.xml.XmlPullParser parser, int depth) static voidforwardToStartElement(org.jivesoftware.smack.xml.XmlPullParser parser) static org.jxmpp.jid.EntityBareJidgetBareJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser) static org.jxmpp.jid.EntityBareJidgetBareJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static BooleangetBooleanAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) Get the boolean value of an argument.static booleangetBooleanAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, boolean defaultValue) static BytegetByteAttributeFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) static DategetDateFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) static DategetDateFromOptionalXep82String(String dateString) static DategetDateFromString(String dateString) static DategetDateFromXep82String(String dateString) static DoublegetDoubleAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static doublegetDoubleAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, long defaultValue) static doublegetDoubleFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) static org.jxmpp.jid.EntityJidgetEntityJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static org.jxmpp.jid.EntityFullJidgetFullJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser) static org.jxmpp.jid.EntityFullJidgetFullJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static IntegergetIntegerAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static intgetIntegerAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, int defaultValue) static intgetIntegerAttributeOrThrow(org.jivesoftware.smack.xml.XmlPullParser parser, String name, String throwMessage) static intgetIntegerFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) static InternetAddressgetInternetAddressIngoringZoneIdAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String attribute) static org.jxmpp.jid.JidgetJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser) static org.jxmpp.jid.JidgetJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static LonggetLongAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static longgetLongAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, long defaultValue) static StringgetRequiredAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static StringgetRequiredNextText(org.jivesoftware.smack.xml.XmlPullParser parser) static UInt16getRequiredUInt16Attribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static org.jxmpp.jid.parts.ResourcepartgetResourcepartAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static ShortgetShortAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static shortgetShortAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, short defaultValue) static UInt16getUInt16Attribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static UInt32getUInt32Attribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) static URIgetUriFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) static StringgetXmlLang(org.jivesoftware.smack.xml.XmlPullParser parser) static StringgetXmlLang(org.jivesoftware.smack.xml.XmlPullParser parser, XmlEnvironment xmlEnvironment) static booleanparseXmlBoolean(String booleanString) Phrase a string to a boolean value as per "xs:boolean".
-
Field Details
-
JID
The constant String "jid".- See Also:
-
-
Constructor Details
-
ParserUtils
public ParserUtils()
-
-
Method Details
-
assertAtStartTag
public static void assertAtStartTag(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jivesoftware.smack.xml.XmlPullParserException - Throws:
org.jivesoftware.smack.xml.XmlPullParserException
-
assertAtStartTag
public static void assertAtStartTag(org.jivesoftware.smack.xml.XmlPullParser parser, String name) throws org.jivesoftware.smack.xml.XmlPullParserException - Throws:
org.jivesoftware.smack.xml.XmlPullParserException
-
assertAtEndTag
public static void assertAtEndTag(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jivesoftware.smack.xml.XmlPullParserException - Throws:
org.jivesoftware.smack.xml.XmlPullParserException
-
forwardToStartElement
public static void forwardToStartElement(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jivesoftware.smack.xml.XmlPullParserException, IOException - Throws:
org.jivesoftware.smack.xml.XmlPullParserExceptionIOException
-
forwardToEndTagOfDepth
public static void forwardToEndTagOfDepth(org.jivesoftware.smack.xml.XmlPullParser parser, int depth) throws org.jivesoftware.smack.xml.XmlPullParserException, IOException - Throws:
org.jivesoftware.smack.xml.XmlPullParserExceptionIOException
-
getJidAttribute
public static org.jxmpp.jid.Jid getJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jxmpp.stringprep.XmppStringprepException - Throws:
org.jxmpp.stringprep.XmppStringprepException
-
getJidAttribute
public static org.jxmpp.jid.Jid getJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) throws org.jxmpp.stringprep.XmppStringprepException - Throws:
org.jxmpp.stringprep.XmppStringprepException
-
getBareJidAttribute
public static org.jxmpp.jid.EntityBareJid getBareJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jxmpp.stringprep.XmppStringprepException - Throws:
org.jxmpp.stringprep.XmppStringprepException
-
getBareJidAttribute
public static org.jxmpp.jid.EntityBareJid getBareJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) throws org.jxmpp.stringprep.XmppStringprepException - Throws:
org.jxmpp.stringprep.XmppStringprepException
-
getFullJidAttribute
public static org.jxmpp.jid.EntityFullJid getFullJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jxmpp.stringprep.XmppStringprepException - Throws:
org.jxmpp.stringprep.XmppStringprepException
-
getFullJidAttribute
public static org.jxmpp.jid.EntityFullJid getFullJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) throws org.jxmpp.stringprep.XmppStringprepException - Throws:
org.jxmpp.stringprep.XmppStringprepException
-
getEntityJidAttribute
public static org.jxmpp.jid.EntityJid getEntityJidAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) throws org.jxmpp.stringprep.XmppStringprepException - Throws:
org.jxmpp.stringprep.XmppStringprepException
-
getResourcepartAttribute
public static org.jxmpp.jid.parts.Resourcepart getResourcepartAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) throws org.jxmpp.stringprep.XmppStringprepException - Throws:
org.jxmpp.stringprep.XmppStringprepException
-
parseXmlBoolean
Phrase a string to a boolean value as per "xs:boolean". Valid input strings are "true", "1" for true, and "false", "0" for false.- Parameters:
booleanString- the input string.- Returns:
- the boolean representation of the input string
- Throws:
IllegalArgumentException- if the input string is not valid.- Since:
- 4.3.2
-
getBooleanAttribute
public static Boolean getBooleanAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) Get the boolean value of an argument.- Parameters:
parser- TODO javadoc me pleasename- TODO javadoc me please- Returns:
- the boolean value or null of no argument of the given name exists
-
getBooleanAttribute
public static boolean getBooleanAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, boolean defaultValue) -
getByteAttributeFromNextText
public static Byte getByteAttributeFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) throws IOException, org.jivesoftware.smack.xml.XmlPullParserException - Throws:
IOExceptionorg.jivesoftware.smack.xml.XmlPullParserException
-
getIntegerAttributeOrThrow
public static int getIntegerAttributeOrThrow(org.jivesoftware.smack.xml.XmlPullParser parser, String name, String throwMessage) throws IOException - Throws:
IOException
-
getIntegerAttribute
-
getIntegerAttribute
public static int getIntegerAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, int defaultValue) -
getUInt16Attribute
-
getRequiredUInt16Attribute
public static UInt16 getRequiredUInt16Attribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) throws SmackParsingException.RequiredAttributeMissingException -
getIntegerFromNextText
public static int getIntegerFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jivesoftware.smack.xml.XmlPullParserException, IOException - Throws:
org.jivesoftware.smack.xml.XmlPullParserExceptionIOException
-
getLongAttribute
-
getLongAttribute
public static long getLongAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, long defaultValue) -
getUInt32Attribute
-
getDoubleFromNextText
public static double getDoubleFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jivesoftware.smack.xml.XmlPullParserException, IOException - Throws:
org.jivesoftware.smack.xml.XmlPullParserExceptionIOException
-
getDoubleAttribute
-
getDoubleAttribute
public static double getDoubleAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, long defaultValue) -
getShortAttribute
-
getShortAttribute
public static short getShortAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name, short defaultValue) -
getDateFromOptionalXep82String
- Throws:
ParseException
-
getDateFromXep82String
- Throws:
ParseException
-
getDateFromString
- Throws:
ParseException
-
getDateFromNextText
public static Date getDateFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jivesoftware.smack.xml.XmlPullParserException, IOException, ParseException - Throws:
org.jivesoftware.smack.xml.XmlPullParserExceptionIOExceptionParseException
-
getUriFromNextText
public static URI getUriFromNextText(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jivesoftware.smack.xml.XmlPullParserException, IOException, SmackParsingException.SmackUriSyntaxParsingException - Throws:
org.jivesoftware.smack.xml.XmlPullParserExceptionIOExceptionSmackParsingException.SmackUriSyntaxParsingException
-
getRequiredAttribute
public static String getRequiredAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String name) throws IOException - Throws:
IOException
-
getRequiredNextText
public static String getRequiredNextText(org.jivesoftware.smack.xml.XmlPullParser parser) throws org.jivesoftware.smack.xml.XmlPullParserException, IOException - Throws:
org.jivesoftware.smack.xml.XmlPullParserExceptionIOException
-
getXmlLang
public static String getXmlLang(org.jivesoftware.smack.xml.XmlPullParser parser, XmlEnvironment xmlEnvironment) -
getXmlLang
-
getInternetAddressIngoringZoneIdAttribute
public static InternetAddress getInternetAddressIngoringZoneIdAttribute(org.jivesoftware.smack.xml.XmlPullParser parser, String attribute)
-