Package org.jivesoftware.smack.util
Class ParserUtils
- java.lang.Object
-
- org.jivesoftware.smack.util.ParserUtils
-
public class ParserUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ParserUtils()
-
Method Summary
-
-
-
Field Detail
-
JID
public static final String JID
The constant String "jid".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParserUtils
public ParserUtils()
-
-
Method Detail
-
assertAtStartTag
public static void assertAtStartTag(XmlPullParser parser) throws XmlPullParserException
- Throws:
XmlPullParserException
-
assertAtStartTag
public static void assertAtStartTag(XmlPullParser parser, String name) throws XmlPullParserException
- Throws:
XmlPullParserException
-
assertAtEndTag
public static void assertAtEndTag(XmlPullParser parser) throws XmlPullParserException
- Throws:
XmlPullParserException
-
forwardToStartElement
public static void forwardToStartElement(XmlPullParser parser) throws XmlPullParserException, IOException
- Throws:
XmlPullParserException
IOException
-
forwardToEndTagOfDepth
public static void forwardToEndTagOfDepth(XmlPullParser parser, int depth) throws XmlPullParserException, IOException
- Throws:
XmlPullParserException
IOException
-
getJidAttribute
public static Jid getJidAttribute(XmlPullParser parser) throws XmppStringprepException
- Throws:
XmppStringprepException
-
getJidAttribute
public static Jid getJidAttribute(XmlPullParser parser, String name) throws XmppStringprepException
- Throws:
XmppStringprepException
-
getBareJidAttribute
public static EntityBareJid getBareJidAttribute(XmlPullParser parser) throws XmppStringprepException
- Throws:
XmppStringprepException
-
getBareJidAttribute
public static EntityBareJid getBareJidAttribute(XmlPullParser parser, String name) throws XmppStringprepException
- Throws:
XmppStringprepException
-
getFullJidAttribute
public static EntityFullJid getFullJidAttribute(XmlPullParser parser) throws XmppStringprepException
- Throws:
XmppStringprepException
-
getFullJidAttribute
public static EntityFullJid getFullJidAttribute(XmlPullParser parser, String name) throws XmppStringprepException
- Throws:
XmppStringprepException
-
getEntityJidAttribute
public static EntityJid getEntityJidAttribute(XmlPullParser parser, String name) throws XmppStringprepException
- Throws:
XmppStringprepException
-
getResourcepartAttribute
public static Resourcepart getResourcepartAttribute(XmlPullParser parser, String name) throws XmppStringprepException
- Throws:
XmppStringprepException
-
parseXmlBoolean
public static boolean parseXmlBoolean(String booleanString)
Prase 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(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(XmlPullParser parser, String name, boolean defaultValue)
-
getByteAttributeFromNextText
public static Byte getByteAttributeFromNextText(XmlPullParser parser) throws IOException, XmlPullParserException
- Throws:
IOException
XmlPullParserException
-
getIntegerAttributeOrThrow
public static int getIntegerAttributeOrThrow(XmlPullParser parser, String name, String throwMessage) throws IOException
- Throws:
IOException
-
getIntegerAttribute
public static Integer getIntegerAttribute(XmlPullParser parser, String name)
-
getIntegerAttribute
public static int getIntegerAttribute(XmlPullParser parser, String name, int defaultValue)
-
getUInt16Attribute
public static UInt16 getUInt16Attribute(XmlPullParser parser, String name)
-
getRequiredUInt16Attribute
public static UInt16 getRequiredUInt16Attribute(XmlPullParser parser, String name) throws SmackParsingException.RequiredAttributeMissingException
-
getIntegerFromNextText
public static int getIntegerFromNextText(XmlPullParser parser) throws XmlPullParserException, IOException
- Throws:
XmlPullParserException
IOException
-
getLongAttribute
public static Long getLongAttribute(XmlPullParser parser, String name)
-
getLongAttribute
public static long getLongAttribute(XmlPullParser parser, String name, long defaultValue)
-
getUInt32Attribute
public static UInt32 getUInt32Attribute(XmlPullParser parser, String name)
-
getDoubleFromNextText
public static double getDoubleFromNextText(XmlPullParser parser) throws XmlPullParserException, IOException
- Throws:
XmlPullParserException
IOException
-
getDoubleAttribute
public static Double getDoubleAttribute(XmlPullParser parser, String name)
-
getDoubleAttribute
public static double getDoubleAttribute(XmlPullParser parser, String name, long defaultValue)
-
getShortAttribute
public static Short getShortAttribute(XmlPullParser parser, String name)
-
getShortAttribute
public static short getShortAttribute(XmlPullParser parser, String name, short defaultValue)
-
getDateFromOptionalXep82String
public static Date getDateFromOptionalXep82String(String dateString) throws SmackParsingException.SmackTextParseException
-
getDateFromXep82String
public static Date getDateFromXep82String(String dateString) throws SmackParsingException.SmackTextParseException
-
getDateFromString
public static Date getDateFromString(String dateString) throws SmackParsingException.SmackTextParseException
-
getDateFromNextText
public static Date getDateFromNextText(XmlPullParser parser) throws XmlPullParserException, IOException, SmackParsingException.SmackTextParseException
-
getUriFromNextText
public static URI getUriFromNextText(XmlPullParser parser) throws XmlPullParserException, IOException, SmackParsingException.SmackUriSyntaxParsingException
-
getRequiredAttribute
public static String getRequiredAttribute(XmlPullParser parser, String name) throws IOException
- Throws:
IOException
-
getRequiredNextText
public static String getRequiredNextText(XmlPullParser parser) throws XmlPullParserException, IOException
- Throws:
XmlPullParserException
IOException
-
getXmlLang
public static String getXmlLang(XmlPullParser parser, XmlEnvironment xmlEnvironment)
-
getXmlLang
public static String getXmlLang(XmlPullParser parser)
-
getQName
@Deprecated public static QName getQName(XmlPullParser parser)
Deprecated.useXmlPullParser.getQName()
instead.Get the QName of the current element.- Parameters:
parser
- the parser.- Returns:
- the Qname.
-
-