Add ParserUtils.getXmlLang(XmlPullParser)

and add TODO comment to PacketParserUtils.getLanguageAttribute().
This commit is contained in:
Florian Schmaus 2017-06-17 11:42:09 +02:00
parent 5424c9635f
commit 1448fa4632
2 changed files with 7 additions and 0 deletions

View File

@ -976,6 +976,8 @@ public class PacketParserUtils {
return new Session.Feature(optional);
}
// TODO Remove this static method and use ParserUtils.getXmlLang(XmlPullParser) instead.
private static String getLanguageAttribute(XmlPullParser parser) {
// CHECKSTYLE:OFF
for (int i = 0; i < parser.getAttributeCount(); i++) {

View File

@ -251,4 +251,9 @@ public class ParserUtils {
}
return text;
}
public static String getXmlLang(XmlPullParser parser) {
String langString = parser.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang");
return langString;
}
}