/** * Returns a new ReportedData if the stanza is used for reporting data and includes an * extension that matches the elementName and namespace "x","jabber:x:data". * * @param packet the stanza used for reporting data. * @return ReportedData from the packet if present, otherwise null. */ public static ReportedData getReportedDataFrom(Stanza packet) { // Check if the packet includes the DataForm extension DataForm dataForm = DataForm.from(packet); if (dataForm != null) { if (dataForm.getReportedData() != null) return new ReportedData(dataForm); } // Otherwise return null return null; }
protected void parseItems(XmlPullParser parser) throws XmlPullParserException, IOException { ReportedData data = new ReportedData(); data.addColumn(new ReportedData.Column("JID", "jid", FormField.Type.text_single));